Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
 AssociatedProductData ToAProductData(ProductData ProductData)
 {
     return new AssociatedProductData(warehouse, ProductData);
 }
Exemplo n.º 3
0
 public AssociatedProductData(Warehouse phoneBook, ProductData ProductData)
 {
     this.warehouse = phoneBook;
     LoadProductData(ProductData);
 }
Exemplo n.º 4
0
 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();
 }
Exemplo n.º 5
0
 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();
 }
Exemplo n.º 6
0
 public void Del(ProductData phone)
 {
     db.Warehouse.Remove(phone);
 }
Exemplo n.º 7
0
 public void Add(ProductData phone)
 {
     db.Warehouse.Add(phone);
 }