Beispiel #1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(EDRS.Model.XT_QX_ANDY model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into XT_QX_ANDY(");
            strSql.Append("ANBH,YMMC,ANMC)");
            strSql.Append(" values (");
            strSql.Append(":ANBH,:YMMC,:ANMC)");
            OracleParameter[] parameters =
            {
                new OracleParameter(":ANBH", OracleType.VarChar,  50),
                new OracleParameter(":YMMC", OracleType.VarChar, 200),
                new OracleParameter(":ANMC", OracleType.VarChar, 100)
            };
            parameters[0].Value = model.ANBH;
            parameters[1].Value = model.YMMC;
            parameters[2].Value = model.ANMC;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(EDRS.Model.XT_QX_ANDY model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update XT_QX_ANDY set ");
            strSql.Append("ANBH=:ANBH,");
            strSql.Append("YMMC=:YMMC,");
            strSql.Append("ANMC=:ANMC");
            strSql.Append(" where ANBM=:ANBM ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":ANBM", OracleType.VarChar,  50),
                new OracleParameter(":ANBH", OracleType.VarChar,  50),
                new OracleParameter(":YMMC", OracleType.VarChar, 200),
                new OracleParameter(":ANMC", OracleType.VarChar, 100)
            };
            parameters[0].Value = model.ANBM;
            parameters[1].Value = model.ANBH;
            parameters[2].Value = model.YMMC;
            parameters[3].Value = model.ANMC;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 添加配置数据
        /// </summary>
        /// <returns></returns>
        private string AddData()
        {
            string msg = string.Empty;

            if (!ProvingFrom(ref msg))
            {
                return(ReturnString.JsonToString(Prompt.error, msg, null));
            }
            EDRS.BLL.XT_QX_ANDY bll = new EDRS.BLL.XT_QX_ANDY(this.Request);

            int count = bll.GetRecordCount(" and ANBH = :ANBH", new object[] { Request.Form.Get("txt_xh").Trim() });

            if (count > 0)
            {
                return(ReturnString.JsonToString(Prompt.error, "按钮编号已存在", null));
            }
            EDRS.Model.XT_QX_ANDY model = new EDRS.Model.XT_QX_ANDY();
            model.ANBH = Request.Form.Get("txt_xh").Trim();
            model.ANMC = Request.Form.Get("txt_mc").Trim();
            model.YMMC = Request.Form.Get("txt_ymmc_val").Trim();

            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));
        }
Beispiel #4
0
        /// <summary>
        /// 修改配置数据
        /// </summary>
        /// <returns></returns>
        private string UpData()
        {
            string anbh = Request.Form.Get("key_hidd").Trim();

            if (string.IsNullOrEmpty(anbh))
            {
                //数据日志
                //OperateLog.AddLog(OperateLog.LogType.功能分类管理Web, "修改功能分类的参数错误", UserInfo, UserRole, this.Request);
                return(ReturnString.JsonToString(Prompt.error, "未找到需要修改信息", null));
            }
            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_ANDY bll = new EDRS.BLL.XT_QX_ANDY(this.Request);

            int count = bll.GetRecordCount(" and ANBH = :ANBH", new object[] { Request.Form.Get("txt_xh").Trim() });

            if (count > 0)
            {
                return(ReturnString.JsonToString(Prompt.error, "按钮编号已存在", null));
            }

            EDRS.Model.XT_QX_ANDY model = bll.GetModel(anbh);
            if (model != null)
            {
                model.ANBH = Request.Form.Get("txt_xh").Trim();
                model.ANMC = Request.Form.Get("txt_mc").Trim();
                model.YMMC = Request.Form.Get("txt_ymmc_val").Trim();
                if (bll.Update(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));
            }
            //数据日志
            //OperateLog.AddLog(OperateLog.LogType.功能分类管理Web, "修改功能分类未找到信息", Request.Form.Get("txt_mc"), UserInfo, UserRole, this.Request);
            return(ReturnString.JsonToString(Prompt.error, "未找到需要修改信息", null));
        }
Beispiel #5
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public EDRS.Model.XT_QX_ANDY DataRowToModel(DataRow row)
 {
     EDRS.Model.XT_QX_ANDY model = new EDRS.Model.XT_QX_ANDY();
     if (row != null)
     {
         if (row["ANBM"] != null)
         {
             model.ANBM = row["ANBM"].ToString();
         }
         if (row["ANBH"] != null)
         {
             model.ANBH = row["ANBH"].ToString();
         }
         if (row["YMMC"] != null)
         {
             model.YMMC = row["YMMC"].ToString();
         }
         if (row["ANMC"] != null)
         {
             model.ANMC = row["ANMC"].ToString();
         }
     }
     return(model);
 }
Beispiel #6
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public EDRS.Model.XT_QX_ANDY GetModel(string ANBM)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select ANBM,ANBH,YMMC,ANMC from XT_QX_ANDY ");
            strSql.Append(" where ANBM=:ANBM ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":ANBM", OracleType.VarChar, 50)
            };
            parameters[0].Value = ANBM;

            EDRS.Model.XT_QX_ANDY model = new EDRS.Model.XT_QX_ANDY();
            DataSet ds = DbHelperOra.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Beispiel #7
0
 /// <summary>
 /// 根据单位获取配置数据
 /// </summary>
 /// <param name="DWBM"></param>
 /// <returns></returns>
 private string GetModel(string anbm)
 {
     if (string.IsNullOrEmpty(anbm))
     {
         anbm = Request.Form["id"];
         if (string.IsNullOrEmpty(anbm))
         {
             //数据日志
             //OperateLog.AddLog(OperateLog.LogType.功能分类管理Web, "根据编号获取功能分类信息参数错误", UserInfo, UserRole, this.Request);
             return(ReturnString.JsonToString(Prompt.error, "参数错误", null));
         }
     }
     EDRS.BLL.XT_QX_ANDY   bll   = new EDRS.BLL.XT_QX_ANDY(this.Request);
     EDRS.Model.XT_QX_ANDY model = bll.GetModel(anbm);
     if (model != null)
     {
         //数据日志
         //OperateLog.AddLog(OperateLog.LogType.功能分类管理Web, "根据编号获取功能分类信息成功", model.FLMC, UserInfo, UserRole, this.Request);
         return(JsonHelper.JsonString(model));
     }
     //数据日志
     //OperateLog.AddLog(OperateLog.LogType.功能分类管理Web, "根据编号获取功能分类信息参数失败", Request["mc"], UserInfo, UserRole, this.Request);
     return(ReturnString.JsonToString(Prompt.error, "获取数据失败", null));
 }