Exemplo n.º 1
0
        /// <summary>
        /// 冻结或解冻掉单设置
        /// </summary>
        /// <returns></returns>
        public JsonResult UpdateDisoOderState()
        {
            object retJson = new { success = 0, msg = "操作失败" };
            int    state   = string.IsNullOrEmpty(Request["state"]) ? 0 : Int32.Parse(Request["state"].ToString());
            string str     = Request["ids"];

            JMP.BLL.jmp_dispatchorder bll = new JMP.BLL.jmp_dispatchorder();
            string tsmsg = ""; //提示说明
            string xgzfc = ""; //日志说明

            if (str.CompareTo("On") > 0)
            {
                str = str.Substring(3);
            }
            if (bll.UpdateState(str, state))
            {
                tsmsg = state == 0 ? "启用成功" : "禁用成功";
                xgzfc = state == 0 ? "一键启用ID为:" + str : "一键禁用ID为:" + str;
                Logger.OperateLog("掉单设置一键启用或禁用", xgzfc);
                retJson = new { success = 1, msg = tsmsg };
            }
            else
            {
                tsmsg   = state == 0 ? "启用失败" : "禁用失败";
                retJson = new { success = 0, msg = tsmsg };
            }
            return(Json(retJson));
        }
Exemplo n.º 2
0
        public ActionResult dispatchorderLsit()
        {
            #region 权限查询
            string locUrl  = "";
            bool   getUidT = bll_limit.GetLocUserLimitVoids("/System/UpdateDisoOderState", UserInfo.UserId.ToString(), int.Parse(UserInfo.UserRoleId.ToString()));//一键启用支付类型
            if (getUidT)
            {
                locUrl += "<li onclick=\"javascript:UpdateddState(0)\"><i class='fa fa-check-square-o'></i>一键启用</li>";
                locUrl += "<li onclick=\"javascript:UpdateddState(1);\"><i class='fa fa-check-square-o'></i>一键禁用</li>";
            }
            bool getlocuserAdd = bll_limit.GetLocUserLimitVoids("/System/AddOrUpdatedispatchorder", UserInfo.UserId.ToString(), int.Parse(UserInfo.UserRoleId.ToString()));//添加支付类型
            if (getlocuserAdd)
            {
                locUrl += "<li id=\"ToolBar\" onclick=\"adddispatchorderLsit()\"><i class='fa fa-plus'></i>掉单设置</li>";
            }
            ViewBag.locUrl = locUrl;
            #endregion
            #region 查询
            List <JMP.MDL.jmp_dispatchorder> list = new List <JMP.MDL.jmp_dispatchorder>();
            JMP.BLL.jmp_dispatchorder        bll  = new JMP.BLL.jmp_dispatchorder();
            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"]);        //每页显示数量
            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 sql = " select a.d_apptyeid,a.d_id,a.d_ratio,a.d_state,a.d_datatime,b.t_name from  jmp_dispatchorder a left join  jmp_apptype b on a.d_apptyeid=b.t_id ";
            string where = " where 1=1 ";
            if (searchType > 0 && !string.IsNullOrEmpty(sea_name))
            {
                switch (searchType)
                {
                case 1:
                    where += " and a.d_id=" + sea_name;
                    break;

                case 2:
                    where += " and b.t_name like'%" + sea_name + "%' ";
                    break;
                }
            }
            if (SelectState > -1)
            {
                where += SelectState == 1 ? " and a.d_state=1 " : " and a.d_state=0 ";
            }
            string Order = searchDesc == 0 ? "order by d_id desc " : "order by d_id ";
            sql  = sql + where;
            list = bll.SelectPager(sql, Order, pageIndexs, PageSize, out pageCount);
            ViewBag.pageIndexs = pageIndexs;
            ViewBag.PageSize   = PageSize;
            ViewBag.pageCount  = pageCount;
            ViewBag.list       = list;
            #endregion
            return(View());
        }
Exemplo n.º 3
0
        /// <summary>
        /// 调单添加界面
        /// </summary>
        /// <returns></returns>
        public ActionResult Adddispatchorder()
        {
            int did = string.IsNullOrEmpty(Request["did"]) ? 0 : Int32.Parse(Request["did"]);

            string where = "";
            where        = did > 0 ? " t_state='1' and t_id  =(select d_apptyeid from jmp_dispatchorder where d_id=" + did + "  ) and t_topid=0" : " t_state='1' and t_id not in( select d_apptyeid from jmp_dispatchorder   ) and t_topid=0";
            JMP.BLL.jmp_apptype        yybll  = new JMP.BLL.jmp_apptype();
            DataTable                  yydt   = yybll.GetList(where).Tables[0];//获取应用类型在用信息
            List <JMP.MDL.jmp_apptype> yylist = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_apptype>(yydt);

            ViewBag.yylist = yylist;
            JMP.BLL.jmp_dispatchorder bll  = new JMP.BLL.jmp_dispatchorder();
            JMP.MDL.jmp_dispatchorder mode = new JMP.MDL.jmp_dispatchorder();
            if (did > 0)
            {
                mode = bll.GetModel(did) == null ? new JMP.MDL.jmp_dispatchorder() : bll.GetModel(did);
            }
            ViewBag.mode = mode;
            return(View());
        }
Exemplo n.º 4
0
        /// <summary>
        /// 添加或修改调单设置
        /// </summary>
        /// <param name="mo"></param>
        /// <returns></returns>
        public JsonResult AddOrUpdatedispatchorder(JMP.MDL.jmp_dispatchorder mo)
        {
            object retJson = new { success = 0, msg = "操作失败" };

            JMP.BLL.jmp_dispatchorder bll = new JMP.BLL.jmp_dispatchorder();
            if (mo.d_id > 0)
            {
                JMP.MDL.jmp_dispatchorder mod = new JMP.MDL.jmp_dispatchorder();
                mod = bll.GetModel(mo.d_id);

                mo.d_state    = mod.d_state;
                mo.d_datatime = DateTime.Now;
                if (bll.Update(mo))
                {
                    #region 日志说明
                    Logger.ModifyLog("修改调单设置", mod, mo);
                    #endregion
                    retJson = new { success = 1, msg = "编辑成功!" };
                }
                else
                {
                    retJson = new { success = 0, msg = "编辑失败!" };
                }
            }
            else
            {
                mo.d_datatime = DateTime.Now;
                mo.d_state    = 0;
                int cg = bll.Add(mo);
                if (cg > 0)
                {
                    Logger.CreateLog("添加调单设置", mo);
                    retJson = new { success = 1, msg = "添加成功!" };
                }
                else
                {
                    retJson = new { success = 0, msg = "添加失败!" };
                }
            }
            return(Json(retJson));
        }