コード例 #1
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public WMS_Database.WH_WareHouseModel DataRowToModel(DataRow row)
 {
     WMS_Database.WH_WareHouseModel model = new WMS_Database.WH_WareHouseModel();
     if (row != null)
     {
         if (row["WareHouse_ID"] != null)
         {
             model.WareHouse_ID = row["WareHouse_ID"].ToString();
         }
         if (row["WareHouse_Code"] != null)
         {
             model.WareHouse_Code = row["WareHouse_Code"].ToString();
         }
         if (row["WareHouse_Name"] != null)
         {
             model.WareHouse_Name = row["WareHouse_Name"].ToString();
         }
         if (row["WareHouse_Type"] != null)
         {
             model.WareHouse_Type = row["WareHouse_Type"].ToString();
         }
         if (row["WareHouse_Flag"] != null)
         {
             model.WareHouse_Flag = row["WareHouse_Flag"].ToString();
         }
         if (row["WareHouse_Remark"] != null)
         {
             model.WareHouse_Remark = row["WareHouse_Remark"].ToString();
         }
         if (row["WareHouse_Reserve1"] != null)
         {
             model.WareHouse_Reserve1 = row["WareHouse_Reserve1"].ToString();
         }
         if (row["WareHouse_Reserve2"] != null)
         {
             model.WareHouse_Reserve2 = row["WareHouse_Reserve2"].ToString();
         }
         if (row["WareHouse_Reserve3"] != null)
         {
             model.WareHouse_Reserve3 = row["WareHouse_Reserve3"].ToString();
         }
         if (row["WareHouse_Reserve4"] != null)
         {
             model.WareHouse_Reserve4 = row["WareHouse_Reserve4"].ToString();
         }
         if (row["WareHouse_Reserve5"] != null)
         {
             model.WareHouse_Reserve5 = row["WareHouse_Reserve5"].ToString();
         }
     }
     return(model);
 }
コード例 #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public WMS_Database.WH_WareHouseModel GetModel(string WareHouse_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1  ");
            strSql.Append(" WareHouse_ID,WareHouse_Code,WareHouse_Name,WareHouse_Type,WareHouse_Flag,WareHouse_Remark,WareHouse_Reserve1,WareHouse_Reserve2,WareHouse_Reserve3,WareHouse_Reserve4,WareHouse_Reserve5 ");
            strSql.Append(" from WH_WareHouse ");
            strSql.Append(" where WareHouse_ID='" + WareHouse_ID + "' ");
            WMS_Database.WH_WareHouseModel model = new WMS_Database.WH_WareHouseModel();
            DataSet ds = DbHelperSQL.Query(strSql.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
コード例 #3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(WMS_Database.WH_WareHouseModel model)
        {
            StringBuilder strSql  = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();
            StringBuilder strSql2 = new StringBuilder();

            if (model.WareHouse_ID != null)
            {
                strSql1.Append("WareHouse_ID,");
                strSql2.Append("'" + model.WareHouse_ID + "',");
            }
            if (model.WareHouse_Code != null)
            {
                strSql1.Append("WareHouse_Code,");
                strSql2.Append("'" + model.WareHouse_Code + "',");
            }
            if (model.WareHouse_Name != null)
            {
                strSql1.Append("WareHouse_Name,");
                strSql2.Append("'" + model.WareHouse_Name + "',");
            }
            if (model.WareHouse_Type != null)
            {
                strSql1.Append("WareHouse_Type,");
                strSql2.Append("'" + model.WareHouse_Type + "',");
            }
            if (model.WareHouse_Flag != null)
            {
                strSql1.Append("WareHouse_Flag,");
                strSql2.Append("'" + model.WareHouse_Flag + "',");
            }
            if (model.WareHouse_Remark != null)
            {
                strSql1.Append("WareHouse_Remark,");
                strSql2.Append("'" + model.WareHouse_Remark + "',");
            }
            if (model.WareHouse_Reserve1 != null)
            {
                strSql1.Append("WareHouse_Reserve1,");
                strSql2.Append("'" + model.WareHouse_Reserve1 + "',");
            }
            if (model.WareHouse_Reserve2 != null)
            {
                strSql1.Append("WareHouse_Reserve2,");
                strSql2.Append("'" + model.WareHouse_Reserve2 + "',");
            }
            if (model.WareHouse_Reserve3 != null)
            {
                strSql1.Append("WareHouse_Reserve3,");
                strSql2.Append("'" + model.WareHouse_Reserve3 + "',");
            }
            if (model.WareHouse_Reserve4 != null)
            {
                strSql1.Append("WareHouse_Reserve4,");
                strSql2.Append("'" + model.WareHouse_Reserve4 + "',");
            }
            if (model.WareHouse_Reserve5 != null)
            {
                strSql1.Append("WareHouse_Reserve5,");
                strSql2.Append("'" + model.WareHouse_Reserve5 + "',");
            }
            strSql.Append("insert into WH_WareHouse(");
            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);
            }
        }
