コード例 #1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public View_QueryStockListModel GetModel(int GoodsSiteID, string GoodsSiteName, int GoodsSiteRow, int GoodsSiteColumn, int GoodsSiteLayer, string GoodsSiteStoreStatus, string GoodsSiteRunStatus, string GoodsSiteInOutType, long StockID, long StockListID, string StoreHouseName, string ProductStatus, string ProductName, DateTime InHouseTime, DateTime UpdateTime, long ManaTaskID, string ProductCode, int ProductNum, string ProductBatchNum)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 GoodsSiteID,GoodsSiteName,GoodsSiteRow,GoodsSiteColumn,GoodsSiteLayer,GoodsSiteStoreStatus,GoodsSiteRunStatus,GoodsSiteInOutType,StockID,StockListID,StoreHouseName,ProductStatus,ProductName,InHouseTime,UpdateTime,ManaTaskID,ProductCode,ProductNum,ProductBatchNum from View_QueryStockList ");
            strSql.Append(" where GoodsSiteID=@GoodsSiteID and GoodsSiteName=@GoodsSiteName and GoodsSiteRow=@GoodsSiteRow and GoodsSiteColumn=@GoodsSiteColumn and GoodsSiteLayer=@GoodsSiteLayer and GoodsSiteStoreStatus=@GoodsSiteStoreStatus and GoodsSiteRunStatus=@GoodsSiteRunStatus and GoodsSiteInOutType=@GoodsSiteInOutType and StockID=@StockID and StockListID=@StockListID and StoreHouseName=@StoreHouseName and ProductStatus=@ProductStatus and ProductName=@ProductName and InHouseTime=@InHouseTime and UpdateTime=@UpdateTime and ManaTaskID=@ManaTaskID and ProductCode=@ProductCode and ProductNum=@ProductNum and ProductBatchNum=@ProductBatchNum ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@GoodsSiteID",          SqlDbType.Int,        4),
                new SqlParameter("@GoodsSiteName",        SqlDbType.NVarChar,  50),
                new SqlParameter("@GoodsSiteRow",         SqlDbType.Int,        4),
                new SqlParameter("@GoodsSiteColumn",      SqlDbType.Int,        4),
                new SqlParameter("@GoodsSiteLayer",       SqlDbType.Int,        4),
                new SqlParameter("@GoodsSiteStoreStatus", SqlDbType.NVarChar,  50),
                new SqlParameter("@GoodsSiteRunStatus",   SqlDbType.NVarChar,  50),
                new SqlParameter("@GoodsSiteInOutType",   SqlDbType.NVarChar,  50),
                new SqlParameter("@StockID",              SqlDbType.BigInt,     8),
                new SqlParameter("@StockListID",          SqlDbType.BigInt,     8),
                new SqlParameter("@StoreHouseName",       SqlDbType.NVarChar,  20),
                new SqlParameter("@ProductStatus",        SqlDbType.NVarChar,  50),
                new SqlParameter("@ProductName",          SqlDbType.NVarChar,  20),
                new SqlParameter("@InHouseTime",          SqlDbType.DateTime),
                new SqlParameter("@UpdateTime",           SqlDbType.DateTime),
                new SqlParameter("@ManaTaskID",           SqlDbType.BigInt,     8),
                new SqlParameter("@ProductCode",          SqlDbType.NVarChar,  50),
                new SqlParameter("@ProductNum",           SqlDbType.Int,        4),
                new SqlParameter("@ProductBatchNum",      SqlDbType.NVarChar, 50)
            };
            parameters[0].Value  = GoodsSiteID;
            parameters[1].Value  = GoodsSiteName;
            parameters[2].Value  = GoodsSiteRow;
            parameters[3].Value  = GoodsSiteColumn;
            parameters[4].Value  = GoodsSiteLayer;
            parameters[5].Value  = GoodsSiteStoreStatus;
            parameters[6].Value  = GoodsSiteRunStatus;
            parameters[7].Value  = GoodsSiteInOutType;
            parameters[8].Value  = StockID;
            parameters[9].Value  = StockListID;
            parameters[10].Value = StoreHouseName;
            parameters[11].Value = ProductStatus;
            parameters[12].Value = ProductName;
            parameters[13].Value = InHouseTime;
            parameters[14].Value = UpdateTime;
            parameters[15].Value = ManaTaskID;
            parameters[16].Value = ProductCode;
            parameters[17].Value = ProductNum;
            parameters[18].Value = ProductBatchNum;

            View_QueryStockListModel model = new View_QueryStockListModel();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
        public View_QueryStockListModel GetModelByGSID(int gsID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append(" select *  from View_QueryStockList");

            strSql.Append(" where GoodsSiteID = " + gsID);
            View_QueryStockListModel model = new View_QueryStockListModel();
            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
        public View_QueryStockListModel GetModelByGsName(string storeHouseName, string rowth, string columnth, string layerth)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append(" select *  from View_QueryStockList");

            strSql.Append(" where StoreHouseName = '" + storeHouseName + "'");
            strSql.Append(" and GoodsSiteRow = " + rowth);
            strSql.Append(" and GoodsSiteColumn = " + columnth);
            strSql.Append(" and GoodsSiteLayer = " + layerth);
            View_QueryStockListModel model = new View_QueryStockListModel();
            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 bool Update(View_QueryStockListModel model)
 {
     return(dal.Update(model));
 }
コード例 #5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(View_QueryStockListModel model)
 {
     return(dal.Add(model));
 }
コード例 #6
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(View_QueryStockListModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into View_QueryStockList(");
            strSql.Append("GoodsSiteID,GoodsSiteName,GoodsSiteRow,GoodsSiteColumn,GoodsSiteLayer,GoodsSiteStoreStatus,GoodsSiteRunStatus,GoodsSiteInOutType,StockID,StockListID,StoreHouseName,ProductStatus,ProductName,InHouseTime,UpdateTime,ManaTaskID,ProductCode,ProductNum,ProductBatchNum)");
            strSql.Append(" values (");
            strSql.Append("@GoodsSiteID,@GoodsSiteName,@GoodsSiteRow,@GoodsSiteColumn,@GoodsSiteLayer,@GoodsSiteStoreStatus,@GoodsSiteRunStatus,@GoodsSiteInOutType,@StockID,@StockListID,@StoreHouseName,@ProductStatus,@ProductName,@InHouseTime,@UpdateTime,@ManaTaskID,@ProductCode,@ProductNum,@ProductBatchNum)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@GoodsSiteID",          SqlDbType.Int,        4),
                new SqlParameter("@GoodsSiteName",        SqlDbType.NVarChar,  50),
                new SqlParameter("@GoodsSiteRow",         SqlDbType.Int,        4),
                new SqlParameter("@GoodsSiteColumn",      SqlDbType.Int,        4),
                new SqlParameter("@GoodsSiteLayer",       SqlDbType.Int,        4),
                new SqlParameter("@GoodsSiteStoreStatus", SqlDbType.NVarChar,  50),
                new SqlParameter("@GoodsSiteRunStatus",   SqlDbType.NVarChar,  50),
                new SqlParameter("@GoodsSiteInOutType",   SqlDbType.NVarChar,  50),
                new SqlParameter("@StockID",              SqlDbType.BigInt,     8),
                new SqlParameter("@StockListID",          SqlDbType.BigInt,     8),
                new SqlParameter("@StoreHouseName",       SqlDbType.NVarChar,  20),
                new SqlParameter("@ProductStatus",        SqlDbType.NVarChar,  50),
                new SqlParameter("@ProductName",          SqlDbType.NVarChar,  20),
                new SqlParameter("@InHouseTime",          SqlDbType.DateTime),
                new SqlParameter("@UpdateTime",           SqlDbType.DateTime),
                new SqlParameter("@ManaTaskID",           SqlDbType.BigInt,     8),
                new SqlParameter("@ProductCode",          SqlDbType.NVarChar,  50),
                new SqlParameter("@ProductNum",           SqlDbType.Int,        4),
                new SqlParameter("@ProductBatchNum",      SqlDbType.NVarChar, 50)
            };
            parameters[0].Value  = model.GoodsSiteID;
            parameters[1].Value  = model.GoodsSiteName;
            parameters[2].Value  = model.GoodsSiteRow;
            parameters[3].Value  = model.GoodsSiteColumn;
            parameters[4].Value  = model.GoodsSiteLayer;
            parameters[5].Value  = model.GoodsSiteStoreStatus;
            parameters[6].Value  = model.GoodsSiteRunStatus;
            parameters[7].Value  = model.GoodsSiteInOutType;
            parameters[8].Value  = model.StockID;
            parameters[9].Value  = model.StockListID;
            parameters[10].Value = model.StoreHouseName;
            parameters[11].Value = model.ProductStatus;
            parameters[12].Value = model.ProductName;
            parameters[13].Value = model.InHouseTime;
            parameters[14].Value = model.UpdateTime;
            parameters[15].Value = model.ManaTaskID;
            parameters[16].Value = model.ProductCode;
            parameters[17].Value = model.ProductNum;
            parameters[18].Value = model.ProductBatchNum;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #7
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public View_QueryStockListModel DataRowToModel(DataRow row)
        {
            View_QueryStockListModel model = new View_QueryStockListModel();

            if (row != null)
            {
                if (row["GoodsSiteID"] != null && row["GoodsSiteID"].ToString() != "")
                {
                    model.GoodsSiteID = int.Parse(row["GoodsSiteID"].ToString());
                }
                if (row["GoodsSiteName"] != null)
                {
                    model.GoodsSiteName = row["GoodsSiteName"].ToString();
                }
                if (row["GoodsSiteRow"] != null && row["GoodsSiteRow"].ToString() != "")
                {
                    model.GoodsSiteRow = int.Parse(row["GoodsSiteRow"].ToString());
                }
                if (row["GoodsSiteColumn"] != null && row["GoodsSiteColumn"].ToString() != "")
                {
                    model.GoodsSiteColumn = int.Parse(row["GoodsSiteColumn"].ToString());
                }
                if (row["GoodsSiteLayer"] != null && row["GoodsSiteLayer"].ToString() != "")
                {
                    model.GoodsSiteLayer = int.Parse(row["GoodsSiteLayer"].ToString());
                }
                if (row["GoodsSiteStoreStatus"] != null)
                {
                    model.GoodsSiteStoreStatus = row["GoodsSiteStoreStatus"].ToString();
                }
                if (row["GoodsSiteRunStatus"] != null)
                {
                    model.GoodsSiteRunStatus = row["GoodsSiteRunStatus"].ToString();
                }
                if (row["GoodsSiteInOutType"] != null)
                {
                    model.GoodsSiteInOutType = row["GoodsSiteInOutType"].ToString();
                }
                if (row["StockID"] != null && row["StockID"].ToString() != "")
                {
                    model.StockID = long.Parse(row["StockID"].ToString());
                }
                if (row["StockListID"] != null && row["StockListID"].ToString() != "")
                {
                    model.StockListID = long.Parse(row["StockListID"].ToString());
                }
                if (row["StoreHouseName"] != null)
                {
                    model.StoreHouseName = row["StoreHouseName"].ToString();
                }
                if (row["ProductStatus"] != null)
                {
                    model.ProductStatus = row["ProductStatus"].ToString();
                }
                if (row["ProductName"] != null)
                {
                    model.ProductName = row["ProductName"].ToString();
                }
                if (row["InHouseTime"] != null && row["InHouseTime"].ToString() != "")
                {
                    model.InHouseTime = DateTime.Parse(row["InHouseTime"].ToString());
                }
                if (row["UpdateTime"] != null && row["UpdateTime"].ToString() != "")
                {
                    model.UpdateTime = DateTime.Parse(row["UpdateTime"].ToString());
                }
                if (row["ManaTaskID"] != null && row["ManaTaskID"].ToString() != "")
                {
                    model.ManaTaskID = long.Parse(row["ManaTaskID"].ToString());
                }
                if (row["ProductCode"] != null)
                {
                    model.ProductCode = row["ProductCode"].ToString();
                }
                if (row["ProductNum"] != null && row["ProductNum"].ToString() != "")
                {
                    model.ProductNum = int.Parse(row["ProductNum"].ToString());
                }
                if (row["ProductBatchNum"] != null)
                {
                    model.ProductBatchNum = row["ProductBatchNum"].ToString();
                }
            }
            return(model);
        }
コード例 #8
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(View_QueryStockListModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update View_QueryStockList set ");
            strSql.Append("GoodsSiteID=@GoodsSiteID,");
            strSql.Append("GoodsSiteName=@GoodsSiteName,");
            strSql.Append("GoodsSiteRow=@GoodsSiteRow,");
            strSql.Append("GoodsSiteColumn=@GoodsSiteColumn,");
            strSql.Append("GoodsSiteLayer=@GoodsSiteLayer,");
            strSql.Append("GoodsSiteStoreStatus=@GoodsSiteStoreStatus,");
            strSql.Append("GoodsSiteRunStatus=@GoodsSiteRunStatus,");
            strSql.Append("GoodsSiteInOutType=@GoodsSiteInOutType,");
            strSql.Append("StockID=@StockID,");
            strSql.Append("StockListID=@StockListID,");
            strSql.Append("StoreHouseName=@StoreHouseName,");
            strSql.Append("ProductStatus=@ProductStatus,");
            strSql.Append("ProductName=@ProductName,");
            strSql.Append("InHouseTime=@InHouseTime,");
            strSql.Append("UpdateTime=@UpdateTime,");
            strSql.Append("ManaTaskID=@ManaTaskID,");
            strSql.Append("ProductCode=@ProductCode,");
            strSql.Append("ProductNum=@ProductNum,");
            strSql.Append("ProductBatchNum=@ProductBatchNum");
            strSql.Append(" where GoodsSiteID=@GoodsSiteID and GoodsSiteName=@GoodsSiteName and GoodsSiteRow=@GoodsSiteRow and GoodsSiteColumn=@GoodsSiteColumn and GoodsSiteLayer=@GoodsSiteLayer and GoodsSiteStoreStatus=@GoodsSiteStoreStatus and GoodsSiteRunStatus=@GoodsSiteRunStatus and GoodsSiteInOutType=@GoodsSiteInOutType and StockID=@StockID and StockListID=@StockListID and StoreHouseName=@StoreHouseName and ProductStatus=@ProductStatus and ProductName=@ProductName and InHouseTime=@InHouseTime and UpdateTime=@UpdateTime and ManaTaskID=@ManaTaskID and ProductCode=@ProductCode and ProductNum=@ProductNum and ProductBatchNum=@ProductBatchNum ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@GoodsSiteID",          SqlDbType.Int,        4),
                new SqlParameter("@GoodsSiteName",        SqlDbType.NVarChar,  50),
                new SqlParameter("@GoodsSiteRow",         SqlDbType.Int,        4),
                new SqlParameter("@GoodsSiteColumn",      SqlDbType.Int,        4),
                new SqlParameter("@GoodsSiteLayer",       SqlDbType.Int,        4),
                new SqlParameter("@GoodsSiteStoreStatus", SqlDbType.NVarChar,  50),
                new SqlParameter("@GoodsSiteRunStatus",   SqlDbType.NVarChar,  50),
                new SqlParameter("@GoodsSiteInOutType",   SqlDbType.NVarChar,  50),
                new SqlParameter("@StockID",              SqlDbType.BigInt,     8),
                new SqlParameter("@StockListID",          SqlDbType.BigInt,     8),
                new SqlParameter("@StoreHouseName",       SqlDbType.NVarChar,  20),
                new SqlParameter("@ProductStatus",        SqlDbType.NVarChar,  50),
                new SqlParameter("@ProductName",          SqlDbType.NVarChar,  20),
                new SqlParameter("@InHouseTime",          SqlDbType.DateTime),
                new SqlParameter("@UpdateTime",           SqlDbType.DateTime),
                new SqlParameter("@ManaTaskID",           SqlDbType.BigInt,     8),
                new SqlParameter("@ProductCode",          SqlDbType.NVarChar,  50),
                new SqlParameter("@ProductNum",           SqlDbType.Int,        4),
                new SqlParameter("@ProductBatchNum",      SqlDbType.NVarChar, 50)
            };
            parameters[0].Value  = model.GoodsSiteID;
            parameters[1].Value  = model.GoodsSiteName;
            parameters[2].Value  = model.GoodsSiteRow;
            parameters[3].Value  = model.GoodsSiteColumn;
            parameters[4].Value  = model.GoodsSiteLayer;
            parameters[5].Value  = model.GoodsSiteStoreStatus;
            parameters[6].Value  = model.GoodsSiteRunStatus;
            parameters[7].Value  = model.GoodsSiteInOutType;
            parameters[8].Value  = model.StockID;
            parameters[9].Value  = model.StockListID;
            parameters[10].Value = model.StoreHouseName;
            parameters[11].Value = model.ProductStatus;
            parameters[12].Value = model.ProductName;
            parameters[13].Value = model.InHouseTime;
            parameters[14].Value = model.UpdateTime;
            parameters[15].Value = model.ManaTaskID;
            parameters[16].Value = model.ProductCode;
            parameters[17].Value = model.ProductNum;
            parameters[18].Value = model.ProductBatchNum;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }