本文整理汇总了C#中Business.SetDefaultValue方法的典型用法代码示例。如果您正苦于以下问题:C# Business.SetDefaultValue方法的具体用法?C# Business.SetDefaultValue怎么用?C# Business.SetDefaultValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Business
的用法示例。
在下文中一共展示了Business.SetDefaultValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateControl
private BaseProfileControl CreateControl(Business.Term term, bool canEdit)
{
if (canEdit)
if (!term.Runtime.Enabled)
term.SetDefaultValue();
BaseProfileControl c = null;
//if (term.Runtime.Visible)
//{
switch (term.TermType)
{
case Business.TermType.Date:
{
c = (DateTermControl)LoadControl(Common.Names._UC_DateTermControl);
((DateTermControl)c).DateFormat = _itatSystem.DefaultDateFormat;
c.CanEdit = term.Runtime.Enabled;
break;
}
case Business.TermType.Renewal:
{
c = (RenewalTermControl)LoadControl(Common.Names._UC_RenewalTermControl);
((RenewalTermControl)c).DateFormat = _itatSystem.DefaultDateFormat;
c.CanEdit = term.Runtime.Enabled;
break;
}
case Business.TermType.Text:
{
c = (TextTermControl)LoadControl(Common.Names._UC_TextTermControl);
c.CanEdit = term.Runtime.Enabled;
break;
}
case Business.TermType.MSO:
{
c = (MSOTermControl)LoadControl(Common.Names._UC_MSOTermControl);
c.CanEdit = term.Runtime.Enabled;
break;
}
case Business.TermType.Facility:
{
c = (FacilityTermControl)LoadControl(Common.Names._UC_FacilityTermControl);
c.CanEdit = false;
if (canEdit)
if (!(((FacilityTerm)term).IsPrimary ?? false))
c.CanEdit = true;
((FacilityTermControl)c).SecurityHelper = _securityHelper;
break;
}
case Business.TermType.PickList:
{
c = (PickListTermControl)LoadControl(Common.Names._UC_PickListTermControl);
c.CanEdit = term.Runtime.Enabled;
break;
}
case Business.TermType.Link:
{
//only show the term on the Profile page if it is NOT a ManagedItemReference link
if (!((Business.LinkTerm)term).IsManagedItemReference ?? false)
{
c = (LinkTermControl)LoadControl(Common.Names._UC_LinkTermControl);
c.CanEdit = true;
if (Business.Term.ValidID(((Business.LinkTerm)term).ComplexListID))
{
Business.ComplexList complexList = (Business.ComplexList)(this.Page as BaseManagedItemPage).ManagedItem.FindTerm(((Business.LinkTerm)term).ComplexListID);
c.CanEdit = complexList.Runtime.Enabled;
}
}
break;
}
case Business.TermType.External:
{
c = (ExternalTermControl)LoadControl(Common.Names._UC_ExternalTermControl);
c.CanEdit = term.Runtime.Enabled;
break;
}
default:
break;
}
//} // if (term.Runtime.Visible)
if (c != null)
{
c.Term = term;
c.ID = Helper.ControlID(term.Name);
//if (!string.IsNullOrEmpty(_termNameHasFocus))
//{
// if (_termNameHasFocus == term.Name)
// {
// c.ControlHasFocus = _controlHasFocus;
// }
//}
}
return c;
}