private static void OnSupplierOrderUTB() { var supplierOrderViewModel = new SupplierOrderViewModel { Description = "Заявка на участие" }; var supplierOrderView = new SupplierOrderView(); supplierOrderViewModel.View = supplierOrderView; Workspace.This.Panels.Add(supplierOrderViewModel); Workspace.This.ActiveDocument = supplierOrderViewModel; }
public void UpdateSupplierOrderView(int supplierOrderId) { if (supplierOrderId == 0) { SupplierOrder = new SupplierOrderView() { id = 0 }; SelectedSupplier = new Supplier(); SelectedBroker = BrokersList[0]; SelectedContract = new Contract(); SelectedRate = new RatesList(); } else { SupplierOrder = SupplierOrderService.ReadSupplierOrder(supplierOrderId); SelectedSupplier = suppliersListStorage.FirstOrDefault(s => s.Id == SupplierOrder.supplierId); SearchCompany = SelectedSupplier.Name; if (SupplierOrder.brokerId != null) { SelectedBroker = BrokersList.FirstOrDefault(s => s.Id == SupplierOrder.brokerId); } else { SelectedBroker = null; } if (SupplierOrder.brokerId != null) { ContractsList = DictionariesService.ReadContracts(SelectedSupplier.companyId, SelectedBroker.Id); SelectedContract = ContractsList.FirstOrDefault(c => c.id == SupplierOrder.contractId); } else { ContractsList = new List <Contract>(); } } }
public SupplierOrderDetailsVM(SupplierOrderView supplierOrder) { SupplierOrder = supplierOrder; Init(); }