コード例 #1
0
        protected void Pay_Btn_Click(object sender, EventArgs e)
        {
            function.WriteErrMsg("提现功能暂未开放");
            double max = GetMaxMoney();

            if (max < 1)
            {
                function.WriteErrMsg("可提现余额不够"); return;
            }
            WxAPI     wxapi  = WxAPI.Code_Get();
            M_UserAPP appMod = appBll.SelReturnModel(mu.UserID);

            if (appMod == null || string.IsNullOrEmpty(appMod.OpenID))
            {
                function.WriteErrMsg("未绑定微信账号"); return;
            }
            CommonReturn ret = SendMoney(wxapi.AppId, appMod.OpenID, max, "余额提现");

            if (ret.isok)
            {
                buser.MinusVMoney(mu.UserID, max, M_UserExpHis.SType.Purse, "余额提现");
                function.WriteSuccessMsg("提现成功", "/User/");
            }
            else
            {
                function.WriteErrMsg("操作失败,原因:" + ret.err);
            }
            //var cert= HttpService.Cert_GetByName(wxapi.AppId.Pay_SSLPath);
            //CommonReturn ret = SendMoney(wxapi.AppId, "oGUkXxN83jNbKCbtrNFny5tqHtok", 1, "测试付款");
        }
コード例 #2
0
        /// <summary>
        /// 审核页面
        /// </summary>
        /// <param name="pageid"></param>
        /// <param name="version"></param>
        /// <returns></returns>
        public async Task <bool> ReviewPage(string pageid, int version)
        {
            string        apitype = JsonApiType.reviewPage;
            BaseRequest   bj      = GetCommonBaseRequest(apitype);
            ReviewRequest re      = new ReviewRequest(version, pageid);

            bj.api_type = apitype;
            bj.data     = re;
            try
            {
                var result = await Post(bj);

                BaseReturn   brj = JsonController.DeSerializeToClass <BaseReturn>(result);
                CommonReturn cr  = JsonController.DeSerializeToClass <CommonReturn>(brj.data.ToString());
                if (cr.error_code.Equals(ReturnConst.right))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }
コード例 #3
0
        public static CommonReturn CheckStore(int uid)
        {
            B_Store_Info storeBll = new B_Store_Info();

            if (uid < 1)
            {
                return(CommonReturn.Failed("用户未登录"));
            }
            M_Store_Info storeMod = storeBll.SelModelByUser(uid);
            string       err      = "";

            if (storeMod == null || storeMod.ID < 1)
            {
                err = "店铺信息不存在";
            }
            else if (storeMod.Status != (int)ZLEnum.ConStatus.Audited)
            {
                err = "店铺没有经过审核";
            }
            if (!string.IsNullOrEmpty(err))
            {
                return(CommonReturn.Failed(err));
            }
            else
            {
                return(CommonReturn.Success(storeMod));
            }
        }
コード例 #4
0
ファイル: User.Master.cs プロジェクト: zoomlacms/web043
        protected void Page_Init(object sender, EventArgs e)
        {
            mu = buser.GetLogin();
            if (buser.CheckLogin())
            {
                if (mu == null || mu.IsNull || mu.UserID < 1)
                {
                    Response.Redirect("/User/Login");
                }
                else if (mu.Status != 0)
                {
                    function.WriteErrMsg("你的帐户未通过验证或被锁定,请与网站管理员联系", "/User/Login");
                }
            }
            else
            {
                B_User.CheckIsLogged(Request.RawUrl);
            }
            CommonReturn retMod = ExHelper.CheckUserLogin();

            if (!retMod.isok)
            {
                function.WriteErrMsg(retMod.err);
            }
        }
コード例 #5
0
        //----------------权限检测
        /// <summary>
        /// 检测是否有访问用户中心的权限
        /// 店长,收银员
        /// </summary>
        public static CommonReturn CheckUserLogin()
        {
            M_UserInfo mu = new B_User().GetLogin();

            if (mu.IsNull)
            {
                return(CommonReturn.Failed("用户未登录"));
            }
            //检测用户是否拥有店铺,或为店铺收银员

            if (mu.SiteID < 1)
            {
                return(CommonReturn.Failed("用户未绑定店铺"));
            }
            if (DBCenter.IsExist("ZL_CommonModel", "SuccessfulUserID=" + mu.UserID))
            {
                return(CommonReturn.Success());
            }
            //是否绑定了店铺,是否为收银员
            if (mu.GroupID != ExConast.EmployGroup)
            {
                return(CommonReturn.Failed("没有访问页面的权限"));
            }
            return(CommonReturn.Success());
        }
コード例 #6
0
        public static CommonReturn Send(string[] mobiles, SMS_Packet packet)
        {
            SMS_Base sms = null;

            switch (SMSConfig.Instance.DefaultSMS)
            {
            case "1":
            case "2":
            case "3":
                sms = new SMS_Old();
                break;

            case "qcloud":
                sms = new SMS_QCloud();
                break;

            case "aliyun":
                break;

            case "0":
            default:
                break;
            }
            if (sms == null)
            {
                return(CommonReturn.Failed("未开启短信接口"));
            }
            //---------------------
            return(sms.Send(mobiles, packet));
        }
コード例 #7
0
ファイル: ChangeController.cs プロジェクト: baixue001/IPS
        public IActionResult GetPassWord_Mobile()
        {
            if (!VerifyHelper.Check(RequestEx["VCode_hid"]))
            {
                return(WriteErr("验证码不正确", "/User/Change/GetPassword"));
            }
            M_UserInfo mu     = GetUserByName(RequestEx["TxtUserName"]);
            M_Uinfo    basemu = buser.GetUserBaseByuserid(mu.UserID);

            if (string.IsNullOrEmpty(basemu.Mobile))
            {
                return(WriteErr("用户未设置手机号,无法通过手机号找回"));
            }
            string code   = function.GetRandomString(6, 2);
            string mobile = basemu.Mobile;

            if (mobileBll.CheckMobile(HttpContext, mobile))
            {
                CommonReturn ret = SMS_Helper.SendVCode(mobile, code, SMSConfig.Instance.Tlp_GetBack);
                //添加一条发送手机短信记录
                mobileBll.Insert(new M_Safe_Mobile()
                {
                    Phone = mobile, VCode = code, Source = "GetPassWord_Mobile", UserID = mu.UserID, UserName = mu.UserName, SysRemind = ret.err
                });
            }
            else
            {
                return(WriteErr("短信发送次数超过上限!"));
            }
            UserMobile  = mobile;
            GetPwdUName = mu.UserName;
            GetPwdStep  = "mobile_code";
            return(View("GetPassWord"));
        }
コード例 #8
0
        public void Arrive_Add(M_Arrive avMod)
        {
            M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID);

            if (Mid < 1)//添加优惠券
            {
                avMod.CUser   = mu.UserID;
                avMod.StoreID = storeMod.ID;
                avMod.State   = DataConvert.CLng(Request.Form["state_chk"]);
                int          num    = DataConverter.CLng(Request.Form["txtCreateNum"]);
                CommonReturn retMod = avBll.CreateArrive(avMod, num, "1", Request.Form["UserID_Hid"]);
                if (retMod.isok)
                {
                    function.WriteSuccessMsg("批量添加成功!", "ArriveManage");
                }
                else
                {
                    function.WriteErrMsg(retMod.err);
                }
            }
            else
            {
                avMod            = avBll.SelReturnModel(Mid);
                avMod.ArriveName = Request.Form["ArriveName"];
                avMod.Amount     = DataConvert.CLng(Request.Form["Amount"]);
                avMod.MinAmount  = Convert.ToDouble(Request.Form["MinAmount"]);
                avMod.MaxAmount  = Convert.ToDouble(Request.Form["MaxAmount"]);
                avMod.AgainTime  = DataConvert.CDate(Request.Form["AgainTime"]);
                avMod.EndTime    = DataConvert.CDate(Request.Form["EndTime"]);
                avBll.GetUpdate(avMod);
                function.WriteSuccessMsg("修改成功!", "ArriveManage");
            }
        }
