public StockHistory Add(StockHistory data) { StockHistoryDAO.Add(data); return data; }
public void Delete(StockHistory data) { StockHistoryDAO.Delete(data); }
public void Update(StockHistory data) { StockHistoryDAO.Update(data); }
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); } }
/// <summary> /// Delete StockHistory from database. /// </summary> /// <param name="data"></param> /// <returns></returns> public void Delete(StockHistory data) { HibernateTemplate.Delete(data); }
/// <summary> /// Add StockHistory to database. /// </summary> /// <param name="data"></param> /// <returns></returns> public StockHistory Add(StockHistory data) { HibernateTemplate.Save(data); return data; }
/// <summary> /// Update StockHistory to database. /// </summary> /// <param name="data"></param> /// <returns></returns> public void Update(StockHistory data) { HibernateTemplate.Update(data); }