private void UpdateProduct(SimpleEditableProduct source, Product target) { target.ProductName = source.ProductName; target.Description = source.Description; target.Price = source.Price; target.Category = source.Category; }
private void CopyProduct(Product source, SimpleEditableProduct target) { target.ProductId = source.ProductId; if (EditFlag) { target.ProductName = source.ProductName; target.Description = source.Description; target.Price = source.Price; target.Category = source.Category; } }
public void SetProduct(Product product) { _editableProduct = product; if (SimpleEditableProduct != null) { SimpleEditableProduct.ErrorsChanged -= RaiseCanExecuteChanged; } SimpleEditableProduct = new SimpleEditableProduct(); SimpleEditableProduct.ErrorsChanged += RaiseCanExecuteChanged; CopyProduct(product, SimpleEditableProduct); }