コード例 #1
0
        private void MetroWindow_Loaded(object sender, RoutedEventArgs e)
        {
            Dat_Basico.GetFechaServer();
            DateTime fecha_actual = DateTime.Today;

            calfecha.SelectedDate = fecha_actual;

            txtmonto.Focus();
        }
コード例 #2
0
        private void inicia_modulo(string _server, string _base, string _user, string _password, ref Boolean _ini)
        {
            try
            {
                Ent_Conexion._Base_Datos = _base;
                Ent_Conexion._server     = _server;
                Ent_Conexion._user       = _user;
                Ent_Conexion._password   = _password;

                string _error = "";
                //Basico.copiar_archivo_config(ref _error);
                if (_error.Length > 0)
                {
                    MessageBox.Show(_error + "==>> CONSULTE CON SISTEMA ACERCA DEL ERROR....", Ent_Msg.msginfomacion, MessageBoxButton.OK, MessageBoxImage.Exclamation);
                }



                //string _entorno = "AQHIG1";
                string _entorno = "";
                //Ent_Global._session_activa = true;
                //Ent_Usuario user = new Ent_Usuario();
                //Ent_Global._usuario_var = "david";
                if (Environment.GetEnvironmentVariable("aq") != null)
                {
                    _entorno = Environment.GetEnvironmentVariable("aq");
                }

                //_entorno = "AQCH3";
                Ent_Global._nombre_entorno = _entorno;
                Boolean inicio_config = Dat_Acceso.getpunto_vta(_entorno);

                // Dat_Acceso.getSalesCoorByMonthPctg();

                _ini = inicio_config;
                if (!inicio_config)
                {
                    //btnaquarella.IsEnabled = false;
                    lblconfig.Content = "!El Entorno del sistema no esta configurado correctamente ó la conexion esta cerrada";
                }
                else
                {
                    /*en este caso vamos a capturar los datos para la WS de paperless*/
                    Dat_Basico.config_ws_fe();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #3
0
        private async void btnaceptar_Click(object sender, RoutedEventArgs e)
        {
            this.MetroDialogOptions.ColorScheme = MetroDialogOptions.ColorScheme;
            DateTime fecha_select = calfecha.SelectedDate.Value;
            decimal  _monto       = Convert.ToDecimal(txtmonto.Text);
            var      mySettings   = new MetroDialogSettings()
            {
                AffirmativeButtonText = "Si",
                NegativeButtonText    = "No",
                //FirstAuxiliaryButtonText = "Cancelar",
                ColorScheme = MetroDialogOptions.ColorScheme,
            };


            if (fecha_select != Ent_Global._fecha_server)
            {
                await this.ShowMessageAsync(Ent_Msg.msginfomacion, "La fecha seleccionada no puede ser diferente a la fecha del servidor de aquarella.", MessageDialogStyle.Affirmative, this.MetroDialogOptions);
            }
            else
            {
                MessageDialogResult result = await this.ShowMessageAsync(Ent_Msg.msginfomacion, "Esta seguro de iniciar el dia de venta",
                                                                         MessageDialogStyle.AffirmativeAndNegative, mySettings);

                if (result == MessageDialogResult.Affirmative)
                {
                    Dat_Basico updatecierre = new Dat_Basico();
                    Boolean    _valida      = updatecierre.update_cierre_venta(1, fecha_select, _monto, "", "", 0);
                    if (_valida)
                    {
                        Dat_Basico.VerificaFechaServer_Cierre();
                        Dat_Basico.VerificaCierreVenta();
                        await this.ShowMessageAsync(Ent_Msg.msginfomacion, "Ya puedes realizar la venta.", MessageDialogStyle.Affirmative, this.MetroDialogOptions);

                        this.Close();
                    }
                    else
                    {
                        await this.ShowMessageAsync(Ent_Msg.msginfomacion, "!Hubo un problema al momento de la incializacion de venta, por favor consulte con sistemas.", MessageDialogStyle.Affirmative, this.MetroDialogOptions);
                    }
                }
            }
        }
コード例 #4
0
        private async void btnaceptar_Click(object sender, RoutedEventArgs e)
        {
            Mouse.OverrideCursor = Cursors.Wait;
            Boolean chkfin = chkcierre.IsChecked.Value;

            if (chkfin)
            {
                if (get_cierre.total_efectivo > 0)
                {
                    string  _ban_id     = dwbanco.EditValue.ToString();
                    string  _ope        = txtoperacion.Text.ToString();
                    decimal _monto_edit = Convert.ToDecimal(txtmonto.Text);

                    if (_ban_id == "-1")
                    {
                        await this.ShowMessageAsync(Ent_Msg.msginfomacion, "Debe de seleccionar el banco del deposito.", MessageDialogStyle.Affirmative, this.MetroDialogOptions);

                        dwbanco.Focus();
                        Mouse.OverrideCursor = null;
                        return;
                    }
                    if (_ope.Length == 0)
                    {
                        await this.ShowMessageAsync(Ent_Msg.msginfomacion, "Ingrese el numero de operacion.", MessageDialogStyle.Affirmative, this.MetroDialogOptions);

                        txtoperacion.Focus();
                        Mouse.OverrideCursor = null;
                        return;
                    }

                    if (_monto_edit == 0)
                    {
                        await this.ShowMessageAsync(Ent_Msg.msginfomacion, "Ingrese el monto de la operacion.", MessageDialogStyle.Affirmative, this.MetroDialogOptions);

                        txtmonto.Focus();
                        Mouse.OverrideCursor = null;
                        return;
                    }
                }
            }


            string mensaje = (chkfin) ? "Esta seguro de realizar el cierre de dia" : "Solo se va imprimir el cierre y no se cerrara el dia de venta";

            this.MetroDialogOptions.ColorScheme = MetroDialogOptions.ColorScheme;

            var mySettings = new MetroDialogSettings()
            {
                AffirmativeButtonText = "Si",
                NegativeButtonText    = "No",
                //FirstAuxiliaryButtonText = "Cancelar",
                ColorScheme = MetroDialogOptions.ColorScheme,
            };

            MessageDialogResult result = await this.ShowMessageAsync(Ent_Msg.msginfomacion, mensaje,
                                                                     MessageDialogStyle.AffirmativeAndNegative, mySettings);

            if (result == MessageDialogResult.Affirmative)
            {
                if (chkfin)
                {
                    string     _ban_id      = dwbanco.EditValue.ToString();
                    string     _nroope      = txtoperacion.Text;
                    Decimal    _monto_op    = Convert.ToDecimal(txtmonto.Text);
                    Dat_Basico updatecierre = new Dat_Basico();
                    Boolean    _valida      = updatecierre.update_cierre_venta(2, Ent_Global._fecha_cierre_ult, 0, _ban_id, _nroope, _monto_op);
                    if (_valida)
                    {
                        ImprimirCierre.Generar_Impresion_Cierre(Ent_Global._fecha_cierre_ult);
                        Dat_Basico.VerificaFechaServer_Cierre();
                        Dat_Basico.VerificaCierreVenta();
                        await this.ShowMessageAsync(Ent_Msg.msginfomacion, "Se Realizo el cierre de venta.", MessageDialogStyle.Affirmative, this.MetroDialogOptions);

                        Mouse.OverrideCursor = null;
                        this.Close();
                    }
                    else
                    {
                        await this.ShowMessageAsync(Ent_Msg.msginfomacion, "!Hubo un problema al momento de cerrar la venta, por favor consulte con sistemas.", MessageDialogStyle.Affirmative, this.MetroDialogOptions);
                    }
                }
                else
                {
                    string _imprime = ImprimirCierre.Generar_Impresion_Cierre(Ent_Global._fecha_cierre_ult);
                    if (_imprime != "ok")
                    {
                        await this.ShowMessageAsync(Ent_Msg.msginfomacion, "Hubo un problema con la impresion.", MessageDialogStyle.Affirmative, this.MetroDialogOptions);
                    }
                }
            }
            Mouse.OverrideCursor = null;
        }
コード例 #5
0
        private LoginForm _loginwindow;     //declaracion de objeto form



        public OpcionesMenu()
        {
            InitializeComponent();

            //if (Ent_Global._pvt_nombre == null) return;

            //DataContext = new MainViewModel();
            //MainViewModel._principal = this;
            lblnom_modulo.Content = "{" + Ent_Global._nom_modulo.ToString() + "}";
            //lblusuario.Content = Ent_Usuario.var_usuario._usu_nombres;

            lblhora.Content = DateTime.Now.ToLongTimeString();//Doy la hora actual al reloj

            if (!Ent_Global._err_con_mysql)
            {
                lblconexion_presta.Visibility = Visibility.Hidden;
            }

            //Actualiza reloj
            DispatcherTimer dispatcherTimer = new DispatcherTimer();

            dispatcherTimer.Tick    += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
            dispatcherTimer.Start();

            DateTime myDt     = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Unspecified); //obtiene datos fecha/hora
            string   dtString = myDt.ToString(@"dd/MM/yyyy");                                 //formato a entregar

            lblfecha.Content = dtString;
            this.Title       = "PAGINA PRINCIPAL [" + Ent_Global._nom_modulo + "]";

            this.lblalmacen.Content = Ent_Global._pvt_nombre.ToString().ToUpper();


            if (Ent_Global._pvt_directo)
            {
                Dat_Basico.VerificaFechaServer_Cierre();
                lbliniciov.Visibility = Visibility.Visible;
                lblfinalv.Visibility  = Visibility.Visible;
                btninicia.Visibility  = Visibility.Visible;
                btnfinal.Visibility   = Visibility.Visible;
                btnfinal.IsEnabled    = false;

                //this.btndup.IsEnabled = false;
                this.lblfac.Content = "Facturacion";
                // this.btndup.Visibility =Visibility.Hidden;
                this.lbldupl.Content = "Consultas Cierres de Venta";
                //this.lin1.Width = 321;
                //this.lbldupl.Visibility = Visibility.Hidden;
                Dat_Basico.VerificaCierreVenta();
            }
            //-----INICIO---SB-VTEX2020---20201222_12:57--
            else
            {
                if (Ent_Global._canal_venta != "AQ" && Ent_Global._canal_venta != "MV")
                {
                    this.imgpackage.Source = new BitmapImage(new Uri(@"/Integrado;component/Design/Images/Vtex.png", UriKind.Relative));
                    btnrep.Visibility      = Visibility.Visible;
                    lblrep.Visibility      = Visibility.Visible;
                    lblfac.Content         = "Empaque de pedidos facturados";
                }
                else
                {
                    btnrep.Visibility = Visibility.Hidden;
                    lblrep.Visibility = Visibility.Hidden;
                }
            }  //-----FIN---SB-VTEX2020---20201222_12:57----
            DispatcherTimer dispatcherTimerE = new DispatcherTimer();
            DispatcherTimer dispatcherTimerU = new DispatcherTimer();

            DispatcherTimer dispatcherTimerAQ = new DispatcherTimer();

            /* Reporte de Listado de Pedidos Pendientes */
            //-----INICIO---SB-VTEX2020---20201222_12:57--
            //btnrep.Visibility = Visibility.Hidden;
            //lblrep.Visibility = Visibility.Hidden;
            //-----FIN---SB-VTEX2020---20201222_12:57--
            if (Ent_Global._canal_venta != "AQ" && Ent_Global._canal_venta != "MV")
            {
                dispatcherTimerE.Tick    += new EventHandler(dispatcherTimerE_Tick);
                dispatcherTimerE.Interval = new TimeSpan(0, 0, 20);
                dispatcherTimerE.Start();

                /*PROCESO PARA URBANO HACIA PRESTASHOP*/
                dispatcherTimerU.Tick    += new EventHandler(dispatcherTimerU_Tick);
                dispatcherTimerU.Interval = new TimeSpan(0, 3, 0);
                dispatcherTimerU.Start();

                /* Reporte de Listado de Pedidos Pendientes */
                //-----INICIO---SB-VTEX2020---20201222_12:57--
                //btnrep.Visibility = Visibility.Visible;
                //lblrep.Visibility = Visibility.Visible;
                //-----FIN---SB-VTEX2020---20201222_12:57--
            }

            if (Ent_Global._canal_venta == "AQ" || Ent_Global._canal_venta == "MV")
            {
                dispatcherTimerAQ.Tick    += new EventHandler(dispatcherTimerAQ_Tick);
                dispatcherTimerAQ.Interval = new TimeSpan(0, 0, 20);
                dispatcherTimerAQ.Start();
            }
        }