Beispiel #1
0
        private void iniciarsesion()
        {
            using (espera_datos.splash_espera es = new espera_datos.splash_espera())
            {
                es.Funcion_recargar = conexion_validacion;
                es.Tipo_operacion   = 1;
                if (es.ShowDialog() == DialogResult.OK)
                {
                    if (es.Datos.Rows.Count == 1)
                    {
                        MessageBox.Show("Bienvenido al sistema " + es.Datos.Rows[0][1].ToString());
                        sessionManager.secion sesion = sessionManager.secion.Instancia;

                        for (int i = 0; i < es.Datos.Columns.Count; i++)
                        {
                            sesion.Datos.Add(es.Datos.Rows[0][i].ToString());
                        }
                        cargarDatosRegistros();
                        autorizado = true;

                        Close();
                    }
                    else
                    {
                        MessageBox.Show("No hay conexión a la base de datos", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        autorizado = false;
                        txtContrase.Focus();
                        txtContrase.SelectAll();
                    }
                }
            }
        }
Beispiel #2
0
        public Boolean probando_conexion()
        {
            Boolean conexion = false;

            using (espera_datos.splash_espera es = new espera_datos.splash_espera())
            {
                es.Funcion_prueba = conectar_remota;
                es.Tipo_operacion = 3;
                if (es.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    conexion = es.Conexion_exitosa;
                }
            }

            return(conexion);
        }
        private void button2_Click(object sender, EventArgs e)
        {
            //mantenimientos.negocio.cambio_precios cp = new mantenimientos.negocio.cambio_precios();
            //cp.ShowDialog();

            using (espera_datos.splash_espera fe = new espera_datos.splash_espera())
            {
                fe.Funcion = cargarDatos;


                if (fe.ShowDialog() == DialogResult.OK)
                {
                    productos.precios_productos cp = new productos.precios_productos();
                    cp.Productos = fe.Funcion()[0];
                    cp.ShowDialog();
                }
                else
                {
                    MessageBox.Show("La carga de productos a sido cancelada...");
                }
            }
        }
        private void cargarDatos()
        {
            if (tablad.Rows.Count != 0)
            {
                using (espera_datos.splash_espera fe = new espera_datos.splash_espera()) {
                    fe.Funcion = procesarDatos;

                    if (fe.ShowDialog() == DialogResult.OK)
                    {
                        List <DataTable> listas = fe.Funcion();
                        producto         pr     = new producto();

                        pr.txtCodigo.Text   = tablad.CurrentRow.Cells[1].Value.ToString();
                        pr.txtNombre.Text   = tablad.CurrentRow.Cells[2].Value.ToString();
                        pr.existencia.Value = Convert.ToDecimal(tablad.CurrentRow.Cells[6].Value.ToString());

                        pr.Idmarca     = tablad.CurrentRow.Cells[15].Value.ToString();
                        pr.Idcategoria = tablad.CurrentRow.Cells[16].Value.ToString();
                        pr.Idestante   = tablad.CurrentRow.Cells[17].Value.ToString();
                        pr.Kardex      = tablad.CurrentRow.Cells[18].Value.ToString();


                        if (!tablad.CurrentRow.Cells[19].Value.ToString().Equals(""))
                        {
                            pr.fecha.Value = Convert.ToDateTime(tablad.CurrentRow.Cells[19].Value.ToString());
                        }

                        pr.Marcas     = listas[0];
                        pr.Categorias = listas[1];
                        pr.Estantes   = listas[2];
                        pr.Mayoreo    = listas[3];
                        pr.Detalle    = listas[4];


                        pr.Idsuc_produ = tablad.CurrentRow.Cells[0].Value.ToString();
                        pr.Idproducto  = tablad.CurrentRow.Cells[14].Value.ToString();

                        pr.Utili_m = tablad.CurrentRow.Cells[20].Value.ToString();
                        pr.Utili_d = tablad.CurrentRow.Cells[21].Value.ToString();
                        pr.Pv      = tablad.CurrentRow.Cells[22].Value.ToString();
                        pr.Pc      = tablad.CurrentRow.Cells[23].Value.ToString();
                        pr.Pvm     = tablad.CurrentRow.Cells[24].Value.ToString();
                        pr.Pcm     = tablad.CurrentRow.Cells[25].Value.ToString();


                        pr.ShowDialog();

                        if (tablad.Rows.Count != 0)
                        {
                            tablad.CurrentCell = tablad.Rows[0].Cells[1];
                        }

                        if (pr.Actualiza)
                        {
                            using (espera_datos.carga_tablas es = new espera_datos.carga_tablas())
                            {
                                es.Productos = cargarDatosP;

                                if (es.ShowDialog() == DialogResult.OK)
                                {
                                    productos = es.Productos();
                                    cargarTablas();
                                    txtBusqueda.Focus();
                                }
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("La carga de productos a sido cancelada...");
                    }
                }
            }
            else
            {
                txtBusqueda.Text = "";
                txtBusqueda.Focus();
            }
        }