当前位置: 首页>>代码示例>>C#>>正文


C# Business.SetDefaultValue方法代码示例

本文整理汇总了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;
		}
开发者ID:dlnuckolls,项目名称:glorykidd-public,代码行数:92,代码来源:ManagedItemProfile.aspx.cs


注:本文中的Business.SetDefaultValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。