Beispiel #1
0
        public ActionResult ArriveAdd()
        {
            M_Arrive avMod = avBll.SelReturnModel(Mid);

            if (avMod == null)
            {
                avMod = new M_Arrive();
            }
            if (avMod.ID > 0)
            {
                return(View("ArriveEdit", avMod));
            }
            else
            {
                return(View("ArriveAdd", avMod));
            }
        }
Beispiel #2
0
        public IActionResult ArriveAdd()
        {
            M_Arrive avMod = new M_Arrive();

            if (Mid > 0)
            {
                avMod = avBll.SelReturnModel(Mid);
            }
            DataTable storeDT = conBll.Store_Sel("", true);

            if (Mid > 0)
            {
                //switch (avMod.Type)
                //{
                //    case 1:
                //        Amount2_T.Text = avMod.Amount.ToString("F2");
                //        Amount2_Max.Text = avMod.Amount_Max.ToString("F2");
                //        break;
                //    case 2:
                //        break;
                //    default:
                //        Amount_T.Text = avMod.Amount.ToString();
                //        break;
                //}
                //if (avMod.State > 0) { txtState.Text = avMod.State == 1 ? "已激活" : "已使用"; }
                //M_UserInfo info = buser.GetUserByUserID(avMod.UserID);
                //if (!info.IsNull)
                //{
                //    txtUserID.Text = info.UserName;
                //}
                //else
                //{
                //    txtUserID.Text = "未送出";
                //}
            }
            else
            {
                avMod.AgainTime = DateTime.Now;
                avMod.EndTime   = DateTime.Now.AddYears(1);
            }
            ViewBag.storeDT = storeDT;
            return(View(avMod));
        }
Beispiel #3
0
        public void Arrive_Act()
        {
            string ANo  = Request.Form["ANo"];
            string APwd = Request.Form["APwd"];

            //优惠券的实例
            M_Arrive avMod = avBll.SelReturnModel(ANo, APwd);

            if (avMod == null)
            {
                function.WriteErrMsg("优惠券不存在"); return;
            }
            string str = "优惠券激活成功" + "!此优惠券的面值为[" + avMod.Amount + "]";

            function.WriteSuccessMsg(str, "ArriveJiHuo");
        }
Beispiel #4
0
        public IActionResult Arrive_Act()
        {
            string ANo  = RequestEx["ANo"];
            string APwd = RequestEx["APwd"];

            //优惠券的实例
            M_Arrive avMod = avBll.SelReturnModel(ANo, APwd);

            if (avMod == null)
            {
                return(WriteErr("优惠券不存在"));
            }
            string str = "优惠券激活成功" + "!此优惠券的面值为[" + avMod.Amount + "]";

            return(WriteOK(str, "ArriveJiHuo"));
        }
Beispiel #5
0
        public void Arrive_Act()
        {
            string ANo  = Request.Form["ANo"];
            string APwd = Request.Form["APwd"];

            int     uid     = avBll.GetUserid(ANo);//uid=0
            decimal mianzhi = avBll.GetOtherArrive(mu.UserID, ANo, APwd);
            //获得用户基本信息
            M_Uinfo muinfo = buser.GetUserBaseByuserid(uid);

            avBll.UpdateState(ANo);
            avBll.UpdateUseTime(ANo);

            //优惠券的实例
            M_Arrive avMod = avBll.SelReturnModel(ANo, APwd);

            if (avMod == null)
            {
                function.WriteErrMsg("优惠券不存在"); return;
            }
            string str = "优惠券激活成功" + "!此优惠券的面值为[" + avMod.Amount + "]";

            function.WriteSuccessMsg(str, "ArriveJiHuo");
        }
Beispiel #6
0
        //制作抵用劵
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            M_Arrive avMod = new M_Arrive();

            if (Mid > 0)
            {
                avMod = avBll.SelReturnModel(Mid);
            }
            avMod.ArriveName = txtName.Text;
            avMod.MinAmount  = DataConverter.CDouble(minAmount_T.Text);
            avMod.MaxAmount  = DataConverter.CDouble(maxAmount_T.Text);
            avMod.AgainTime  = DataConverter.CDate(AgainTime_T.Text);
            avMod.EndTime    = DataConverter.CDate(EndTime_T.Text);
            avMod.Amount     = DataConverter.CDouble(Amount_T.Text);
            avMod.Type       = DataConverter.CLng(Magclass.SelectedItem.Value);
            if (avMod.EndTime <= DateTime.Now)
            {
                function.WriteErrMsg("到期时间不能早于当前时间");
            }
            if (avMod.AgainTime >= avMod.EndTime)
            {
                function.WriteErrMsg("到期时间不能晚于发布时间");
            }
            if (avMod.MaxAmount < 0 || avMod.MinAmount < 0)
            {
                function.WriteErrMsg("使用范围数值不正确");
            }
            if (avMod.MaxAmount != 0 && avMod.MinAmount > avMod.MaxAmount)
            {
                function.WriteErrMsg("使用范围不正确,最小值不能大于最大值");
            }
            if (avMod.Amount < 1)
            {
                function.WriteErrMsg("优惠金额不正确,最小值为1");
            }
            //----------------------------------------
            if (avMod.ID < 1)//添加优惠券
            {
                avMod.Flow = Guid.NewGuid().ToString();
                int num = DataConverter.CLng(txtCreateNum.Text);
                for (int i = 0; i < num; i++)
                {
                    switch (EcodeType.SelectedItem.Value)
                    {
                    case "0":    //纯数字
                        avMod.ArriveNO = function.GetRandomString(9, 2);
                        break;

                    case "1":    //字母
                        avMod.ArriveNO = "ZL" + function.GetRandomString(9, 3).ToLower();
                        break;

                    case "2":    //混淆
                        avMod.ArriveNO = "ZL" + function.GetRandomString(9, 3).ToLower();
                        break;

                    default:
                        break;
                    }
                    avMod.ArrivePwd = "ZL" + function.GetRandomString(9);
                    avMod.State     = isValid_Chk.Checked ? 1 : 0;
                    avMod.UserID    = 0;
                    avBll.GetInsert(avMod);
                }
                function.WriteSuccessMsg("批量添加成功!", "ArriveManage.aspx?name=" + avMod.ArriveName);
            }
            else
            {
                avMod.ArriveNO  = txtNo.Text;
                avMod.ArrivePwd = txtPwd.Text;
                avMod.State     = txtState.Text == "未使用" ? 0 : 1;
                avMod.UserID    = DataConverter.CLng(hfid.Value);
                avBll.GetUpdate(avMod);
                function.WriteSuccessMsg("修改成功!", "ArriveManage.aspx");
            }
        }