private async Task OnCommSaveUpOrder() { if (PropID != 0) { var boreoilnumber = Propboreoilnumber; //////////// Номер скважины var partynumber = Proppartynumber; //////////// Номер бригады(партия) var oilfieldname = Propoilfieldname; //////////// Месторожд. var typeworkname = Proptypeworkname; //////////// Тип работ var dateorder = Propdateorder; //////////// Дата ордера var name = PropName; //////////// Куст /////////////Save obj in BD -> dynamic InsertOrdersDataObj = new Orders(dateorder, oilfieldname, name, boreoilnumber, partynumber, typeworkname, PropID); await OperationOrder.Update(InsertOrdersDataObj); ViewModelOrdersMain viewModelOrders = new ViewModelOrdersMain(); viewModelOrders.TheOrder = InsertOrdersDataObj; ObservableCollectionOrder.Clear(); this.Refresh(); } else { var boreoilnumber = Propboreoilnumber; //////////// Номер скважины var partynumber = Proppartynumber; //////////// Номер бригады(партия) var oilfieldname = Propoilfieldname; //////////// Месторожд. var typeworkname = Proptypeworkname; //////////// Тип работ var dateorder = Propdateorder; //////////// Дата ордера var name = PropName; //////////// Куст /////////////Save obj in BD -> dynamic InsertOrdersDataObj = new Orders(dateorder, oilfieldname, name, boreoilnumber, partynumber, typeworkname, 1); await OperationOrder.Insert(InsertOrdersDataObj); ViewModelOrdersMain viewModelOrders = new ViewModelOrdersMain(); viewModelOrders.TheOrder = InsertOrdersDataObj; ObservableCollectionOrder.Add(viewModelOrders); TableOrderObservable = ObservableCollectionOrder; } Window theUserControl = UserControlDialog; theUserControl.Close(); }
public ViewModelOrdersMain() { TheOrder = new Orders(); }