示例#1
0
        /// <summary>
        /// 修改配置数据
        /// </summary>
        /// <returns></returns>
        private string UpData()
        {
            string pzbm = Request.Form.Get("key_hidd").Trim();

            if (string.IsNullOrEmpty(pzbm))
            {
                return(ReturnString.JsonToString(Prompt.error, "未找到需要修改信息", null));
            }
            string msg = string.Empty;

            if (!ProvingFrom(ref msg))
            {
                return(ReturnString.JsonToString(Prompt.error, msg, null));
            }

            XY_DZJZ_XTPZ bll = new XY_DZJZ_XTPZ(this.Request);

            EDRS.Model.XY_DZJZ_XTPZ model = bll.GetModel(pzbm);
            if (model != null)
            {
                model.CONFIGID   = Convert.ToInt32(Request.Form["slct_type_val"]);
                model.CONFIGNAME = Enum.Parse(typeof(EnumConfig), Request.Form["slct_type_val"], true).ToString();
                if (!string.IsNullOrEmpty(Request.Form["txt_value_val"]))
                {
                    model.CONFIGVALUE = Request.Form["txt_value_val"];
                }
                else
                {
                    model.CONFIGVALUE = Request.Form["txt_value"];
                }
                if (bll.Update(model))
                {
                    //数据日志
                    OperateLog.AddLog(OperateLog.LogType.参数配置Web, "修改参数配置成功", model.CONFIGNAME, UserInfo, UserRole, this.Request);
                    return(ReturnString.JsonToString(Prompt.win, "保存成功,重新登录生效", null));
                }
                //数据日志
                OperateLog.AddLog(OperateLog.LogType.参数配置Web, "修改参数配置失败", model.CONFIGNAME, UserInfo, UserRole, this.Request);
                return(ReturnString.JsonToString(Prompt.error, "保存失败", null));
            }
            //数据日志
            OperateLog.AddLog(OperateLog.LogType.参数配置Web, "修改参数配置未找到信息", Request.Form.Get("txt_cs"), UserInfo, UserRole, this.Request);
            return(ReturnString.JsonToString(Prompt.error, "未找到需要修改信息", null));
        }
示例#2
0
        /// <summary>
        /// 根据单位获取配置数据
        /// </summary>
        /// <param name="DWBM"></param>
        /// <returns></returns>
        private string GetModel(string PZBM)
        {
            if (string.IsNullOrEmpty(PZBM))
            {
                PZBM = Request["id"];
                if (string.IsNullOrEmpty(PZBM))
                {
                    return(ReturnString.JsonToString(Prompt.error, "参数错误", null));
                }
            }
            XY_DZJZ_XTPZ bll = new XY_DZJZ_XTPZ(this.Request);

            EDRS.Model.XY_DZJZ_XTPZ model = bll.GetModel(PZBM);
            if (model != null)
            {
                //数据日志
                OperateLog.AddLog(OperateLog.LogType.参数配置Web, "根据编号获取参数配置信息成功", model.CONFIGNAME, UserInfo, UserRole, this.Request);
                return(JsonHelper.JsonString(model));
            }
            //数据日志
            OperateLog.AddLog(OperateLog.LogType.参数配置Web, "根据编号获取参数配置信息参数失败", Request["cs"], UserInfo, UserRole, this.Request);
            return(ReturnString.JsonToString(Prompt.error, "获取数据失败", null));
        }