Esempio n. 1
0
        /// <summary>
        /// 通过货位ID获取库存ID
        /// 如果等于0为获取失败
        /// </summary>
        /// <param name="gsID"></param>
        /// <returns></returns>
        public long GetStockIDByGsID(int gsID)
        {
            string            whereStr  = "GoodsSiteID = " + gsID;
            List <StockModel> modelList = GetModelList(whereStr);

            if (modelList.Count > 0)
            {
                StockModel model = GetModelList(whereStr)[0];

                return(model.StockID);
            }
            else
            {
                return(0);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 获取添加库存hash用于事物
        /// </summary>
        /// <param name="model"></param>
        public Hashtable GetAddModelHash(StockModel model)
        {
            Hashtable     hs     = new Hashtable();
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Stock(");
            strSql.Append("GoodsSiteID,TrayCode,FullTraySign,Remarks)");
            strSql.Append(" values (");
            strSql.Append("@GoodsSiteID,@TrayCode,@FullTraySign,@Remarks)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@GoodsSiteID",  SqlDbType.Int,       4),
                new SqlParameter("@TrayCode",     SqlDbType.NVarChar, 50),
                new SqlParameter("@FullTraySign", SqlDbType.NVarChar, 50),
                new SqlParameter("@Remarks",      SqlDbType.NVarChar, 100)
            };
            parameters[0].Value = model.GoodsSiteID;
            parameters[1].Value = model.TrayCode;
            parameters[2].Value = model.FullTraySign;
            parameters[3].Value = model.Remarks;
            hs.Add(strSql.ToString(), parameters);
            return(hs);
        }
Esempio n. 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(ECAMSDataAccess.StockModel model)
 {
     return(dal.Update(model));
 }
Esempio n. 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public long Add(ECAMSDataAccess.StockModel model)
 {
     return(dal.Add(model));
 }
Esempio n. 5
0
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod
        #region  ExtensionMethod
        /// <summary>
        ///  获取添加库存hash用于事物
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public Hashtable GetAddModelHash(StockModel model)
        {
            return(dal.GetAddModelHash(model));
        }