Пример #1
0
 public void Change(WareMaterial item)
 {
     if (List.Where(o => o.WareMaterialId == item.WareMaterialId).FirstOrDefault().Status == ChangerModel.WareMaterialStatus.Added)
     {
         ChangerModel model = List.Where(o => o.WareMaterialId == item.WareMaterialId).FirstOrDefault();
         model.WareMaterial = item;
     }
     else
     {
         ChangerModel model = List.Where(o => o.WareMaterialId == item.WareMaterialId).FirstOrDefault();
         model.WareMaterial = item;
         model.Status       = ChangerModel.WareMaterialStatus.Changed;
     }
 }
Пример #2
0
 public void Delete(WareMaterial item)
 {
     if (List.Where(o => o.WareMaterialId == item.WareMaterialId).FirstOrDefault() == null)
     {
         List.Add(new ChangerModel {
             WareMaterialId = item.WareMaterialId, WareMaterial = item, Status = ChangerModel.WareMaterialStatus.Deleted
         });
     }
     else
     {
         if (List.Where(o => o.WareMaterialId == item.WareMaterialId).FirstOrDefault().Status == ChangerModel.WareMaterialStatus.Added)
         {
             List.Remove(List.Where(o => o.WareMaterialId == item.WareMaterialId).FirstOrDefault());
         }
         else
         {
             ChangerModel model = List.Where(o => o.WareMaterialId == item.WareMaterialId).FirstOrDefault();
             model.Status = ChangerModel.WareMaterialStatus.Deleted;
         }
     }
 }
Пример #3
0
 public static void WareMaterialApplyChanges(ref WareMaterial wareMaterial, ChangerModel model)
 {
     wareMaterial.Length      = model.WareMaterial.Length;
     wareMaterial.Width       = model.WareMaterial.Width;
     wareMaterial.CustomPrice = model.WareMaterial.CustomPrice;
 }