Пример #1
0
 protected void btnEditUser_Click(object sender, System.EventArgs e)
 {
     if (this.Page.Request.QueryString["ID"] == null)
     {
         MilkCardInfo mcinfo = new MilkCardInfo()
         {
             SiteId             = Globals.ToNum(this.ddlSite.SelectedValue),
             Status             = 0,
             CreateDate         = DateTime.Now,
             ProductId          = Globals.ToNum(this.hiddProductId.Value),
             FreeSendDays       = Globals.ToNum(txtFreeSendDays.Text),
             FreeQuantityPerDay = Globals.ToNum(txtFreeQuantityPerDay.Text)
         };
         if (VShopHelper.CreateMilkCards(mcinfo, Globals.ToNum(txtCardCount.Text)))
         {
             this.ShowMsgAndReUrl("创建成功", true, "MilkCardManage.aspx");
         }
     }
     else
     {
         MilkCardInfo mcinfo = VShopHelper.GetMilkCard(CardId);
         mcinfo.ProductId          = Globals.ToNum(this.hiddProductId.Value);
         mcinfo.FreeSendDays       = Globals.ToNum(txtFreeSendDays.Text);
         mcinfo.FreeQuantityPerDay = Globals.ToNum(txtFreeQuantityPerDay.Text);
         if (VShopHelper.UpdateMilkCard(mcinfo))
         {
             this.ShowMsgAndReUrl("编辑成功", true, "MilkCardManage.aspx");
         }
     }
 }