Пример #1
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");
        }
Пример #2
0
        public string Arrive_API()
        {
            M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID);
            string       action   = Request.QueryString["action"];
            string       ids      = Request.Form["ids"];

            switch (action)
            {
            case "del":
                //只可删除未被领取的优惠券
            {
                if (string.IsNullOrEmpty(ids))
                {
                    return(Failed.ToString());
                }
                SafeSC.CheckIDSEx(ids);
                string where = "ID IN (" + ids + ") AND StoreID=" + storeMod.ID + " AND UserID=0";
                DBCenter.DelByWhere("ZL_Arrive", where);
            }
            break;

            case "change":
                if (string.IsNullOrEmpty(ids))
                {
                    return(Failed.ToString());
                }
                SafeSC.CheckIDSEx(ids);
                int state = Convert.ToInt32(Request["state"]);
                if (state == 0)
                {
                    //取消激活,只适用于已激活但未被用户领取的优惠券。
                    string where = "ID IN (" + ids + ") AND StoreID=" + storeMod.ID + " AND UserID=0";
                    DBCenter.UpdateSQL("ZL_Arrive", "State=0", where);
                }
                else
                {
                    avBll.UpdateState(ids, state, storeMod.ID);
                }
                break;

            case "bind":
                int uid = Convert.ToInt32(Request["uid"]);
                avBll.GetUpdateUserIdByIDS(ids, uid, storeMod.ID);
                break;

            case "unbind":
            {
                //\\win10\D\Web\办酒网BAK
                if (string.IsNullOrEmpty(ids))
                {
                    return(Failed.ToString());
                }
                SafeSC.CheckIDSEx(ids);
                avBll.GetUpdateUserIdByIDS(ids, 0, storeMod.ID);
            }
            break;

            default:
                return("[" + action + "]未命中");
            }
            return(M_APIResult.Success.ToString());
        }