private void UpdateProduct(SimpleEditableProduct source, Product target) { target.Name = source.Name; target.Description = source.Description; target.Price = source.Price; target.CategoryId = source.CategoryId; }
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; } }
public void SetProduct(Product prod) { _editingProduct = prod; if (Product != null) { Product.ErrorsChanged -= RaiseCanExecuteChanged; } Product = new SimpleEditableProduct(); Product.ErrorsChanged += RaiseCanExecuteChanged; CopyProduct(prod, Product); }