Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.btnAddCoupons.Click += this.btnAddCoupons_Click;
     if (!base.IsPostBack)
     {
         if (!int.TryParse(this.Page.Request.QueryString["combinationId"], out this.combinationId) || string.IsNullOrEmpty(this.Page.Request.QueryString["editType"]))
         {
             base.GotoResourceNotFound();
         }
         else
         {
             CombinationBuyInfo combinationBuyById = CombinationBuyHelper.GetCombinationBuyById(this.combinationId);
             if (combinationBuyById != null)
             {
                 HiddenField hiddenField   = this.hidMainProductId;
                 int         mainProductId = combinationBuyById.MainProductId;
                 hiddenField.Value             = mainProductId.ToString();
                 this.hidOtherProductIds.Value = combinationBuyById.OtherProductIds;
                 HiddenField hiddenField2 = this.hidCombinationId;
                 mainProductId      = combinationBuyById.CombinationId;
                 hiddenField2.Value = mainProductId.ToString();
                 this.calendarStartDate.SelectedDate = combinationBuyById.StartDate;
                 this.calendarEndDate.SelectedDate   = combinationBuyById.EndDate;
                 this.hidEditType.Value = this.Page.Request.QueryString["editType"];
             }
             else
             {
                 base.GotoResourceNotFound();
             }
         }
     }
 }
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["combinaid"], out this.combinaid))
     {
         base.GotoResourceNotFound("");
     }
     else
     {
         CombinationBuyInfo combinationBuyById = CombinationBuyHelper.GetCombinationBuyById(this.combinaid);
         if (combinationBuyById == null)
         {
             base.GotoResourceNotFound("");
         }
         else
         {
             DateTime now = DateTime.Now;
             int      num;
             if (!(now.Date > combinationBuyById.EndDate))
             {
                 now = DateTime.Now;
                 num = ((now.Date < combinationBuyById.StartDate) ? 1 : 0);
             }
             else
             {
                 num = 1;
             }
             if (num != 0)
             {
                 this.ShowWapMessage("活动未开始或者已结束", "ProductDetails.aspx?productId=" + combinationBuyById.MainProductId);
             }
             else
             {
                 this.HasActivitiesToJumpUrl(combinationBuyById.MainProductId);
                 if (base.ClientType.Equals(ClientType.VShop))
                 {
                     FightGroupActivitiyModel fightGroupActivitiyModel = VShopHelper.GetFightGroupActivities(new FightGroupActivitiyQuery
                     {
                         PageIndex = 1,
                         PageSize  = 1,
                         ProductId = combinationBuyById.MainProductId,
                         Status    = EnumFightGroupActivitiyStatus.BeingCarried
                     }).Models.FirstOrDefault();
                     if (fightGroupActivitiyModel != null)
                     {
                         this.Page.Response.Redirect("FightGroupActivityDetails.aspx?fightGroupActivityId=" + fightGroupActivitiyModel.FightGroupActivityId);
                     }
                 }
                 this.FindControls();
                 this.SetControlsValue(combinationBuyById.MainProductId);
                 PageTitle.AddSiteNameTitle("组合购详情页");
             }
         }
     }
 }