Exemple #1
0
        protected void Save_B_Click(object sender, EventArgs e)
        {
            M_PayPlat wxpay = B_PayPlat.GetModelForWx();

            if (wxpay == null)
            {
                wxpay = new M_PayPlat();
            }
            wxpay.PayPlatName = "微信支付";
            wxpay.payType     = AppID_T.Text;
            wxpay.PayPlatinfo = Secret_T.Text;
            wxpay.AccountID   = MchID_T.Text;
            wxpay.PayClass    = 21;
            wxpay.MD5Key      = Key_T.Text;
            if (wxpay.PayPlatID == 0)
            {
                bll.insert(wxpay);
            }
            else
            {
                bll.UpdateByID(wxpay);
            }
            WxPayConfig.UpdateByMod(wxpay);
            function.WriteSuccessMsg("保存成功!");
        }
Exemple #2
0
        public ContentResult PayPlat_API()
        {
            string result = "";
            string action = GetParam("action");
            int    id     = DataConverter.CLng(GetParam("ids"));

            switch (action)
            {
            case "move":
                #region 移动
            {
                string    direct = GetParam("direct");
                int       curid = DataConvert.CLng(GetParam("curid")), tarid = DataConvert.CLng(GetParam("tarid"));
                M_PayPlat curMod = platBll.SelReturnModel(curid);
                M_PayPlat tarMod = platBll.SelReturnModel(tarid);
                if (curMod.OrderID == tarMod.OrderID)
                {
                    switch (direct)
                    {
                    case "up":
                        curMod.OrderID++;
                        break;

                    case "down":
                        curMod.OrderID--;
                        break;
                    }
                }
                else
                {
                    int temp = curMod.OrderID;
                    curMod.OrderID = tarMod.OrderID;
                    tarMod.OrderID = temp;
                }
                platBll.UpdateByID(curMod);
                platBll.UpdateByID(tarMod);
            }
                #endregion
                break;

            case "enable":
            {
                bool      status  = DataConverter.CBool(GetParam("status"));
                M_PayPlat platMod = platBll.SelReturnModel(id);
                if (platMod == null)
                {
                    result = "支付平台[" + id + "]不存在";
                }
                else
                {
                    platMod.IsDisabled = !status;
                    platBll.UpdateByID(platMod);
                }
            }
            break;

            case "setdef":
            {
                platBll.SetDefault(id);
            }
            break;
            }
            return(Content(Success.ToString()));
        }