public void OnDialogOpened(IDialogParameters parameters) { LocoCalculation = parameters.GetValue <LocoCalculationModel>("calculation"); LocoOrders = new(); LocoOrders = parameters.GetValue <List <LocoOrderModel> >("orders"); CalculationDate = LocoCalculation.DateOfCalculation; PaymentDate = LocoCalculation.DateOfPayment; }
public int InsertLocoCalculation(LocoCalculationModel locoCalculation) { try { _sql.StartTransaction("AccountingConnStr"); int output = _sql.LoadDataInTransaction <int, dynamic>("dbo.spLocoTravelCalc_Insert", locoCalculation).FirstOrDefault(); _sql.CommitTransaction(); return(output); } catch (System.Exception) { _sql.RollBackTransaction(); return(0); } }
private async void SaveOrder() { LocoCalculation.DateOfCalculation = CalculationDate; LocoCalculation.DateOfPayment = PaymentDate; TravelOrdersLocoModel order = new() { LocoCalculation = LocoCalculation, LocoOrders = LocoOrders }; bool isPosted = await _travelOrdersEndpoint.PostLocoTravel(order); if (isPosted) { var result = ButtonResult.OK; var p = new DialogParameters(); RequestClose?.Invoke(new DialogResult(result, p)); } } }