コード例 #9
0
        /// <summary>
        /// 文件拷贝
        /// </summary>
        /// <param name="src">来源文件物理路径</param>
        /// <param name="tar">目标文件地址物理路径</param>
        /// <returns></returns>
        public static CommonReturn File_Copy(string src, string tar)
        {
            try
            {
                if (!File.Exists(src))
                {
                    return(CommonReturn.Failed("[" + src + "]文件不存在"));
                }
                //---safe check
                if (SafeSC.FileNameCheck(src))
                {
                    return(CommonReturn.Failed("[" + src + "]文件名异常"));
                }
                if (SafeSC.FileNameCheck(tar))
                {
                    return(CommonReturn.Failed("[" + tar + "]文件名异常"));
                }

                if (!Directory.Exists(Path.GetDirectoryName(tar)))
                {
                    Directory.CreateDirectory(Path.GetDirectoryName(tar));
                }
                if (File.Exists(tar))
                {
                    File.Delete(tar);
                }
                File.Copy(src, tar);
            }
            catch (Exception ex) { return(CommonReturn.Failed(ex.Message)); }
            return(CommonReturn.Success());
        }
コード例 #10
0
        public IActionResult ArriveAdd_Submit()
        {
            M_Arrive avMod = new M_Arrive();

            if (Mid > 0)
            {
                avMod = avBll.SelReturnModel(Mid);
            }
            avMod.ArriveName = GetParam("txtName");
            avMod.MinAmount  = DataConverter.CDouble(GetParam("minAmount_T"));
            avMod.MaxAmount  = DataConverter.CDouble(GetParam("maxAmount_T"));
            avMod.Amount_Max = DataConverter.CDouble(GetParam("Amount2_Max"));

            avMod.DateDays  = DataConverter.CLng(GetParam("DateDays_T"));
            avMod.AgainTime = DataConverter.CDate(GetParam("AgainTime_T"));
            avMod.EndTime   = DataConverter.CDate(GetParam("EndTime_T"));

            avMod.Type     = DataConverter.CLng(Request.Form["Type_Rad"]);
            avMod.DateType = DataConverter.CLng(Request.Form["date_rad"]);
            avMod.ProIDS   = GetParam("UProIDS_Hid");
            avMod.StoreID  = DataConverter.CLng(GetParam("Store_DP"));
            avMod.State    = DataConvert.CLng(GetParam("state_chk"));
            avMod.CAdmin   = adminMod.AdminId;
            switch (avMod.Type)
            {
            case 1:
                avMod.Amount = DataConverter.CDouble(GetParam("Amount2_T"));
                break;

            default:
                avMod.Amount = DataConverter.CDouble(GetParam("Amount_T"));
                break;
            }
            //----------------------------------------
            if (avMod.ID < 1)//添加优惠券
            {
                int          num    = DataConverter.CLng(GetParam("txtCreateNum"));
                CommonReturn retMod = avBll.CreateArrive(avMod, num, GetParam("EcodeType"), GetParam("UserID_Hid"));
                if (retMod.isok)
                {
                    return(WriteOK("批量添加成功!", "ArriveManage?name=" + avMod.ArriveName));
                }
                else
                {
                    return(WriteErr(retMod.err));
                }
            }
            else
            {
                avMod.ArriveNO  = GetParam("txtNo");
                avMod.ArrivePwd = GetParam("txtPwd");
                avBll.GetUpdate(avMod);
                return(WriteOK("操作成功", "ArriveManage"));
            }
        }
