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


C# Usr.IsEnabledPromoter方法代码示例

本文整理汇总了C#中Bobs.Usr.IsEnabledPromoter方法的典型用法代码示例。如果您正苦于以下问题:C# Usr.IsEnabledPromoter方法的具体用法?C# Usr.IsEnabledPromoter怎么用?C# Usr.IsEnabledPromoter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bobs.Usr的用法示例。


在下文中一共展示了Usr.IsEnabledPromoter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PanelEdit_Save

		public void PanelEdit_Save(object o, System.EventArgs e)
		{
			EnsureSecure();
			if (Page.IsValid)
			{
				Comp c = null;
				if (Mode.Equals(Modes.Add))
				{
					c = new Comp();
					c.DateTimeAdded = DateTime.Now;
					c.PromoterK = CurrentPromoter.K;
					c.Status = Comp.StatusEnum.New;
				}
				else if (Mode.Equals(Modes.Edit))
				{
					c = CurrentComp;
				}
				c.DisplayType = Comp.DisplayTypes.New;
				c.DateTimeStart = EditDateStart.SelectedDate;
				c.DateTimeClose = new DateTime(EditDateClose.SelectedDate.Year, EditDateClose.SelectedDate.Month, EditDateClose.SelectedDate.Day, 12, 0, 0);
				c.Question = Cambro.Web.Helpers.StripHtml(EditQuestion.Text.Trim()).Truncate(200);
				c.Answer1 = Cambro.Web.Helpers.StripHtml(EditAnswer1.Text.Trim()).Truncate(100);
				c.Answer2 = Cambro.Web.Helpers.StripHtml(EditAnswer2.Text.Trim()).Truncate(100);
				c.Answer3 = Cambro.Web.Helpers.StripHtml(EditAnswer3.Text.Trim()).Truncate(100);
				c.CorrectAnswer = EditCorrectRadio1.Checked ? 1 : (EditCorrectRadio2.Checked ? 2 : 3);
				c.Prize = Cambro.Web.Helpers.StripHtml(EditPrizesFirstDesc.Text.Trim()).Truncate(200);
				c.Prize2 = Cambro.Web.Helpers.StripHtml(EditPrizesSecondDesc.Text.Trim()).Truncate(200);
				c.Prize3 = Cambro.Web.Helpers.StripHtml(EditPrizesThirdDesc.Text.Trim()).Truncate(200);
				c.SponsorDetails = EditSponsorDescriptionHtml.GetHtml();
				try
				{
					c.Winners = int.Parse(EditPrizesFirstNumber.Text.Trim());
				}
				catch
				{
					throw new DsiUserFriendlyException("Number of first prizes must be a number");
				}
				try
				{
					c.Winners2 = EditPrizesSecondNumber.Text.Trim().Equals("") ? 0 : int.Parse(EditPrizesSecondNumber.Text.Trim());
				}
				catch
				{
					throw new DsiUserFriendlyException("Number of second prizes must be a number or blank");
				}
				try
				{
					c.Winners3 = EditPrizesThirdNumber.Text.Trim().Equals("") ? 0 : int.Parse(EditPrizesThirdNumber.Text.Trim());
				}
				catch
				{
					throw new DsiUserFriendlyException("Number of third prizes must be a number or blank");
				}

				Usr u;
				try
				{
					u = new Usr(int.Parse(EditPrizeContact.SelectedValue));
				}
				catch
				{
					throw new DsiUserFriendlyException("Prize contact not valid!");
				}
				if (!u.IsEnabledPromoter(CurrentPromoter.K))
					throw new DsiUserFriendlyException("Prize contact not valid!");
				c.OwnerUsrK = u.K;
				try
				{
					c.PrizeValueRange = int.Parse(EditPrizesValue.SelectedValue);
				}
				catch
				{
					throw new DsiUserFriendlyException("Prize value not valid!");
				}
				if (CurrentEvent != null)
				{
					c.LinkType = Comp.LinkTypes.Event;
					c.BrandK = 0;
					c.EventK = CurrentEvent.K;
				}
				else if (EditLinkNoneRadio.Checked)
				{
					c.LinkType = Comp.LinkTypes.None;
					c.BrandK = 0;
					c.EventK = 0;
				}
				else if (EditLinkEventRadio.Checked)
				{
					c.LinkType = Comp.LinkTypes.Event;
					c.BrandK = 0;
					if (UpcomingEvents.Count == 1)
						c.EventK = UpcomingEvents[0].K;
					else
					{
						Event ev;
						try
						{
							ev = new Event(int.Parse(EditLinkEventDropDown.SelectedValue));
						}
						catch
//.........这里部分代码省略.........
开发者ID:davelondon,项目名称:dontstayin,代码行数:101,代码来源:Competitions.ascx.cs


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