Esempio n. 1
0
 public StockHistory Add(StockHistory data)
 {
     StockHistoryDAO.Add(data);
     return data;
 }
Esempio n. 2
0
 public void Delete(StockHistory data)
 {
     StockHistoryDAO.Delete(data);
 }
Esempio n. 3
0
 public void Update(StockHistory data)
 {
     StockHistoryDAO.Update(data);
 }
Esempio n. 4
0
        public void Process(StockHistory defect)
        {
            // find exist stock base on productid
            ObjectCriteria objectCriteria = new ObjectCriteria();
            objectCriteria.AddEqCriteria("Product.ProductId", defect.Product.ProductId);
            IList existList = StockHistoryDAO.FindAll(objectCriteria);

            if (existList.Count > 0) // exist stock ?
            {
                StockHistory existDefect = (StockHistory)existList[0];
                existDefect.DamageCount = defect.DamageCount;
                existDefect.Description = defect.Description;
                existDefect.ErrorCount = defect.ErrorCount;
                existDefect.LostCount = defect.LostCount;
                existDefect.GoodCount = defect.GoodCount;
                existDefect.Product = defect.Product;
                existDefect.ProductMaster = defect.ProductMaster;
                existDefect.Quantity = defect.Quantity;
                existDefect.Stock = defect.Stock;
                existDefect.UnconfirmCount = defect.UnconfirmCount;
                existDefect.UpdateDate = defect.UpdateDate;
                existDefect.UpdateId = defect.UpdateId;

                existDefect.ExclusiveKey = existDefect.ExclusiveKey + 1;
                defect.StockHistoryId = existDefect.StockHistoryId;

                StockHistoryDAO.Update(existDefect);
            }
            else
            {
                StockHistoryDAO.Add(defect);
            }
        }
Esempio n. 5
0
 /// <summary>
 /// Delete StockHistory from database.
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public void Delete(StockHistory data)
 {
     HibernateTemplate.Delete(data);
 }
Esempio n. 6
0
 /// <summary>
 /// Add StockHistory to database.
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public StockHistory Add(StockHistory data)
 {
     HibernateTemplate.Save(data);
     return data;
 }
Esempio n. 7
0
 /// <summary>
 /// Update StockHistory to database.
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public void Update(StockHistory data)
 {
     HibernateTemplate.Update(data);
 }