Exemple #1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        private string DelData()
        {
            string ids = Request.Form["id"];

            string[] id = ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            ids = "";
            for (int i = 0; i < id.Length; i++)
            {
                ids += "'" + id[i].Trim() + "'";
                if (i < id.Length - 1)
                {
                    ids += ",";
                }
            }
            XY_DZJZ_XTPZ bll = new XY_DZJZ_XTPZ(this.Request);

            if (bll.DeleteList(ids))
            {
                //数据日志
                OperateLog.AddLog(OperateLog.LogType.参数配置Web, "删除参数配置成功", Request.Form["cs"], UserInfo, UserRole, this.Request);
                return(ReturnString.JsonToString(Prompt.win, "删除数据成功,重新登录生效", null));
            }
            //数据日志
            OperateLog.AddLog(OperateLog.LogType.参数配置Web, "删除参数配置失败", Request.Form["cs"], UserInfo, UserRole, this.Request);
            return(ReturnString.JsonToString(Prompt.error, "删除数据失败", null));
        }
Exemple #2
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));
        }
Exemple #3
0
        /// <summary>
        /// 添加配置数据
        /// </summary>
        /// <returns></returns>
        private string AddData()
        {
            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);
            DataSet      ds  = bll.GetList(" and SystemMark=1 and ConfigId=:ConfigId", new string[] { Request.Form["slct_type_val"] });

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                return(ReturnString.JsonToString(Prompt.error, "选择的配置已被添加", null));
            }
            EDRS.Model.XY_DZJZ_XTPZ model = new EDRS.Model.XY_DZJZ_XTPZ();
            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"];
            }
            model.SYSTEMMARK = "1";

            if (bll.Add(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));
        }
Exemple #4
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));
        }