Пример #1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Aoyou_BusinessDB.ERP_WH_VG_RELModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ERP_WH_VG_REL set ");
            if (model.ERP_WH_VG_ID != null)
            {
                strSql.Append("ERP_WH_VG_ID='" + model.ERP_WH_VG_ID + "',");
            }
            else
            {
                strSql.Append("ERP_WH_VG_ID= null ,");
            }
            if (model.ERP_Shelf_VG_VList_ID != null)
            {
                strSql.Append("ERP_Shelf_VG_VList_ID='" + model.ERP_Shelf_VG_VList_ID + "',");
            }
            else
            {
                strSql.Append("ERP_Shelf_VG_VList_ID= null ,");
            }
            if (model.ERP_WH_VG_REL_Value != null)
            {
                strSql.Append("ERP_WH_VG_REL_Value='" + model.ERP_WH_VG_REL_Value + "',");
            }
            else
            {
                strSql.Append("ERP_WH_VG_REL_Value= null ,");
            }
            int n = strSql.ToString().LastIndexOf(",");

            strSql.Remove(n, 1);
            strSql.Append(" where ERP_WH_VG_REL_ID='" + model.ERP_WH_VG_REL_ID + "' ");
            int rowsAffected = DbHelperSQL.ExecuteSql(strSql.ToString());

            if (rowsAffected > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Aoyou_BusinessDB.ERP_WH_VG_RELModel model)
        {
            StringBuilder strSql  = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();
            StringBuilder strSql2 = new StringBuilder();

            if (model.ERP_WH_VG_REL_ID != null)
            {
                strSql1.Append("ERP_WH_VG_REL_ID,");
                strSql2.Append("'" + model.ERP_WH_VG_REL_ID + "',");
            }
            if (model.ERP_WH_VG_ID != null)
            {
                strSql1.Append("ERP_WH_VG_ID,");
                strSql2.Append("'" + model.ERP_WH_VG_ID + "',");
            }
            if (model.ERP_Shelf_VG_VList_ID != null)
            {
                strSql1.Append("ERP_Shelf_VG_VList_ID,");
                strSql2.Append("'" + model.ERP_Shelf_VG_VList_ID + "',");
            }
            if (model.ERP_WH_VG_REL_Value != null)
            {
                strSql1.Append("ERP_WH_VG_REL_Value,");
                strSql2.Append("'" + model.ERP_WH_VG_REL_Value + "',");
            }
            strSql.Append("insert into ERP_WH_VG_REL(");
            strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
            strSql.Append(")");
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Aoyou_BusinessDB.ERP_WH_VG_RELModel GetModel(string ERP_WH_VG_REL_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1  ");
            strSql.Append(" ERP_WH_VG_REL_ID,ERP_WH_VG_ID,ERP_Shelf_VG_VList_ID,ERP_WH_VG_REL_Value ");
            strSql.Append(" from ERP_WH_VG_REL ");
            strSql.Append(" where ERP_WH_VG_REL_ID='" + ERP_WH_VG_REL_ID + "' ");
            Aoyou_BusinessDB.ERP_WH_VG_RELModel model = new Aoyou_BusinessDB.ERP_WH_VG_RELModel();
            DataSet ds = DbHelperSQL.Query(strSql.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Пример #4
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Aoyou_BusinessDB.ERP_WH_VG_RELModel DataRowToModel(DataRow row)
 {
     Aoyou_BusinessDB.ERP_WH_VG_RELModel model = new Aoyou_BusinessDB.ERP_WH_VG_RELModel();
     if (row != null)
     {
         if (row["ERP_WH_VG_REL_ID"] != null)
         {
             model.ERP_WH_VG_REL_ID = row["ERP_WH_VG_REL_ID"].ToString();
         }
         if (row["ERP_WH_VG_ID"] != null)
         {
             model.ERP_WH_VG_ID = row["ERP_WH_VG_ID"].ToString();
         }
         if (row["ERP_Shelf_VG_VList_ID"] != null)
         {
             model.ERP_Shelf_VG_VList_ID = row["ERP_Shelf_VG_VList_ID"].ToString();
         }
         if (row["ERP_WH_VG_REL_Value"] != null)
         {
             model.ERP_WH_VG_REL_Value = row["ERP_WH_VG_REL_Value"].ToString();
         }
     }
     return(model);
 }
Пример #5
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Aoyou_BusinessDB.ERP_WH_VG_RELModel model)
 {
     return(dal.Update(model));
 }
Пример #6
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Aoyou_BusinessDB.ERP_WH_VG_RELModel model)
 {
     return(dal.Add(model));
 }