예제 #1
0
        private void Bind()
        {
            RedPagerActivityInfo redPagerActivityInfo = RedPagerActivityBrower.GetRedPagerActivityInfo(this.redpaperactivityid);

            if (redPagerActivityInfo == null)
            {
                this.ShowMsg("代金券活动不存在!", false);
            }
            else
            {
                this.txtName.Text = redPagerActivityInfo.Name;
                for (int i = 0; i < this.ddlCategoryId.Items.Count; i++)
                {
                    if (this.ddlCategoryId.Items[i].Value == redPagerActivityInfo.CategoryId.ToString())
                    {
                        this.ddlCategoryId.Items[i].Selected = true;
                        break;
                    }
                }
                this.txtMinOrderAmount.Text    = redPagerActivityInfo.MinOrderAmount.ToString("F2");
                this.txtMaxGetTimes.Text       = redPagerActivityInfo.MaxGetTimes.ToString();
                this.txtItemAmountLimit.Text   = redPagerActivityInfo.ItemAmountLimit.ToString("F2");
                this.txtOrderAmountCanUse.Text = redPagerActivityInfo.OrderAmountCanUse.ToString("F2");
                this.txtExpiryDays.Text        = redPagerActivityInfo.ExpiryDays.ToString();
            }
        }
예제 #2
0
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int num = 0;

            int.TryParse(e.CommandArgument.ToString(), out num);
            if (num > 0)
            {
                string commandName = e.CommandName;
                string str         = commandName;
                if (commandName != null)
                {
                    if (str == "del")
                    {
                        RedPagerActivityBrower.DelRedPagerActivity(num);
                    }
                    else if (str == "open")
                    {
                        RedPagerActivityBrower.SetIsOpen(num, true);
                    }
                    else if (str == "close")
                    {
                        RedPagerActivityBrower.SetIsOpen(num, false);
                    }
                }
                this.ReSearch(true);
            }
        }
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int result = 0;

            int.TryParse(e.CommandArgument.ToString(), out result);
            if (result > 0)
            {
                string commandName = e.CommandName;
                if (commandName != null)
                {
                    if (!(commandName == "del"))
                    {
                        if (commandName == "open")
                        {
                            RedPagerActivityBrower.SetIsOpen(result, true);
                        }
                        else if (commandName == "close")
                        {
                            RedPagerActivityBrower.SetIsOpen(result, false);
                        }
                    }
                    else
                    {
                        RedPagerActivityBrower.DelRedPagerActivity(result);
                    }
                }
                this.ReBind(true);
            }
        }
        private void BindData()
        {
            RedPagerActivityQuery entity = new RedPagerActivityQuery {
                Name      = this.Name,
                SortBy    = "RedPagerActivityId",
                SortOrder = SortAction.Desc
            };

            Globals.EntityCoding(entity, true);
            entity.PageIndex = this.pager.PageIndex;
            entity.PageSize  = this.pager.PageSize;
            DbQueryResult redPagerActivityRequest = RedPagerActivityBrower.GetRedPagerActivityRequest(entity);

            this.rptList.DataSource = redPagerActivityRequest.Data;
            this.rptList.DataBind();
            this.pager.TotalRecords = redPagerActivityRequest.TotalRecords;
        }
예제 #5
0
        private void LoadRedPagerActivityInfo()
        {
            RedPagerActivityInfo redPagerActivityInfo = RedPagerActivityBrower.GetRedPagerActivityInfo(this.m_redpaperactivityid);

            if (redPagerActivityInfo == null)
            {
                this.ShowMsg("代金券活动不存在!", false);
                return;
            }
            this.txtName.Text = redPagerActivityInfo.Name;
            int num = 0;

            while (true)
            {
                if (num >= this.ddlCategoryId.Items.Count)
                {
                    break;
                }
                else if (this.ddlCategoryId.Items[num].Value == redPagerActivityInfo.CategoryId.ToString())
                {
                    this.ddlCategoryId.Items[num].Selected = true;
                    break;
                }
                else
                {
                    num++;
                }
            }
            TextBox str            = this.txtMinOrderAmount;
            decimal minOrderAmount = redPagerActivityInfo.MinOrderAmount;

            str.Text = minOrderAmount.ToString("F2");
            this.txtMaxGetTimes.Text = redPagerActivityInfo.MaxGetTimes.ToString();
            TextBox textBox         = this.txtItemAmountLimit;
            decimal itemAmountLimit = redPagerActivityInfo.ItemAmountLimit;

            textBox.Text = itemAmountLimit.ToString("F2");
            TextBox str1 = this.txtOrderAmountCanUse;
            decimal orderAmountCanUse = redPagerActivityInfo.OrderAmountCanUse;

            str1.Text = orderAmountCanUse.ToString("F2");
            this.txtExpiryDays.Text = redPagerActivityInfo.ExpiryDays.ToString();
        }
