Ejemplo n.º 1
0
        private void Process()
        {
            IsBusy = true;
            if (SelectedDownPayment == null || !ConfirmDialog("Desea procesar seleccionado", "Confimar"))
            {
                UndoChanges();
                IsBusy = false;
                return;
            }
            ViewModelManager.CloseModal();
            ShowProcessLoader(this);
            AsyncHelper.DoAsync(() =>
            {
                // SelectedDownPayment.StateL = LocalStatus.Procesado;

                // issue resolved Factura consumidor final no tiene cuenta contable.
                if (serie.SeriesName == "ANC")
                {
                    SelectedDownPayment.CardCode = SelectedPartner.CardCode;
                }
                SaveChanges();

                Synchronization.Synchronize(SelectedDownPayment);
                SaveChanges();
                IsDetailsBusy = IsBusy = false;
                ForceRefresh  = true;
                RaisePropertyChanged("DownPaymentCollection");
            }, ViewModelManager.CloseProcessLoader);
        }
Ejemplo n.º 2
0
        private void Process()
        {
            if (SelectedOrder != null && ValidateDate() && ConfirmDialog("Desea procesar el Pedido", "Confimar"))
            {
                //Guardar el pedido
                SpecialOrdersHelper.AddOrder(SelectedOrder);
                SaveChanges();

                var currentOrder = SelectedOrder;
                var param        = new Dictionary <string, string>();
                param.Add("@IdSpecialOrder", selectedOrder.IdSpecialOrder.ToString());
                var data = StoredCallbackProcessor.CallDataSet("SP_INV_PEDIDOS_ES", param);
                //var report = new ReportContainer("rptPedidosEspeciales.rpt", data);

                //report.Export(currentOrder.ReportFileName);

                ShowProcessLoader(this);
                AsyncHelper.DoAsync(() =>
                {
                    Sync(currentOrder);
                    RaisePropertyChanged("SpecialOrdersCollection");
                },
                                    ViewModelManager.CloseProcessLoader);
            }
            else
            {
                UndoChanges();
            }
        }
 public override void ExecuteDoProcess()
 {
     IsBusy = true;
     ShowProcessLoader(this);
     AsyncHelper.DoAsync(CreditNoteProcessing, () =>
     {
         ViewModelManager.CloseProcessLoader();
         IsBusy       = false;
         ForceRefresh = true;
         RaisePropertyChanged("CreditNotesCollection");
     });
 }
Ejemplo n.º 4
0
 public void TryReconnect()
 {
     isTryngReconect    = true;
     HubConnection      = null;
     notificationsProxy = null;
     AsyncHelper.DoAsync(() =>
     {
         Thread.Sleep(TimeSpan.FromSeconds(10));
         ConnectTohub();
         isTryngReconect = false;
     });
 }
Ejemplo n.º 5
0
 public void ForceAlohaSync()
 {
     lock (Extensions.SyncLock)
     {
         BusyContent = string.Empty;
         AsyncHelper.DoAsync(() =>
         {
             IsRunningSync = true;
             StoredCallbackProcessor.StartAlohaSync(ignoreAsync: true);
             IsRunningSync = false;
         });
     }
 }
Ejemplo n.º 6
0
        // OVerride Process Inventory Count

        public override void ExecuteDoProcess()
        {
            IsBusy = true;

            if (!ValidateChanges())
            {
                IsBusy = false;
                return;
            }

            ViewModelManager.CloseModal();
            ShowProcessLoader(this);
            AsyncHelper.DoAsync(ProcessInventoryCount, OnCompleteProcess);
        }
        public override void ExecuteDoProcess()
        {
            IsBusy = true;
            if (!ConfirmDialog("Desea procesar los cambios", "Procesar"))
            {
                UndoChanges();
                return;
            }
            ViewModelManager.CloseModal();

            //Mostrar loader y bloquear UI
            ShowProcessLoader(this);

            AsyncHelper.DoAsync(ProcessCreditNote, ViewModelManager.CloseProcessLoader);
        }
        private void ProcessCreditNote()
        {
            IsBusy = IsDetailsBusy = true;

            if (!ConfirmDialog("Desea Procesar la Nota de Credito Seleccionada", "Procesar"))
            {
                IsBusy = IsDetailsBusy = false;
                return;
            }

            ShowProcessLoader(this);

            AsyncHelper.DoAsync(() =>
            {
                CreditNote.DocTotal = Total;
                //CreditNote.SeriesTitle = SelectedSerie.SeriesName + " " + SelectedSerie.Remark;
                CreditNote.RIN1_ClientCreditNoteDetail = CreditNoteDetailsCollection.ToList();

                if (CreditNote.IdClientCreditNoteL > 0)
                {
                    CreditNote.ModifiedDateL = DateTime.Now;
                    CreditNote.ModifiedByL   = Config.CurrentUser;
                    //CreditNote.StateL = LocalStatus.Pendiente;
                    ClientCreditNoteHelper.Update();
                    //RaisePropertyChanged("CreditNotesCollection");
                }
                else
                {
                    FillData();
                    //CreditNote.StateL = LocalStatus.Pendiente;
                    ClientCreditNoteHelper.Add(CreditNote);
                    // CreditNotesCollection.Add(CreditNote);
                }
                Synchronization.Synchronize(CreditNote);
                SaveChanges();

                IsDetailsBusy = IsBusy = false;
                RaisePropertyChanged("CreditNotesCollection");
            }, ViewModelManager.CloseProcessLoader);

            ViewModelManager.CloseModal();

            if (CreditNote.IdClientCreditNoteL == 0)
            {
                MessageBox.Show(
                    "La Nota de Crédito esta en proceso, por favor seleccione la pestaña NOTAS DE CRÉDITO para ver el detalle");
            }
        }
