public PurchaseOrderObject(PurchaseOrder order) { this.Id = order.Id; this.IsActive = order.IsActive; this.Number = order.Number; this.Date = order.Date; }
public PurchaseOrderViewModel(IPurchaseOrderRepository repo, string number, IUserNotify notify) { this.repo = repo; this.notify = notify; saveCommand = ViewModelSource.Create(() => new SaveOrderCommand(repo, this, notify)); if (string.IsNullOrWhiteSpace(number)) { NewOrder(number); } else { var ord = LoadOrder(number); if(ord != null) { order = ord; } else { NewOrder(number); } } }
private void NewOrder(string number) { order = new PurchaseOrder() { Number = number, Date = DateTime.Now, IsActive = true }; }