Пример #1
0
 private void UpdateProduct(SimpleEditableProduct source, Product target)
 {
     target.Name        = source.Name;
     target.Description = source.Description;
     target.Price       = source.Price;
     target.CategoryId  = source.CategoryId;
 }
Пример #2
0
 private void CopyProduct(Product source, SimpleEditableProduct target)
 {
     target.Id = source.Id;
     if (EditMode)
     {
         target.Name        = source.Name;
         target.Description = source.Description;
         target.Price       = source.Price;
         target.CategoryId  = source.CategoryId;
     }
 }
Пример #3
0
 public void SetProduct(Product prod)
 {
     _editingProduct = prod;
     if (Product != null)
     {
         Product.ErrorsChanged -= RaiseCanExecuteChanged;
     }
     Product = new SimpleEditableProduct();
     Product.ErrorsChanged += RaiseCanExecuteChanged;
     CopyProduct(prod, Product);
 }