コード例 #4
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(WMS_Database.WH_WareHouseModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update WH_WareHouse set ");
            if (model.WareHouse_Code != null)
            {
                strSql.Append("WareHouse_Code='" + model.WareHouse_Code + "',");
            }
            else
            {
                strSql.Append("WareHouse_Code= null ,");
            }
            if (model.WareHouse_Name != null)
            {
                strSql.Append("WareHouse_Name='" + model.WareHouse_Name + "',");
            }
            else
            {
                strSql.Append("WareHouse_Name= null ,");
            }
            if (model.WareHouse_Type != null)
            {
                strSql.Append("WareHouse_Type='" + model.WareHouse_Type + "',");
            }
            else
            {
                strSql.Append("WareHouse_Type= null ,");
            }
            if (model.WareHouse_Flag != null)
            {
                strSql.Append("WareHouse_Flag='" + model.WareHouse_Flag + "',");
            }
            else
            {
                strSql.Append("WareHouse_Flag= null ,");
            }
            if (model.WareHouse_Remark != null)
            {
                strSql.Append("WareHouse_Remark='" + model.WareHouse_Remark + "',");
            }
            else
            {
                strSql.Append("WareHouse_Remark= null ,");
            }
            if (model.WareHouse_Reserve1 != null)
            {
                strSql.Append("WareHouse_Reserve1='" + model.WareHouse_Reserve1 + "',");
            }
            else
            {
                strSql.Append("WareHouse_Reserve1= null ,");
            }
            if (model.WareHouse_Reserve2 != null)
            {
                strSql.Append("WareHouse_Reserve2='" + model.WareHouse_Reserve2 + "',");
            }
            else
            {
                strSql.Append("WareHouse_Reserve2= null ,");
            }
            if (model.WareHouse_Reserve3 != null)
            {
                strSql.Append("WareHouse_Reserve3='" + model.WareHouse_Reserve3 + "',");
            }
            else
            {
                strSql.Append("WareHouse_Reserve3= null ,");
            }
            if (model.WareHouse_Reserve4 != null)
            {
                strSql.Append("WareHouse_Reserve4='" + model.WareHouse_Reserve4 + "',");
            }
            else
            {
                strSql.Append("WareHouse_Reserve4= null ,");
            }
            if (model.WareHouse_Reserve5 != null)
            {
                strSql.Append("WareHouse_Reserve5='" + model.WareHouse_Reserve5 + "',");
            }
            else
            {
                strSql.Append("WareHouse_Reserve5= null ,");
            }
            int n = strSql.ToString().LastIndexOf(",");

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

            if (rowsAffected > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #5
0
ファイル: WH_WareHouseBll.cs プロジェクト: zebingzhou/WMS
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(WMS_Database.WH_WareHouseModel model)
 {
     return(dal.Update(model));
 }
コード例 #6
0
ファイル: WH_WareHouseBll.cs プロジェクト: zebingzhou/WMS
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(WMS_Database.WH_WareHouseModel model)
 {
     return(dal.Add(model));
 }