Ejemplo n.º 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool ParamUpdate(BasParam model)
        {
            StringBuilder strb = new StringBuilder();
            strb.Append(" Update bas_param ");
            strb.Append(" Set ");
            //strb.Append("id         = " + model.Id + ",");
            strb.Append("parent_id       = " + model.ParentId + ",");
            strb.Append("grade        = '" + model.Grade + "',");
            strb.Append("code         = '" + model.Code + "',");
            strb.Append("title        = '" + model.Title + "',");

            strb.Append("remark       = '" + model.Remark + "',");
            strb.Append("sort         = '" + model.Sort + "',");
            strb.Append("enable_flag  = '" + model.EnableFlag + "'");
            strb.Append(" where  id = " + model.Id);

            return DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 得到一个实体内容
        /// </summary>
        public BasParam ParamDetail(string id)
        {
            string strSql = "select * from bas_param where id = " + id;
            BasParam model = new BasParam();
            DataRow dr = DataBase.ExecuteDataRow(strSql);

                model.Id = dr["id"].ToString().Trim();
                model.ParentId = dr["parent_id"].ToString().Trim();
                model.Grade = dr["grade"].ToString().Trim();
                model.Code = dr["code"].ToString().Trim();
                model.Title = dr["title"].ToString().Trim();

                model.Remark = dr["remark"].ToString().Trim();
                model.Sort = dr["sort"].ToString().Trim();
                model.EnableFlag = dr["enable_flag"].ToString().Trim();

            return model;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// ����һ������
 /// </summary>
 public bool ParamUpdate(BasParam model)
 {
     return dal.ParamUpdate(model);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool ParamAdd(BasParam model)
        {
            StringBuilder strb = new StringBuilder();
            strb.Append(" Insert Into bas_param ");
            strb.Append(" ( ");
            //strb.Append("id, ");
            strb.Append("parent_id, ");
            strb.Append("grade, ");
            strb.Append("code, ");
            strb.Append("title, ");
            //strb.Append("enumvalue, ");
            strb.Append("remark, ");
            strb.Append("sort, ");
            strb.Append("enable_flag ");
            strb.Append(" )");
            strb.Append(" Values( ");
            //strb.Append("" + model.Id + ", ");
            strb.Append("" + model.ParentId + ", ");
            strb.Append("'" + model.Grade + "', ");
            strb.Append("'" + model.Code + "', ");
            strb.Append("'" + model.Title + "', ");

            strb.Append("'" + model.Remark + "', ");
            strb.Append("'" + model.Sort + "', ");
            strb.Append("'" + model.EnableFlag + "' ");
            strb.Append(" )");

            return DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// ����һ������
 /// </summary>
 public bool ParamAdd(BasParam model)
 {
     return dal.ParamAdd(model);
 }