コード例 #11
0
 public override CommonReturn Send(string[] mobiles, SMS_Packet packet)
 {
     foreach (string mobile in mobiles)
     {
         if (string.IsNullOrEmpty(mobile))
         {
             continue;
         }
         SendWebSMS.SendMessage(mobile, packet.message);
     }
     return(CommonReturn.Success());
 }
コード例 #12
0
ファイル: pay.aspx.cs プロジェクト: zoomlacms/web054
        protected void Page_Load(object sender, EventArgs e)
        {
            payMod = payBll.SelModelByPayNo(PayNo);
            CommonReturn retMod = payBll.IsCanPay(payMod);

            if (!retMod.isok)
            {
                function.WriteErrMsg("Orders are not allowed to be paid"); ZLLog.L(retMod.err);
            }
            //-----------------------
            ZoomLa.BLL.Pay.ZLPayPal.PayPalHelper.RedirectToPay(payMod);
        }
コード例 #13
0
ファイル: ChangeController.cs プロジェクト: baixue001/IPS
        //验证手机校验码,返回密码修改页
        public IActionResult GetPassword_Mobile_Code()
        {
            string       code   = RequestEx["CheckCode_T"];
            CommonReturn retMod = B_Safe_Mobile.CheckVaildCode(UserMobile, code, "");

            if (retMod.isok)
            {
                GetPwdStep = "final";
                return(View("GetPassWord"));
            }
            else
            {
                return(WriteErr(retMod.err));
            }
        }
