public List <string> AddProductCodeIn4Divide(string productCode) { if (ProductCodeInList.Contains(productCode)) { throw new Exception("Sản phẩm đầu vào đã có trong danh sách đầu vào."); } if (ProductCodeInList.Count == 1) { throw new Exception("Sản phẩm đầu vào chỉ được 1 loại."); } RedBloodDataContext db = new RedBloodDataContext(); int count = db.Packs.Where(r => r.ProductCode == productCode && DINInList.Contains(r.DIN)).Count(); if (count < DINInList.Count) { throw new Exception("Sản phẩm đầu vào không có túi máu."); } if (count > DINInList.Count) { throw new Exception("Sản phẩm đầu vào có túi máu bị trùng dữ liệu."); } ProductCodeInList.Add(productCode); return(ProductCodeInList); }
public List <string> AddProductCodeIn(string productCode) { if (ProductCodeInList.Contains(productCode)) { throw new Exception("Sản phẩm đầu vào đã có trong danh sách đầu vào."); } if (ProductCodeOutList.Contains(productCode)) { throw new Exception("Sản phẩm đầu vào đã có trong danh sách đầu ra."); } if (ProductCodeInList.Count == 1) { throw new Exception("Sản phẩm đầu vào chỉ được 1 loại."); } ProductCodeInList.Add(productCode); return(ProductCodeInList); }
public List <string> AddProductCodeIn(string productCode) { if (ProductCodeInList.Contains(productCode)) { throw new Exception("Sản phẩm đầu vào đã có trong danh sách đầu vào."); } if (ProductCodeOutList.Contains(productCode)) { throw new Exception("Sản phẩm đầu vào đã có trong danh sách đầu ra."); } if (ProductCodeInList.Count == 1) { throw new Exception("Sản phẩm đầu vào chỉ được 1 loại."); } List <string> tempList = ProductCodeInList.ToList(); tempList.Add(productCode); ReceiptBLL.ValidateOnTherapyReceipt(tempList, ProductCodeOutList); RedBloodDataContext db = new RedBloodDataContext(); int count = db.Packs.Where(r => r.ProductCode == productCode && DINInList.Contains(r.DIN)).Count(); if (count < DINInList.Count) { throw new Exception("Sản phẩm đầu vào không có túi máu."); } if (count > DINInList.Count) { throw new Exception("Sản phẩm đầu vào có túi máu bị trùng dữ liệu."); } ProductCodeInList.Add(productCode); return(ProductCodeInList); }