private void InvoiceMultiApproveHandler(object sender, ServiceEventArgs se) { ServiceResponse result = se.Result; if (result.Status) { Deployment.Current.Dispatcher.BeginInvoke(() => { NavigationService.GoBack(); }); } else { List <Error> resultError = result.ErrorDetails; Error error = resultError[0]; if (Constants.Disallow.ToUpper().Equals(error.Code.ToUpper())) { InvoiceErrorDetails = new Model.Invoice.InvoiceErrorDetails() { PageType = Constants.Disallow, ErrorDetails = resultError, Header = Source == Model.Base.Source.INVOICE_MULTI_APPROVE ? "Approve Invoices" : string.Empty }; } else if (Constants.Warning.ToUpper().Equals(error.Code.ToUpper())) { InvoiceErrorDetails = new Model.Invoice.InvoiceErrorDetails() { PageType = Constants.Warning, ErrorDetails = resultError, Header = Source == Model.Base.Source.INVOICE_MULTI_APPROVE ? "Approve Invoices" : string.Empty, InvoiceBasicDetails = InvoiceInputDetails.SelectedInvoices }; } else { InvoiceErrorDetails = new Model.Invoice.InvoiceErrorDetails() { PageType = "Failed (" + resultError.Count + ")", ErrorDetails = resultError, Header = Source == Model.Base.Source.INVOICE_MULTI_APPROVE ? "Approve Invoices" : string.Empty }; } Deployment.Current.Dispatcher.BeginInvoke(() => { this.ProgressBar.Show(); PageInProgress = true; Uri uri = new Uri("/Tymetrix.T360.Mobile.Client.AppWP8;component/Invoice/InvoiceApproveError.xaml", UriKind.Relative); NavigationService.Navigate(uri); this.ProgressBar.Hide(); }); } }
private void handleRejectError(List <Error> errorList, string title) { if (Constants.Failure.ToUpper().Equals(errorList[0].Code.ToUpper())) { InvoiceErrorDetails = new Model.Invoice.InvoiceErrorDetails() { PageType = Constants.Failure, ErrorDetails = errorList, Header = "Reject Invoices" }; //InvoiceApproveErrorInput = new object[3]; //InvoiceApproveErrorInput[0] = Constants.Failure; //InvoiceApproveErrorInput[1] = errorList; //InvoiceApproveErrorInput[2] = "Reject Invoices"; Deployment.Current.Dispatcher.BeginInvoke(() => { this.ProgressBar.Show(); PageInProgress = true; Uri uri = new Uri("/Tymetrix.T360.Mobile.Client.AppWP8;component/Invoice/InvoiceApproveError.xaml", UriKind.Relative); NavigationService.Navigate(uri); this.ProgressBar.Hide(); }); } else { ShowError(new AppException(errorList), title); } if (errorList[0] != null && T360ErrorCodes.NotInReviewerQueue == errorList[0].Code) { Deployment.Current.Dispatcher.BeginInvoke(() => { this.ProgressBar.Hide(); PageInProgress = false; RedirectToInvoiceList(); }); } }