Exemple #1
0
        protected void Lnk_Click(object sender, GridViewCommandEventArgs e)
        {
            int pid = DataConverter.CLng(e.CommandArgument.ToString());

            switch (e.CommandName)
            {
            case "SetDef":
                bll.SetDefault(pid);
                break;

            case "Disabled":
                M_PayPlat info = bll.GetPayPlatByid(pid);
                if (info.IsDisabled)
                {
                    info.IsDisabled = false;
                }
                else
                {
                    info.IsDisabled = true;
                }
                bll.Update(info);
                break;

            case "MovePre":
                bll.MovePre(pid);
                break;

            case "MoveNext":
                bll.MoveNext(pid);
                break;

            case "Delete":
                bll.DeleteByID(pid);
                Response.Redirect("PayPlatManage.aspx");
                break;
            }
            MyBind();
        }
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()));
        }