Ejemplo n.º 9
0
        private void NewProcess()
        {
            DownPaymentHelper.Add(SelectedDownPayment);
            IsBusy = true;
            var confirmed = ConfirmDialog("Desea guardar y procesar los Cambios", "Procesar");

            ShowProcessLoader(this);

            AsyncHelper.DoAsync(() =>
            {
                if (confirmed)
                {
                    if (SelectedDownPayment.IdDownPayment == 0)
                    {
                        // issue resolved Factura consumidor final no tiene cuenta contable.
                        if (serie.SeriesName == "ANC")
                        {
                            SelectedDownPayment.CardCode = SelectedPartner.CardCode;
                        }

                        //SelectedDownPayment.StateL = LocalStatus.Pendiente;
                        DownPaymentDetail.WhsCode  = SelectedDownPayment.WhsCode;
                        DownPaymentDetail.AcctCode = Config.DownPaymentAcc;
                        DownPaymentDetail.TaxCode  = SelectedDownPayment != null && SelectedDownPayment.Series == 31 ? Config.IVACOF : "IVACRF";
                        if (DownPaymentDetail != null && DownPaymentDetail.Price.HasValue)
                        {
                            SelectedDownPayment.DocTotal = (decimal)DownPaymentDetail.Price;
                        }
                        SelectedDownPayment.DPI1_DownPaymentDetail.Add(DownPaymentDetail);

                        SaveChanges();
                        CheckBookHelper.SetNextCheckBookNumber((int)SelectedDownPayment.Series,
                                                               Convert.ToInt32(SelectedDownPayment.NumAtCard));

                        SaveChanges();
                    }
                }
                else
                {
                    UndoChanges();
                }
                Synchronization.Synchronize(SelectedDownPayment);
                IsBusy = false;
                SaveChanges();

                RefreshItemSource();
            }, ViewModelManager.CloseProcessLoader);
        }
Ejemplo n.º 10
0
 private void SaveInventoryCount()
 {
     if (!ValidateChanges())
     {
         return;
     }
     AsyncHelper.DoAsync(() =>
     {
         IsBusy = true;
         InventoryCountHelper.AddOrUpdate(SelectedInventoryCount);
         SaveChanges();
         IsBusy = false;
         RefreshItemSource();
     });
     ViewModelManager.CloseModal();
 }
Ejemplo n.º 11
0
        public void RunEndOfDay()
        {
            EndOfDayNotifications = null;

            ViewModelManager.ShowModal(new DayToFinish(), new Thickness(350, 100, 350, 100));

            if (System.Windows.MessageBox.Show(ViewModelManager.mainWindow, "Desea Ejecutar Fin De Dia", "FIN DE DIA",
                                               System.Windows.MessageBoxButton.YesNo, MessageBoxImage.Question) ==
                MessageBoxResult.Yes)
            {
                AsyncHelper.DoAsync(RunEndOfDayAsync);
            }

            else
            {
                ViewModelManager.CloseModal();
            }
        }
Ejemplo n.º 12
0
        private void Process()
        {
            IsDetailsBusy = IsBusy = true;
            if (SalesHelper.VerifyNumAtCard(SelectedSale))
            {
                if (!ShowWarningMessage("Numero de Factura Repetido, Desea continuar de todas formas ?"))
                {
                    IsBusy = IsDetailsBusy = false;
                    return;
                }
            }

            if (SelectedSale == null || !ConfirmDialog("Desea procesar?", "Confimar"))
            {
                UndoChanges();
                IsBusy = IsDetailsBusy = false;
                return;
            }
            if (HasDownPayment && SelectedDownPayment != null)
            {
                SelectedDownPayment         = SelectedDownPayment.ForceUpdateToDataBase();
                SelectedDownPayment.IdSaleL = SelectedSale.IdSaleL;
            }
            else if (SelectedDownPayment != null)
            {
                SelectedDownPayment         = SelectedDownPayment.ForceUpdateToDataBase();
                SelectedDownPayment.IdSaleL = null;
            }

            ViewModelManager.CloseModal();
            ShowProcessLoader(this);

            AsyncHelper.DoAsync(() =>
            {
                IsBusy = IsDetailsBusy = true;
                //SelectedSale.StateL = LocalStatus.Pendiente;
                SaveChanges();
                Synchronization.Synchronize(SelectedSale);
                SaveChanges();
                RefreshItemSource();
            }, ViewModelManager.CloseProcessLoader);
        }
