void DeleteClosingSheetLine() { CWPostClosingSheet postingDialog = new CWPostClosingSheet(masterRecord._ToDate, true); postingDialog.Closed += async delegate { if (postingDialog.DialogResult == true) { if (UnicontaMessageBox.Show(string.Format(Uniconta.ClientTools.Localization.lookup("ConfirmDeleteOBJ"), Uniconta.ClientTools.Localization.lookup("ClosingSheetLines")), Uniconta.ClientTools.Localization.lookup("Confirmation"), MessageBoxButton.OKCancel) != MessageBoxResult.OK) { return; } busyIndicator.BusyContent = Uniconta.ClientTools.Localization.lookup("BusyMessage"); busyIndicator.IsBusy = true; var deleteResult = await postingApi.DeleteJournalLines(masterRecord, postingDialog.Code); if (deleteResult != ErrorCodes.Succes) { busyIndicator.IsBusy = false; UtilDisplay.ShowErrorCode(deleteResult); } else { BindGrid(); } } }; postingDialog.Show(); }
void PostClosingSheet() { CWPostClosingSheet postingDialog = new CWPostClosingSheet(masterRecord._ToDate); #if !SILVERLIGHT postingDialog.DialogTableId = 2000000017; #endif postingDialog.Closed += async delegate { if (postingDialog.DialogResult == true) { busyIndicator.BusyContent = Uniconta.ClientTools.Localization.lookup("SendingWait"); busyIndicator.IsBusy = true; var postingResult = await postingApi.PostClosingSheet(masterRecord, postingDialog.Code, postingDialog.IsSimulation, postingDialog.PostedDate, postingDialog.comments, 0, new GLTransClientTotal()); busyIndicator.IsBusy = false; busyIndicator.BusyContent = Uniconta.ClientTools.Localization.lookup("LoadingMsg"); if (postingResult == null) { return; } if (postingResult.SimulatedTrans != null && postingResult.SimulatedTrans.Length > 0) { AddDockItem(TabControls.SimulatedTransactions, postingResult.SimulatedTrans, Uniconta.ClientTools.Localization.lookup("SimulatedTransactions")); this.UpdateLines(postingResult.ClosingLines, postingResult.SimulatedTrans); } else if (postingResult.Err == ErrorCodes.Succes) { UnicontaMessageBox.Show(Uniconta.ClientTools.Localization.lookup("ClosingSheetHasBeenPosted"), Uniconta.ClientTools.Localization.lookup("Message")); BindGrid(); } else { Utility.ShowJournalError(postingResult, dgGLTable); } } }; postingDialog.Show(); }