Exemplo n.º 1
0
        /// <summary>
        /// 添加或修改结算界面
        /// </summary>
        /// <returns></returns>
        public ActionResult SettlementAddOrUpdate()
        {
            int p_id = string.IsNullOrEmpty(Request["p_id"]) ? 0 : Int32.Parse(Request["p_id"]);

            JMP.BLL.jmp_poundage bll  = new JMP.BLL.jmp_poundage();
            JMP.MDL.jmp_poundage mode = new JMP.MDL.jmp_poundage();
            if (p_id > 0)
            {
                mode = bll.GetModel(p_id);
            }
            ViewBag.mode = mode;
            return(View());
        }
Exemplo n.º 2
0
        /// <summary>
        /// 结算设置一键启用或禁用
        /// </summary>
        /// <returns></returns>
        public JsonResult UpdatepoundageState()
        {
            object retJson = new { success = 0, msg = "操作失败" };
            int    state   = string.IsNullOrEmpty(Request["state"]) ? 0 : Int32.Parse(Request["state"].ToString());
            string str     = Request["ids"];
            string xgzfc   = ""; //组装说明
            string tsmsg   = ""; //提示

            JMP.BLL.jmp_poundage bll = new JMP.BLL.jmp_poundage();
            if (str.CompareTo("On") > 0)
            {
                str = str.Substring(3);
            }
            if (bll.UpdateLocUserState(str, state))
            {
                if (state == 1)
                {
                    xgzfc = "一键启用ID为:" + str;
                    tsmsg = "启用成功";
                }
                else
                {
                    tsmsg = "禁用成功";
                    xgzfc = "一键禁用ID为:" + str;
                }

                Logger.OperateLog("结算设置一键启用或禁用", xgzfc);
                retJson = new { success = 1, msg = tsmsg };
            }
            else
            {
                if (state == 1)
                {
                    tsmsg = "启用失败";
                }
                else
                {
                    tsmsg = "禁用失败";
                }
                retJson = new { success = 0, msg = tsmsg };
            }
            return(Json(retJson));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 添加或修改结算设置
        /// </summary>
        /// <param name="mode"></param>
        /// <returns></returns>
        public JsonResult AddOrUpdateSettlement(JMP.MDL.jmp_poundage mode)
        {
            object retJson = new { success = 0, msg = "操作失败" };

            JMP.BLL.jmp_poundage bll = new JMP.BLL.jmp_poundage();
            if (mode.p_id > 0)
            {
                #region 修改
                JMP.MDL.jmp_poundage mo = bll.GetModel(mode.p_id);
                mode.p_state = mo.p_state;
                if (bll.Update(mode))
                {
                    #region 日志说明
                    Logger.ModifyLog("修改结算设置", mo, mode);
                    #endregion
                    retJson = new { success = 1, msg = "修改成功" };
                }
                else
                {
                    retJson = new { success = 0, msg = "修改失败" };
                }
                #endregion
            }
            else
            {
                #region 添加
                mode.p_state = 0;
                int cg = bll.Add(mode);
                if (cg > 0)
                {
                    Logger.CreateLog("添加结算设置", mode);
                    retJson = new { success = 1, msg = "添加成功" };
                }
                else
                {
                    retJson = new { success = 0, msg = "添加失败" };
                }
                #endregion
            }
            return(Json(retJson));
        }
Exemplo n.º 4
0
        public ActionResult SettlementList()
        {
            #region 获取权限
            string locUrl = "";

            bool getUidT = bll_limit.GetLocUserLimitVoids("/System/UpdatepoundageState", UserInfo.UserId.ToString(), int.Parse(UserInfo.UserRoleId.ToString()));//一键启用和禁用结算
            if (getUidT)
            {
                locUrl += " <li onclick=\"javascript:UpdateSettlementState(1)\"><i class='fa fa-check-square-o'></i>一键启用</li>";

                locUrl += "<li onclick=\"javascript:UpdateSettlementState(0);\"><i class='fa fa-check-square-o'></i>一键禁用</li>";
            }
            bool getlocuserAdd = bll_limit.GetLocUserLimitVoids("/System/SettlementAddOrUpdate", UserInfo.UserId.ToString(), int.Parse(UserInfo.UserRoleId.ToString()));//添加支付类型
            if (getlocuserAdd)
            {
                locUrl += "<li onclick=\"AddSettlement()\"><i class='fa fa-plus'></i>添加结算</li>";
            }
            ViewBag.locUrl = locUrl;
            #endregion
            #region 查询
            JMP.BLL.jmp_poundage bll = new JMP.BLL.jmp_poundage();
            int    pageCount         = 0;
            int    pageIndexs        = string.IsNullOrEmpty(Request["pageIndexs"]) ? 1 : Int32.Parse(Request["pageIndexs"]); //当前页
            int    PageSize          = string.IsNullOrEmpty(Request["PageSize"]) ? 20 : Int32.Parse(Request["PageSize"]);    //每页显示数量
            string sql        = "select * from jmp_poundage where 1=1 ";
            int    searchDesc = string.IsNullOrEmpty(Request["searchDesc"]) ? 0 : Int32.Parse(Request["searchDesc"]);        //排序方式
            ViewBag.searchDesc = searchDesc;
            int SelectState = string.IsNullOrEmpty(Request["SelectState"]) ? -1 : Int32.Parse(Request["SelectState"]);       //状态
            ViewBag.SelectState = SelectState;
            int searchType = string.IsNullOrEmpty(Request["searchType"]) ? 0 : Int32.Parse(Request["searchType"]);           //查询条件选择
            ViewBag.searchType = searchType;
            string sea_name = string.IsNullOrEmpty(Request["sea_name"]) ? "" : Request["sea_name"];                          //查询条件内容
            ViewBag.sea_name = sea_name;
            string Order = "order by p_id ";
            if (searchType > 0 && !string.IsNullOrEmpty(sea_name))
            {
                switch (searchType)
                {
                case 1:
                    sql += " and p_id='" + sea_name + "' ";
                    break;
                }
            }
            if (SelectState > -1)
            {
                sql += " and p_state='" + SelectState + "' ";
            }
            if (searchDesc == 1)
            {
                Order = " order by p_id  ";
            }
            else
            {
                Order = " order by p_id desc ";
            }
            List <JMP.MDL.jmp_poundage> list = bll.SelectList(sql, Order, pageIndexs, PageSize, out pageCount);
            ViewBag.pageCount  = pageCount;
            ViewBag.pageIndexs = pageIndexs;
            ViewBag.PageSize   = PageSize;
            ViewBag.list       = list;
            #endregion
            return(View());
        }