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