예제 #6
0
 private void btn_Submint(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(this.txtName.Text.Trim()))
     {
         this.ShowMsg("名称不能为空", false);
     }
     else
     {
         decimal result = 0M;
         int     num2   = 0;
         decimal num3   = 0M;
         int     num4   = 0;
         decimal num5   = 0M;
         RedPagerActivityInfo redpaperactivity = new RedPagerActivityInfo();
         if (this.redpaperactivityid > 0)
         {
             redpaperactivity = RedPagerActivityBrower.GetRedPagerActivityInfo(this.redpaperactivityid);
         }
         if (redpaperactivity != null)
         {
             redpaperactivity.Name       = this.txtName.Text.Trim();
             redpaperactivity.CategoryId = int.Parse(this.ddlCategoryId.SelectedValue);
             decimal.TryParse(this.txtMinOrderAmount.Text.Trim(), out result);
             int.TryParse(this.txtMaxGetTimes.Text.Trim(), out num2);
             decimal.TryParse(this.txtItemAmountLimit.Text.Trim(), out num3);
             int.TryParse(this.txtExpiryDays.Text.Trim(), out num4);
             decimal.TryParse(this.txtOrderAmountCanUse.Text.Trim(), out num5);
             redpaperactivity.MinOrderAmount    = result;
             redpaperactivity.MaxGetTimes       = num2;
             redpaperactivity.ItemAmountLimit   = num3;
             redpaperactivity.ExpiryDays        = num4;
             redpaperactivity.OrderAmountCanUse = num5;
             if (RedPagerActivityBrower.IsExistsMinOrderAmount(redpaperactivity.RedPagerActivityId, redpaperactivity.MinOrderAmount))
             {
                 this.ShowMsg("已存在相同金额的代金券活动", false);
             }
             else if (this.redpaperactivityid > 0)
             {
                 if (RedPagerActivityBrower.UpdateRedPagerActivity(redpaperactivity))
                 {
                     if (base.Request.QueryString["reurl"] != null)
                     {
                         this.ReUrl = base.Request.QueryString["reurl"].ToString();
                     }
                     this.ShowMsgAndReUrl("代金券活动修改成功", true, this.ReUrl);
                 }
                 else
                 {
                     this.ShowMsg("代金券活动修改失败", false);
                 }
             }
             else if (RedPagerActivityBrower.CreateRedPagerActivity(redpaperactivity))
             {
                 this.ShowMsgAndReUrl("代金券活动新增成功", true, this.ReUrl);
             }
             else
             {
                 this.ShowMsg("代金券活动新增失败", false);
             }
         }
         else
         {
             this.ShowMsg("代金券活动不存在!", false);
         }
     }
 }
예제 #7
0
        private void btnSubmit_Click(object obj, EventArgs eventArg)
        {
            if (string.IsNullOrEmpty(this.txtName.Text.Trim()))
            {
                this.ShowMsg("名称不能为空", false);
                return;
            }
            decimal num  = new decimal(0);
            int     num1 = 0;
            decimal num2 = new decimal(0);
            int     num3 = 0;
            decimal num4 = new decimal(0);
            RedPagerActivityInfo redPagerActivityInfo = new RedPagerActivityInfo();

            if (this.m_redpaperactivityid > 0)
            {
                redPagerActivityInfo = RedPagerActivityBrower.GetRedPagerActivityInfo(this.m_redpaperactivityid);
            }
            if (redPagerActivityInfo == null)
            {
                this.ShowMsg("代金券活动不存在!", false);
                return;
            }
            redPagerActivityInfo.Name       = this.txtName.Text.Trim();
            redPagerActivityInfo.CategoryId = int.Parse(this.ddlCategoryId.SelectedValue);
            decimal.TryParse(this.txtMinOrderAmount.Text.Trim(), out num);
            int.TryParse(this.txtMaxGetTimes.Text.Trim(), out num1);
            decimal.TryParse(this.txtItemAmountLimit.Text.Trim(), out num2);
            int.TryParse(this.txtExpiryDays.Text.Trim(), out num3);
            decimal.TryParse(this.txtOrderAmountCanUse.Text.Trim(), out num4);
            redPagerActivityInfo.MinOrderAmount    = num;
            redPagerActivityInfo.MaxGetTimes       = num1;
            redPagerActivityInfo.ItemAmountLimit   = num2;
            redPagerActivityInfo.ExpiryDays        = num3;
            redPagerActivityInfo.OrderAmountCanUse = num4;
            if (RedPagerActivityBrower.IsExistsMinOrderAmount(redPagerActivityInfo.RedPagerActivityId, redPagerActivityInfo.MinOrderAmount))
            {
                this.ShowMsg("已存在相同金额的代金券活动", false);
                return;
            }
            if (this.m_redpaperactivityid <= 0)
            {
                if (!RedPagerActivityBrower.CreateRedPagerActivity(redPagerActivityInfo))
                {
                    this.ShowMsg("代金券活动新增失败", false);
                    return;
                }
                this.ShowMsgAndReUrl("代金券活动新增成功", true, this.ReUrl);
                return;
            }
            if (!RedPagerActivityBrower.UpdateRedPagerActivity(redPagerActivityInfo))
            {
                this.ShowMsg("代金券活动修改失败", false);
                return;
            }
            if (base.Request.QueryString["reurl"] != null)
            {
                this.ReUrl = base.Request.QueryString["reurl"].ToString();
            }
            this.ShowMsgAndReUrl("代金券活动修改成功", true, this.ReUrl);
        }