コード例 #14
0
ファイル: IndexController.cs プロジェクト: zoomlacms/web049
        public void Register_MobileCheck()
        {
            string       mobile = Request.Form["TxtMobile"];
            string       code   = Request.Form["MobileCode_T"];
            CommonReturn retMod = B_Safe_Mobile.CheckVaildCode(mobile, code, "");

            if (retMod.isok)
            {
                RegisterMobile = mobile;
                Response.Redirect("/User/Register");
            }
            else
            {
                function.WriteErrMsg(err); return;
            }
        }
コード例 #15
0
        public string Register_MobileCheck()
        {
            M_APIResult  retMod = new M_APIResult(Failed);
            string       mobile = RequestEx["mobile"];
            string       code   = RequestEx["code"];
            CommonReturn ret    = B_Safe_Mobile.CheckVaildCode(mobile, code, "register");

            if (ret.isok)
            {
                RegisterMobile = mobile;
                retMod.retcode = M_APIResult.Success;
            }
            else
            {
                retMod.retmsg = ret.err;
            }
            return(retMod.ToString());
        }
コード例 #16
0
        /// <summary>
        /// 处理短信验证码
        /// </summary>
        /// <param name="type"></param>
        /// <param name="phonenumber"></param>
        /// <param name="code"></param>
        /// <returns></returns>
        public async Task <bool> DealWithSMS(string type, string phonenumber, string code = "", bool isVerify = false)
        {
            string      apitype = JsonApiType.sendCode;
            BaseRequest bj      = GetCommonBaseRequest(apitype);

            bj.api_type = apitype;

            if (isVerify)
            {
                SmsRequest sr = new SmsRequest()
                {
                    type = type, to = phonenumber, code = code
                };
                bj.data = sr;
            }
            else
            {
                SmsRequestSend sr = new SmsRequestSend()
                {
                    type = type, to = phonenumber
                };
                bj.data = sr;
            }

            try
            {
                string result = await Post(bj);

                BaseReturn   brj = JsonController.DeSerializeToClass <BaseReturn>(result);
                CommonReturn cr  = JsonController.DeSerializeToClass <CommonReturn>(brj.data.ToString());
                if (cr.error_code.Equals(ReturnConst.right))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }
コード例 #17
0
        public override CommonReturn Send(string[] mobiles, SMS_Packet packet)
        {
            if (mobiles.Length < 1)
            {
                return(CommonReturn.Failed("未指定手机号"));
            }
            if (packet.tlpId < 1)
            {
                return(CommonReturn.Failed("未指定模板ID"));
            }
            string smsSign = SMSConfig.Instance.QCloud_Sign; // NOTE: 这里的签名只是示例,请使用真实的已申请的签名, 签名参数使用的是`签名内容`,而不是`签名ID`
            int    appid   = DataConvert.CLng(SMSConfig.Instance.QCloud_APPID);

            if (appid < 1)
            {
                return(CommonReturn.Failed("未配置APPID"));
            }
            string        appkey = SMSConfig.Instance.QCloud_APPKey;
            List <string> param  = new List <string>();

            //按顺序取值即可
            foreach (var item in packet.param)
            {
                param.Add(item.Value);
            }
            //if (mobiles.Length > 1)
            //{
            //    SmsMultiSender msender = new SmsMultiSender(appid, appkey);
            //    var result = msender.sendWithParam("86", mobiles, packet.tlpId, param.ToArray(), smsSign, "", "");
            //    if (result.result != 0) { return CommonReturn.Failed(result.errMsg); }
            //}
            //else
            //{
            //    SmsSingleSender ssender = new SmsSingleSender(appid, appkey);
            //    // 签名参数未提供或者为空时,会使用默认签名发送短信
            //    var result = ssender.sendWithParam("86", mobiles[0], packet.tlpId, param.ToArray(), smsSign, "", "");
            //    if (result.result != 0) { return CommonReturn.Failed(result.errMsg); }
            //}
            return(CommonReturn.Success());
        }
コード例 #18
0
 /// <summary>
 /// 目录递归拷贝(物理路径)
 /// </summary>
 /// <param name="srcdir">来源目录物理路径</param>
 /// <param name="tardir">目标目录物理路径</param>
 public static CommonReturn Dir_Copy(string srcdir, string tardir)
 {
     if (!Directory.Exists(srcdir))
     {
         return(CommonReturn.Failed("[" + srcdir + "]目录不存在"));
     }
     if (!Directory.Exists(tardir))
     {
         Directory.CreateDirectory(tardir);
     }
     srcdir = srcdir.Trim('\\') + "\\";
     tardir = tardir.Trim('\\') + "\\";
     //----------------------
     string[] fnames = Directory.GetFileSystemEntries(srcdir);
     foreach (string name in fnames)
     {
         try
         {
             if (Directory.Exists(name))//如果是目录则拷贝
             {
                 string currentdir = tardir + Dir_GetName(name);
                 if (!Directory.Exists(currentdir))
                 {
                     Directory.CreateDirectory(currentdir);
                 }
                 Dir_Copy(name, currentdir);//递归拷贝
             }
             else
             {
                 CommonReturn retMod = File_Copy(name, tardir + Path.GetFileName(name));
                 if (!retMod.isok)
                 {
                     throw new Exception(retMod.err);
                 }
             }
         }
         catch (Exception ex) { return(CommonReturn.Failed("[" + name + "]" + ex.Message)); }
     }
     return(CommonReturn.Success());
 }
コード例 #19
0
        /// <summary>
        /// 发送验证码短信
        /// </summary>
        public static CommonReturn SendVCode(string mobile, string vcode, string tlp)
        {
            SMS_Packet packet = new SMS_Packet();

            packet.message = tlp;
            switch (SMSConfig.Instance.DefaultSMS)
            {
            case "qcloud":
                packet.param.Add("0", vcode);
                packet.tlpId = DataConvert.CLng(tlp);
                break;

            default:
                if (string.IsNullOrEmpty(packet.message))
                {
                    return(CommonReturn.Failed("未指定短信模板内容"));
                }
                break;
            }
            packet.message = packet.message.Replace("{vcode}", vcode);
            return(Send(new string[] { mobile }, packet));
        }
コード例 #20
0
        /// <summary>
        /// 校验当前登录用户的角色权限
        /// </summary>
        /// <param name="name"></param>
        public static CommonReturn CheckUserAuth(string auth)
        {
            M_UserInfo mu = new B_User().GetLogin();

            if (mu.SiteID < 1)
            {
                function.WriteErrMsg("禁止访问,用户未绑定店铺");
            }
            //如果是店铺的所有者,则不需要检测
            bool flag = DBCenter.IsExist("ZL_CommonModel", "GeneralID=" + mu.SiteID + " AND SuccessfulUserID=" + mu.UserID);

            if (flag)
            {
                return(CommonReturn.Success());
            }
            //只有店长可访问该页面
            if (auth.Equals("manage"))
            {
                function.WriteErrMsg("你没有足够的访问权限");
            }
            //-----------------------检测角色权限
            if (mu.PageID < 1)
            {
                function.WriteErrMsg("操作员未绑定角色");
            }
            if (string.IsNullOrEmpty(auth))
            {
                function.WriteErrMsg("未指定需要校验的权限");
            }
            string auths = DataConvert.CStr(DBCenter.ExecuteScala("ZL_Ex_ERole", "RoleAuth", "ID=" + mu.PageID));

            if (!auths.Contains(auth))
            {
                function.WriteErrMsg("你无权访问该页面");
            }

            return(CommonReturn.Success());
        }
コード例 #21
0
        private CommonReturn SendMoney(M_WX_APPID appMod, string openid, double amount, string desc)
        {
            WxPayData wxdata = new WxPayData();

            wxdata.SetValue("partner_trade_no", B_OrderList.CreateOrderNo(M_OrderList.OrderEnum.Normal));
            wxdata.SetValue("openid", openid);
            wxdata.SetValue("check_name", "NO_CHECK");//OPTION_CHECK NO_CHECK
            //wxdata.SetValue("re_user_name", trueName.Trim());
            wxdata.SetValue("amount", (int)amount * 100);
            wxdata.SetValue("desc", desc);
            wxdata.SetValue("spbill_create_ip", Request.ServerVariables["LOCAl_ADDR"]);//必须填写
            WxPayData result = WxPayApi.Pay_Transfer(wxdata, appMod);

            if (result.GetValue("result_code").ToString().ToUpper().Equals("SUCCESS"))
            {
                return(CommonReturn.Success());
            }
            else
            {
                string err = result.GetValue("return_msg").ToString();
                return(CommonReturn.Failed(err));
            }
        }
コード例 #22
0
ファイル: UserController.cs プロジェクト: baixue001/IPS
        public IActionResult UserAdd_Submit(M_UserInfo input)
        {
            if (buser.IsExist("uname", input.UserName))
            {
                return(WriteErr("用户名已存在"));
            }

            CommonReturn ret = buser.CheckRegInfo(input);

            if (!ret.isok)
            {
                return(WriteErr(ret.err));
            }
            input.UserFace = GetParam("UserFace_t");
            input.UserPwd  = StringHelper.MD5(input.UserPwd);
            input.UserID   = buser.Add(input);
            M_Uinfo basemu = new M_Uinfo();

            basemu.UserId = input.UserID;
            basemu.Mobile = input.Remark;
            buser.AddBase(basemu);
            return(WriteOK("添加成功", "UserAdd"));
        }
コード例 #23
0
        private CommonReturn PayByVirtualMoney(string payMethod, M_Payment payMod)
        {
            M_UserInfo         mui       = buser.GetLogin(false);
            List <M_OrderList> orderList = OrderHelper.OrdersCheck(payMod);

            ViewBag.vname  = "";
            ViewBag.vmoney = 0;
            //ActualAmount.Visible = false;
            //paylogMod.UserID = mui.UserID;
            switch (payMethod)//完成支付
            {
            case "Purse":
                if (!SiteConfig.SiteOption.SiteID.Contains("purse"))
                {
                    return(CommonReturn.Failed("管理员已关闭余额支付功能!"));
                }
                if (mui.Purse < (double)payMod.MoneyReal)
                {
                    return(CommonReturn.Failed("对不起,余额不足! 请<a href='/PayOnline/OrderPay?Money=" + payMod.MoneyReal + "' target='_blank' style='margin-left:5px;color:#f00;'>充值!</a>"));
                }
                buser.ChangeVirtualMoney(mui.UserID, new M_UserExpHis()
                {
                    score     = -(double)payMod.MoneyReal,
                    ScoreType = (int)M_UserExpHis.SType.Purse,
                    detail    = "支付成功,支付单号:" + payMod.PayNo
                });
                mui            = buser.GetLogin(false);
                ViewBag.vname  = "帐户余额";
                ViewBag.vmoney = mui.Purse.ToString("F2");
                break;

            case "SilverCoin":
                if (!SiteConfig.SiteOption.SiteID.Contains("sicon"))
                {
                    return(CommonReturn.Failed("管理员已关闭银币支付功能!"));
                }
                if (mui.SilverCoin < (double)payMod.MoneyReal)
                {
                    return(CommonReturn.Failed("对不起,银币不足!"));
                }
                buser.ChangeVirtualMoney(mui.UserID, new M_UserExpHis()
                {
                    score     = -(double)payMod.MoneyReal,
                    ScoreType = (int)M_UserExpHis.SType.SIcon,
                    detail    = "支付成功,支付单号:" + payMod.PayNo
                });
                mui            = buser.GetLogin(false);
                mui            = buser.GetLogin(false);
                ViewBag.vname  = "帐户银币";
                ViewBag.vmoney = mui.SilverCoin.ToString("F2");
                break;

            case "Score":
                if (!SiteConfig.SiteOption.SiteID.Contains("point"))
                {
                    return(CommonReturn.Failed("管理员已关闭积分支付功能!"));
                }
                if (mui.UserExp < (double)payMod.MoneyReal)
                {
                    return(CommonReturn.Failed("对不起,积分不足!"));
                }
                buser.ChangeVirtualMoney(mui.UserID, new M_UserExpHis()
                {
                    score     = -(double)payMod.MoneyReal,
                    ScoreType = (int)M_UserExpHis.SType.Point,
                    detail    = "支付成功,支付单号:" + payMod.PayNo
                });
                mui            = buser.GetLogin(false);
                ViewBag.vname  = "帐户积分";
                ViewBag.vmoney = mui.UserExp.ToString("F2");
                break;

            default:
                return(CommonReturn.Failed("指定的支付方式不存在,请检查大小写是否正确!"));
            }
            for (int i = 0; i < orderList.Count; i++)//更改订单状态
            {
                M_OrderList orderMod = orderList[i];
                OrderHelper.SaveSnapShot(orderMod);
                #region 写入日志,更新订单状态
                switch (payMethod)
                {
                case "Purse":
                    orderMod.Paymentstatus     = (int)M_OrderList.PayEnum.HasPayed;
                    orderMod.Receivablesamount = orderMod.Ordersamount;
                    if (orderBll.Update(orderMod))
                    {
                        orderCom.SendMessage(orderMod, paylogMod, "payed");
                        paylogMod.PayMethod = (int)M_Order_PayLog.PayMethodEnum.Purse;
                        paylogMod.Remind   += "商城订单" + orderMod.OrderNo + "余额付款成功";
                    }
                    break;

                case "SilverCoin":
                    orderMod.Paymentstatus     = (int)M_OrderList.PayEnum.HasPayed;
                    orderMod.Receivablesamount = orderMod.Ordersamount;
                    if (orderBll.Update(orderMod))
                    {
                        orderCom.SendMessage(orderMod, paylogMod, "payed");
                        paylogMod.PayMethod = (int)M_Order_PayLog.PayMethodEnum.Silver;
                        paylogMod.Remind   += "商城订单" + orderMod.OrderNo + "银币付款成功";
                    }
                    break;

                case "Score":
                    orderMod.Paymentstatus     = (int)M_OrderList.PayEnum.HasPayed;
                    orderMod.Receivablesamount = orderMod.Ordersamount;
                    if (orderBll.Update(orderMod))
                    {
                        orderCom.SendMessage(orderMod, paylogMod, "payed");
                        paylogMod.PayMethod = (int)M_Order_PayLog.PayMethodEnum.Score;
                        paylogMod.Remind    = "商城订单" + orderMod.OrderNo + "积分付款成功";
                    }
                    break;

                default:
                    return(CommonReturn.Failed("指定的支付方式不存在,请检查大小写是否正确!"));

                    break;
                }
                //-----------------------付款后处理区域
                //orderCom.SaveSnapShot(orderMod);
                payMod.MoneyTrue = payMod.MoneyReal;
                OrderHelper.FinalStep(payMod, orderMod, paylogMod);//支付成功后处理步步骤,允许操作paylogMod
                #endregion
            }
            //-----------------For End
            //PayNum_L2.Text = payMod.MoneyReal.ToString("f2");
            //sjhbje.Text = payMod.MoneyReal.ToString("f2");
            payMod.Status  = (int)M_Payment.PayStatus.HasPayed;
            payMod.CStatus = true;
            payBll.Update(payMod);
            return(CommonReturn.Success());
        }
コード例 #24
0
        public override CommonReturn QueryBalance()
        {
            string message = SendWebSMS.GetBalance();

            return(CommonReturn.Success(message));
        }
コード例 #25
0
        public void GiveMoney_Add()
        {
            mu = buser.GetLogin(false);
            int score = DataConverter.CLng(Request.Form["Score_T"]);

            if (score < 1)
            {
                function.WriteErrMsg(TypeName + "不能小于1"); return;
            }
            if (GetUserScore(mu) < score)
            {
                function.WriteErrMsg("您的" + TypeName + "不足!!"); return;
            }
            //检测
            M_UserInfo touser = null;
            string     UName  = Request.Form["UserName_T"];
            int        UserID = DataConverter.CLng(Request.Form["UserID_T"]);

            if (!string.IsNullOrEmpty(UName) && UserID > 0)
            {
                M_UserInfo user1 = buser.GetUserByName(UName);
                M_UserInfo user2 = buser.SelReturnModel(UserID);
                if (user1.UserID != user2.UserID)
                {
                    function.WriteErrMsg("用户名与用户ID不匹配"); return;
                }
            }
            else if (!string.IsNullOrEmpty(UName))
            {
                touser = buser.GetUserByName(UName);
            }
            else if (UserID > 0)
            {
                touser = buser.SelReturnModel(UserID);
            }
            else
            {
                function.WriteErrMsg("会员名和ID至少填写一个"); return;
            }
            if (touser == null || touser.IsNull)
            {
                function.WriteErrMsg("赠送失败,请检查对方会员名或ID是否正确。"); return;
            }
            if (touser.UserID == mu.UserID)
            {
                function.WriteErrMsg("不能给自己充值!"); return;
            }
            //如果有设置支付密码,则需要输入
            if (!string.IsNullOrEmpty(mu.PayPassWord))
            {
                string       shortPwd = Request.Form["ShortPwd_T"];
                CommonReturn ret      = buser.CheckPayPwd(mu, shortPwd);
                if (!ret.isok)
                {
                    function.WriteErrMsg(ret.err);
                }
            }

            buser.ChangeVirtualMoney(mu.UserID, new M_UserExpHis()
            {
                ScoreType = SType,
                score     = -score,
                detail    = "赠送给" + touser.UserName + score + TypeName
            });
            string remark = Request.Form["Remark_T"];

            if (string.IsNullOrEmpty(remark))
            {
                remark = mu.UserName + "赠送了" + score + TypeName + "给您!";
            }
            buser.ChangeVirtualMoney(touser.UserID, new M_UserExpHis()
            {
                ScoreType = SType,
                score     = score,
                detail    = remark
            });
            function.WriteSuccessMsg("赠送成功", "GiveMoney?stype=" + SType); return;
        }
コード例 #26
0
 //Note 群发一次请求最多支持200个号码
 //Note 无论单发/群发短信还是指定模板ID单发/群发短信都需要从控制台中申请模板并且模板已经审核通过,才可能下发成功,否则返回失败。
 public override CommonReturn QueryBalance()
 {
     return(CommonReturn.Failed("无该接口"));
 }