Exemplo n.º 1
0
        /// <summary>
        /// 添加配置数据
        /// </summary>
        /// <returns></returns>
        private string AddData()
        {
            string msg = string.Empty;

            if (!ProvingFrom(ref msg))
            {
                //数据日志
                OperateLog.AddLog(OperateLog.LogType.功能分类管理Web, "添加功能分类验证失败:" + msg, Request.Form.Get("txt_mc"), UserInfo, UserRole, this.Request);
                return(ReturnString.JsonToString(Prompt.error, msg, null));
            }
            EDRS.BLL.XT_QX_GNFL bll = new EDRS.BLL.XT_QX_GNFL(this.Request);

            string  number = UserInfo.DWBM + "000001";//  Request.Form.Get("txt_dwbm").Trim()
            DataSet ds     = bll.GetListByPage(" and dwbm=" + StringPlus.ReplaceSingle(UserInfo.DWBM.Trim()), "FLBM desc", 0, 1, null);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                number = (Decimal.Parse(ds.Tables[0].Rows[0]["FLBM"].ToString()) + 1).ToString();
            }

            EDRS.Model.XT_QX_GNFL model = new EDRS.Model.XT_QX_GNFL();
            model.FLBM  = number;
            model.FLMC  = Request.Form.Get("txt_mc").Trim();
            model.DWBM  = UserInfo.DWBM; // Request.Form.Get("txt_dwbm").Trim();
            model.FLXH  = Convert.ToDecimal(Request.Form.Get("txt_xh").Trim());
            model.FFLBM = "";
            model.SFSC  = "N";
            model.URLDZ = "";


            if (bll.Add(model))
            {
                //数据日志
                OperateLog.AddLog(OperateLog.LogType.功能分类管理Web, "添加功能分类成功", model.FLMC, UserInfo, UserRole, this.Request);
                return(ReturnString.JsonToString(Prompt.win, "保存成功", null));
            }
            //数据日志
            OperateLog.AddLog(OperateLog.LogType.功能分类管理Web, "添加功能分类失败", model.FLMC, UserInfo, UserRole, this.Request);
            return(ReturnString.JsonToString(Prompt.error, "保存失败", null));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 绑定列表
        /// </summary>
        /// <returns></returns>
        public string ListBind()
        {
            string page = Request["page"];
            string rows = Request["pagesize"];
            string key  = Request["key"];

            int pageNumber = int.Parse(page);
            int pageSize   = int.Parse(rows);

            string where = string.Empty;
            string order = string.Empty;

            object[] values = new object[1];
            //if (!string.IsNullOrEmpty(key))
            //{
            //    where += " and DWBM like :DWBM ";
            //    values[0] = "%" + key + "%";
            //    order = "FLXH";
            //}
            // where += " and DWBM='" + UserInfo.DWBM + "'";
            order = "FLXH";
            EDRS.BLL.XT_QX_GNFL bll = new EDRS.BLL.XT_QX_GNFL(this.Request);

            DataSet ds = bll.GetListByPage(where, order, (pageSize * pageNumber) - pageSize + 1, (pageSize * pageNumber), values);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                //数据日志
                OperateLog.AddLog(OperateLog.LogType.功能分类管理Web, "绑定功能分类列表成功", UserInfo, UserRole, this.Request);
                int count = bll.GetRecordCount(where, values);
                return("{\"Total\":" + count + ",\"Rows\":" + JsonHelper.JsonString(ds.Tables[0]) + "}");
            }
            //数据日志
            OperateLog.AddLog(OperateLog.LogType.功能分类管理Web, "绑定功能分类列表未找到信息", UserInfo, UserRole, this.Request);
            return(ReturnString.JsonToString(Prompt.error, "未找到功能分类信息", null));
        }