Exemple #1
0
        private async void ShowConfirmationPopup(string emptyString)
        {
            try
            {
                confirmationPopup = new Popup();

                confirmationPopup.IsLightDismissEnabled = true;
                confirmationPopup.Closed += confirmationPopup_Closed;

                confirmationPopup.Child = await CreateConfirmationView();

                confirmationPopup.Height           = 0.6 * Window.Current.CoreWindow.Bounds.Bottom;
                confirmationPopup.Width            = 0.5 * Window.Current.CoreWindow.Bounds.Right;
                confirmationPopup.HorizontalOffset = 0.25 * Window.Current.CoreWindow.Bounds.Right;
                confirmationPopup.VerticalOffset   = 0.2 * Window.Current.CoreWindow.Bounds.Bottom;

                confirmationPopup.IsOpen = true;
            }
            catch (T360Exception te)
            {
                InvoiceListViewModel invoiceListVM = (InvoiceListViewModel)DataContext;
                if (T360ErrorCodes.NotInReviewerQueue.Equals(te.ErrorCodes[0].Code))
                {
                    invoiceListVM.ReloadList(-1);
                }
                else
                {
                    string msg = invoiceListVM.getErrorMessages(te);
                    invoiceListVM.showErrorMessages(msg);
                }
            }
        }
Exemple #2
0
        private async void InvoiceList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            InvoiceListViewModel invoiceListVM = (InvoiceListViewModel)DataContext;

            if (invoiceListVM.MultiSelect)
            {
                invoiceListVM.InvoiceCount = InvoiceList.SelectedItems.Count.ToString();
                return;
            }
            if (ApplicationView.Value == ApplicationViewState.Snapped)
            {
                ApplicationView.TryUnsnap();
            }
            try
            {
                if (invoiceListVM.SelectedInvoice > -1)
                {
                    if (canCallServer)
                    {
                        bool selectionSuccess = await invoiceListVM.SetSummary(invoiceListVM.InvoiceDetails[invoiceListVM.SelectedInvoice].InvoiceId);

                        if (selectionSuccess)
                        {
                            previousSelectedInvoice = invoiceListVM.SelectedInvoice;
                        }
                        else
                        {
                            invoiceListVM.SelectedInvoice = previousSelectedInvoice;
                        }
                        if (invoiceListVM.SelectedInvoice == -1)
                        {
                            if (invoiceListVM.InvoiceDetails.Count > 0)
                            {
                                UserPreference.Instance.SelectedInvoiceId = 0;
                                InvoiceList.ScrollIntoView(InvoiceList.Items[0], ScrollIntoViewAlignment.Default);
                            }
                        }
                        else
                        {
                            UserPreference.Instance.SelectedInvoiceId = invoiceListVM.InvoiceDetails[invoiceListVM.SelectedInvoice].InvoiceId;
                            InvoiceList.ScrollIntoView(InvoiceList.Items[invoiceListVM.SelectedInvoice], ScrollIntoViewAlignment.Default);
                        }
                    }
                    else
                    {
                        canCallServer = true;
                    }
                    invoiceListVM.HasSelectedInvoice = Visibility.Visible;
                }
                if (invoiceListVM.SelectedInvoice == -1)
                {
                    invoiceListVM.HasSelectedInvoice = Visibility.Collapsed;
                }
            }
            catch (T360Exception ex)
            {
                if (T360ErrorCodes.NotInReviewerQueue.Equals(ex.ErrorCodes[0].Code))
                {
                    invoiceListVM.ReloadList(-1);
                }
                else
                {
                    string msg = invoiceListVM.getErrorMessages(ex);
                    invoiceListVM.showErrorMessages(msg);
                }
            }
        }