Beispiel #1
0
        private void BtnCancel_Click(object sender, RoutedEventArgs e)
        {
            PhonebookCreatedUpdated();

            FlyoutHelper.CloseFlyout(this);
        }
Beispiel #2
0
        private void BtnCancel_Click(object sender, RoutedEventArgs e)
        {
            BusinessPartnerCreatedUpdated();

            FlyoutHelper.CloseFlyout(this);
        }
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     FlyoutHelper.CloseFlyout(this);
 }
Beispiel #4
0
        private void BtnSubmit_Click(object sender, RoutedEventArgs e)
        {
            #region Validation

            if (currentShipment?.ShipmentNumber == null)
            {
                MainWindow.WarningMessage = ((string)Application.Current.FindResource("Obavezno_poljeDvotačka_Broj_posiljke"));
                return;
            }

            #endregion

            Thread td = new Thread(() => {
                SubmitButtonContent = ((string)Application.Current.FindResource("Čuvanje_u_tokuTriTacke"));
                SubmitButtonEnabled = false;

                currentShipment.IsSynced = false;
                currentShipment.Company  = new CompanyViewModel()
                {
                    Id = MainWindow.CurrentCompanyId
                };
                currentShipment.CreatedBy = new UserViewModel()
                {
                    Id = MainWindow.CurrentUserId
                };

                ShipmentResponse response = new ShipmentSQLiteRepository().Create(currentShipment);
                if (!response.Success)
                {
                    MainWindow.ErrorMessage = ((string)Application.Current.FindResource("Greška_kod_lokalnog_čuvanjaUzvičnik"));
                    SubmitButtonContent     = ((string)Application.Current.FindResource("Proknjiži"));
                    SubmitButtonEnabled     = true;
                }

                response = ShipmentService.Create(currentShipment);
                if (!response.Success)
                {
                    MainWindow.ErrorMessage = ((string)Application.Current.FindResource("Podaci_su_sačuvani_u_lokaluUzvičnikTačka_Greška_kod_čuvanja_na_serveruUzvičnik"));
                    SubmitButtonContent     = ((string)Application.Current.FindResource("Proknjiži"));
                    SubmitButtonEnabled     = true;
                }

                if (response.Success)
                {
                    MainWindow.SuccessMessage = ((string)Application.Current.FindResource("Podaci_su_uspešno_sačuvaniUzvičnik"));
                    SubmitButtonContent       = ((string)Application.Current.FindResource("Proknjiži"));
                    SubmitButtonEnabled       = true;

                    new ShipmentSQLiteRepository().Sync(ShipmentService);

                    ShipmentCreatedUpdated();

                    Application.Current.Dispatcher.BeginInvoke(
                        System.Windows.Threading.DispatcherPriority.Normal,
                        new Action(() =>
                    {
                        FlyoutHelper.CloseFlyout(this);
                    })
                        );
                }
            });
            td.IsBackground = true;
            td.Start();
        }