void LoadProductData(ProductData ProductData) { if (ProductData != null) { this.Model = ProductData.Model; this.ProductName = ProductData.ProductName; this.Id = ProductData.Id; this.BarCode = ProductData.BarCode; this.ProductType = ProductData.ProductType; this.Ammount = ProductData.Ammount; this.AlertLevel = ProductData.AlertLevel; } }
AssociatedProductData ToAProductData(ProductData ProductData) { return new AssociatedProductData(warehouse, ProductData); }
public AssociatedProductData(Warehouse phoneBook, ProductData ProductData) { this.warehouse = phoneBook; LoadProductData(ProductData); }
public ProductData Prev(ProductData phone) { var orderedPhoneBook = db.Warehouse.OrderByDescending(pBook => pBook.Model).ThenByDescending(pBook => pBook.ProductName).ThenByDescending(pBook => pBook.Id); var orderedPhoneBookLower = orderedPhoneBook.Where(pBook => pBook.Model.CompareTo(phone.Model) < 0 || ((pBook.Model.CompareTo(phone.Model) == 0 && pBook.ProductName.CompareTo(phone.ProductName) < 0)) || (pBook.Model.CompareTo(phone.Model) == 0 && pBook.ProductName.CompareTo(phone.ProductName) == 0 && pBook.Id < phone.Id)); return orderedPhoneBookLower.Take(1).FirstOrDefault(); }
public ProductData Next(ProductData phone) { var orderedPhoneBook = db.Warehouse.OrderBy(pData => pData.Model).ThenBy(pData => pData.ProductName).ThenBy(pData => pData.Id); var orderedPhoneBookGreater = orderedPhoneBook.Where(pBook => pBook.Model.CompareTo(phone.Model) > 0 || ((pBook.Model.CompareTo(phone.Model) == 0 && pBook.ProductName.CompareTo(phone.ProductName) > 0)) || (pBook.Model.CompareTo(phone.Model) == 0 && pBook.ProductName.CompareTo(phone.ProductName) == 0 && pBook.Id > phone.Id)); return orderedPhoneBookGreater.Take(1).FirstOrDefault(); }
public void Del(ProductData phone) { db.Warehouse.Remove(phone); }
public void Add(ProductData phone) { db.Warehouse.Add(phone); }