Ejemplo n.º 13
0
        public override void ExecuteDoProcess()
        {
            if (!ConfirmDialog("¿Desea procesar el registro?", "Procesar"))
            {
                return;
            }


            ViewModelManager.CloseModal(); // para cerrar la ventana detalles si esta abierta.

            AsyncHelper.DoAsync(() => TransferProcessing(), () =>
            {
                IsBusy = false;
                RefreshItemSource();
                if (OnUpdateNotifications != null)
                {
                    OnUpdateNotifications();
                }
            });
        }
        private void Process()
        {
            IsBusy = true;

            if (SelectedGoodsReceipt == null || !ConfirmDialog("Confirma que desea procesar", "Confimar"))
            {
                UndoChanges();
                return;
            }
            ViewModelManager.CloseModal();
            ShowProcessLoader(this);
            AsyncHelper.DoAsync(() =>
            {
                GoodsReceiptHelper.SaveNewDetailsCommand(SelectedGoodsReceipt, SelectedGroup, SelectedMovement);
                SaveChanges();
                Synchronization.Synchronize(SelectedGoodsReceipt);
                ForceRefresh = true;
                RaisePropertyChanged("GoodsReceipts");
                IsBusy = false;
            }, ViewModelManager.CloseProcessLoader);
        }
Ejemplo n.º 15
0
        private void Process()
        {
            IsDetailsBusy = IsBusy = true;

            if (!SaveDetailsChanges(forceRefreshItemsource: false))
            {
                IsDetailsBusy = IsBusy = false;
                return;
            }
            ViewModelManager.CloseModal();
            ShowProcessLoader(this);

            AsyncHelper.DoAsync(() =>
            {
                Synchronization.Synchronize(SelectedGoodsIssues);
                SaveChanges();
                ForceRefresh = true;
                RaisePropertyChanged("GoodsIssueses");
                IsDetailsBusy = IsBusy = false;
            }, ViewModelManager.CloseProcessLoader);
        }
        public override void ExecuteDoProcess()
        {
            IsBusy = true;
            if (!ConfirmDialog("¿Desea procesar el registro?", "Procesar"))
            {
                IsBusy = false;
                return;
            }

            ViewModelManager.CloseModal();
            ShowProcessLoader(this);
            AsyncHelper.DoAsync(() =>
            {
                TransferRequestProcessing();
                RefreshItemSource();
                if (OnUpdateNotifications != null)
                {
                    OnUpdateNotifications();
                }
                IsBusy = false;
            }, ViewModelManager.CloseProcessLoader);
            //ViewModelManager.CloseModal(); // para cerrar la ventana detalles si esta abierta.
        }
Ejemplo n.º 17
0
 public async Task StartAsync(CancellationToken cancellationToken)
 {
     await AsyncHelper.DoAsync(Start, cancellationToken);
 }
Ejemplo n.º 18
0
        private void NewProcess()
        {
            CurrentOperation = Operations.Process;
            var autorizacion = SalesDetailsCollection.ToList().Any(dc => dc.PriceEdited);

            if (!UserIsValid && autorizacion)
            {
                ShowUserValidatorPicker();
                return;
            }

            IsBusy = IsDetailsBusy = true;
            if (SalesHelper.VerifyNumAtCard(SelectedSale))
            {
                if (!ShowWarningMessage("Numero de Factura Repetido, Desea continuar de todas formas ?"))
                {
                    IsBusy = IsDetailsBusy = false;
                    return;
                }
            }

            if (!ConfirmDialog("Desea procesar la venta?", "procesar"))
            {
                UndoChanges();
                IsBusy = IsDetailsBusy = false;
                return;
            }
            ViewModelManager.CloseModal();
            ShowProcessLoader(this);
            AsyncHelper.DoAsync(() =>
            {
                if (!Exento && !WithHolding)
                {
                    CheckIVACOM(true);
                }
                else
                {
                    CheckIVAEXE(Exento);
                    CheckIVARET(WithHolding);
                }

                //SelectedSale.StateL = LocalStatus.Pendiente;
                SalesHelper.AddSale(SelectedSale);
                if (HasDownPayment && SelectedDownPayment != null)
                {
                    SelectedDownPayment         = SelectedDownPayment.ForceUpdateToDataBase();
                    SelectedDownPayment.IdSaleL = SelectedSale.IdSaleL;
                }
                else if (SelectedDownPayment != null)
                {
                    SelectedDownPayment.IdSaleL = null;
                }

                SaveChanges();

                CheckBookHelper.SetNextCheckBookNumber((int)SelectedSale.Series,
                                                       Convert.ToInt32(selectedSale.NumAtCard));


                Synchronization.Synchronize(SelectedSale);


                IsBusy = IsDetailsBusy = false;

                SaveChanges();
                RefreshItemSource();
            }, ViewModelManager.CloseProcessLoader);
        }
Ejemplo n.º 19
0
 public void ConnectToServer(bool wait = false)
 {
     AsyncHelper.DoAsync(() => ConnectTohub(false));
 }