Ejemplo n.º 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(AsrsStorDBAcc.Model.View_OutHouseBatchSetModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update View_OutHouseBatchSet set ");
            strSql.Append("StoreHouseName=@StoreHouseName,");
            strSql.Append("StoreHouseDesc=@StoreHouseDesc,");
            strSql.Append("StoreHouseID=@StoreHouseID,");
            strSql.Append("StoreHouseLogicAreaID=@StoreHouseLogicAreaID,");
            strSql.Append("StoreHouseAreaName=@StoreHouseAreaName,");
            strSql.Append("StoreHouseAreaDesc=@StoreHouseAreaDesc,");
            strSql.Append("Batch=@Batch");
            strSql.Append(" where StoreHouseName=@StoreHouseName and StoreHouseDesc=@StoreHouseDesc and StoreHouseID=@StoreHouseID and StoreHouseLogicAreaID=@StoreHouseLogicAreaID and StoreHouseAreaName=@StoreHouseAreaName and StoreHouseAreaDesc=@StoreHouseAreaDesc and Batch=@Batch ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@StoreHouseName",        SqlDbType.NVarChar,  50),
                new SqlParameter("@StoreHouseDesc",        SqlDbType.NVarChar, 100),
                new SqlParameter("@StoreHouseID",          SqlDbType.BigInt,     8),
                new SqlParameter("@StoreHouseLogicAreaID", SqlDbType.BigInt,     8),
                new SqlParameter("@StoreHouseAreaName",    SqlDbType.NVarChar,  50),
                new SqlParameter("@StoreHouseAreaDesc",    SqlDbType.NVarChar, 100),
                new SqlParameter("@Batch",                 SqlDbType.NVarChar, 200)
            };
            parameters[0].Value = model.StoreHouseName;
            parameters[1].Value = model.StoreHouseDesc;
            parameters[2].Value = model.StoreHouseID;
            parameters[3].Value = model.StoreHouseLogicAreaID;
            parameters[4].Value = model.StoreHouseAreaName;
            parameters[5].Value = model.StoreHouseAreaDesc;
            parameters[6].Value = model.Batch;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(AsrsStorDBAcc.Model.View_OutHouseBatchSetModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into View_OutHouseBatchSet(");
            strSql.Append("StoreHouseName,StoreHouseDesc,StoreHouseID,StoreHouseLogicAreaID,StoreHouseAreaName,StoreHouseAreaDesc,Batch)");
            strSql.Append(" values (");
            strSql.Append("@StoreHouseName,@StoreHouseDesc,@StoreHouseID,@StoreHouseLogicAreaID,@StoreHouseAreaName,@StoreHouseAreaDesc,@Batch)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@StoreHouseName",        SqlDbType.NVarChar,  50),
                new SqlParameter("@StoreHouseDesc",        SqlDbType.NVarChar, 100),
                new SqlParameter("@StoreHouseID",          SqlDbType.BigInt,     8),
                new SqlParameter("@StoreHouseLogicAreaID", SqlDbType.BigInt,     8),
                new SqlParameter("@StoreHouseAreaName",    SqlDbType.NVarChar,  50),
                new SqlParameter("@StoreHouseAreaDesc",    SqlDbType.NVarChar, 100),
                new SqlParameter("@Batch",                 SqlDbType.NVarChar, 200)
            };
            parameters[0].Value = model.StoreHouseName;
            parameters[1].Value = model.StoreHouseDesc;
            parameters[2].Value = model.StoreHouseID;
            parameters[3].Value = model.StoreHouseLogicAreaID;
            parameters[4].Value = model.StoreHouseAreaName;
            parameters[5].Value = model.StoreHouseAreaDesc;
            parameters[6].Value = model.Batch;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public AsrsStorDBAcc.Model.View_OutHouseBatchSetModel DataRowToModel(DataRow row)
 {
     AsrsStorDBAcc.Model.View_OutHouseBatchSetModel model = new AsrsStorDBAcc.Model.View_OutHouseBatchSetModel();
     if (row != null)
     {
         if (row["StoreHouseName"] != null)
         {
             model.StoreHouseName = row["StoreHouseName"].ToString();
         }
         if (row["StoreHouseDesc"] != null)
         {
             model.StoreHouseDesc = row["StoreHouseDesc"].ToString();
         }
         if (row["StoreHouseID"] != null && row["StoreHouseID"].ToString() != "")
         {
             model.StoreHouseID = long.Parse(row["StoreHouseID"].ToString());
         }
         if (row["StoreHouseLogicAreaID"] != null && row["StoreHouseLogicAreaID"].ToString() != "")
         {
             model.StoreHouseLogicAreaID = long.Parse(row["StoreHouseLogicAreaID"].ToString());
         }
         if (row["StoreHouseAreaName"] != null)
         {
             model.StoreHouseAreaName = row["StoreHouseAreaName"].ToString();
         }
         if (row["StoreHouseAreaDesc"] != null)
         {
             model.StoreHouseAreaDesc = row["StoreHouseAreaDesc"].ToString();
         }
         if (row["Batch"] != null)
         {
             model.Batch = row["Batch"].ToString();
         }
     }
     return(model);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public AsrsStorDBAcc.Model.View_OutHouseBatchSetModel GetModel(string StoreHouseName, string StoreHouseDesc, long StoreHouseID, long StoreHouseLogicAreaID, string StoreHouseAreaName, string StoreHouseAreaDesc, string Batch)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 StoreHouseName,StoreHouseDesc,StoreHouseID,StoreHouseLogicAreaID,StoreHouseAreaName,StoreHouseAreaDesc,Batch from View_OutHouseBatchSet ");
            strSql.Append(" where StoreHouseName=@StoreHouseName and StoreHouseDesc=@StoreHouseDesc and StoreHouseID=@StoreHouseID and StoreHouseLogicAreaID=@StoreHouseLogicAreaID and StoreHouseAreaName=@StoreHouseAreaName and StoreHouseAreaDesc=@StoreHouseAreaDesc and Batch=@Batch ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@StoreHouseName",        SqlDbType.NVarChar,  50),
                new SqlParameter("@StoreHouseDesc",        SqlDbType.NVarChar, 100),
                new SqlParameter("@StoreHouseID",          SqlDbType.BigInt,     8),
                new SqlParameter("@StoreHouseLogicAreaID", SqlDbType.BigInt,     8),
                new SqlParameter("@StoreHouseAreaName",    SqlDbType.NVarChar,  50),
                new SqlParameter("@StoreHouseAreaDesc",    SqlDbType.NVarChar, 100),
                new SqlParameter("@Batch",                 SqlDbType.NVarChar, 200)
            };
            parameters[0].Value = StoreHouseName;
            parameters[1].Value = StoreHouseDesc;
            parameters[2].Value = StoreHouseID;
            parameters[3].Value = StoreHouseLogicAreaID;
            parameters[4].Value = StoreHouseAreaName;
            parameters[5].Value = StoreHouseAreaDesc;
            parameters[6].Value = Batch;

            AsrsStorDBAcc.Model.View_OutHouseBatchSetModel model = new AsrsStorDBAcc.Model.View_OutHouseBatchSetModel();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }