public static StockOut Create(Department department,IDictionary<Product,long> productList, string createId,DateTime createDate,StockDefinitionStatus definitionStatus,string description,int confirmFlag = 1) { CoralPOS.Models.StockOut stockOut = new CoralPOS.Models.StockOut { CreateDate = createDate, ConfirmFlg = confirmFlag, CreateId = createId, UpdateId = createId, UpdateDate = createDate, Description = description, Department = department, DefinitionStatus = definitionStatus, ExclusiveKey = 0, DelFlg = 0, StockOutDate = createDate, StockOutDetails = new List<StockOutDetail>(), }; foreach (var stockInProduct in productList) { CoralPOS.Models.StockOutDetail detail = new StockOutDetail { StockOut = stockOut, CreateDate = createDate, UpdateDate = createDate, CreateId = createId, UpdateId = createId, Description = description, DelFlg = 0, ExclusiveKey = 0, Quantity = stockInProduct.Value, Product = stockInProduct.Key, ProductMaster = stockInProduct.Key.ProductMaster, GoodQuantity = stockInProduct.Value, DefectStatusId = definitionStatus.DefectStatusId }; stockOut.StockOutDetails.Add(detail); } return stockOut; }
public void Delete(StockOutDetail data) { StockOutDetailDao.Delete(data); }
public StockOutDetail Add(StockOutDetail data) { StockOutDetailDao.Add(data); return data; }
public void Update(StockOutDetail data) { StockOutDetailDao.Update(data); }
protected bool Equals(StockOutDetail entity) { if (entity == null) return false; if (!base.Equals(entity)) return false; return true; }