Exemple #1
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtContacto.Text == "")
                {
                    MessageBox.Show("El campo de contacto debe de llevar informacion", "Vale de Entrega", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                if (txtConTel.Text == "")
                {
                    MessageBox.Show("El campo de contacto tel debe de llevar informacion", "Vale de Entrega", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                DataTable dt = (DataTable)cfgArticulos.DataSource;
                ValeID = InvConsultas.ValeEntrega_Guardar(Mov, MovID, UsuarioIniciado.Almacen, txtObservaciones.Text, UsuarioIniciado.Usuario, dt, txtContacto.Text, txtConTel.Text);
                MessageBox.Show("El Vale de Entrega se ha guardado con Exito", "Vale de Entrega", MessageBoxButtons.OK, MessageBoxIcon.Information);
                btnGuardar.Enabled   = false;
                pnlPrincipal.Enabled = false;
                btnImprimir.Enabled  = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ocurrio el siguiente problema: " + ex.Message, "Vale de Entrega", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         BuscarPendienteEntrega bPendiente = new BuscarPendienteEntrega();
         if (bPendiente.ShowDialog() == DialogResult.OK)
         {
             ID    = bPendiente.ID;
             Mov   = bPendiente.Mov;
             MovID = bPendiente.MovID;
             txtMovimiento.Text = Mov + " " + MovID;
             DataTable dt = InvConsultas.ValeDeEntrega_InfoCliente(ID);
             txtClienteNombre.Text   = dt.Rows[0]["Nombre"].ToString();
             txtNoCliente.Text       = dt.Rows[0]["Cliente"].ToString();
             txtCorreo.Text          = dt.Rows[0]["Correo"].ToString();
             txtTelefono.Text        = dt.Rows[0]["Telefonos"].ToString();
             cfgArticulos.DataSource = InvConsultas.ValeDeEntrega_Detalle(ID);
             Formato();
             btnGuardar.Enabled = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ocurrio el siguiente problema: " + ex.Message, "Vale Entrega", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #3
0
 private void txtCodigoDeBarras_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Enter)
         {
             InvConsultas.spAgroEntregaActualiza(UsuarioIniciado.Estacion, txtCodigoDeBarras.Text);
             cfgOriginal.DataSource            = InvConsultas.ActualizarEntregas(0, UsuarioIniciado.Estacion, Lugar, this.Modulo);
             cfgCorrectos.DataSource           = InvConsultas.ActualizarEntregas(1, UsuarioIniciado.Estacion, Lugar, this.Modulo);
             cfgIncorrectosCantidad.DataSource = InvConsultas.ActualizarEntregas(3, UsuarioIniciado.Estacion, Lugar, this.Modulo);
             cfgIncorrectos.DataSource         = InvConsultas.ActualizarEntregas(4, UsuarioIniciado.Estacion, Lugar, this.Modulo);
             DataTable dt = InvConsultas.articuloEnCB(txtCodigoDeBarras.Text);
             if (dt != null || dt.Rows.Count > 0)
             {
                 lblEscaneado.Text  = dt.Rows[0]["Articulo"].ToString();
                 lblEscaneado.Text += " - ";
                 lblEscaneado.Text += dt.Rows[0]["Descripcion"].ToString();
                 foreach (C1.Win.C1FlexGrid.Row r in cfgCorrectos.Rows)
                 {
                     if (r["Articulo"].ToString() == dt.Rows[0]["Articulo"].ToString())
                     {
                         lblEscaneado.Text += " - " + r["Cantidad"].ToString();
                     }
                 }
             }
             txtCodigoDeBarras.Text = "";
             txtCodigoDeBarras.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ocurrio el siguiente problema: " + ex.Message, "Entrega de Mercancia", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemple #4
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         InvConsultas.GuardaHistAgroEntrega(UsuarioIniciado.Estacion, this.ID);
         this.DialogResult = DialogResult.OK;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ocurrio el siguiente problema: " + ex.Message, "Entrega de Mercancia", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        private void timer_Tick(object sender, EventArgs e)
        {
            try
            {
                DataTable val = InvConsultas.ValeEntregaPendiente(Lugar, UsuarioIniciado.Almacen, "PENDIENTE", FuncionesComunes.horaInicial(DateTime.Today), split(Vales));
                if (val != null && val.Rows.Count > 0)
                {
                    VentaAEntregar va = new VentaAEntregar();
                    va.Mi_Click += new System.EventHandler(this.Entrega_Click);
                    va.ID        = val.Rows[0]["ID"].ToString();
                    va.Mov       = val.Rows[0]["Mov"].ToString();
                    va.MovID     = val.Rows[0]["MovID"].ToString();
                    va.Agente    = val.Rows[0]["Usuario"].ToString();
                    va.Cliente   = val.Rows[0]["Cliente"].ToString();
                    va.Name      = "Vale" + va.ID.ToString();
                    foreach (DataRow r in val.Rows)
                    {
                        va.Detalle += r["Cantidad"].ToString() + " - " + r["Articulo"].ToString() + ": " + r["Descripcion"].ToString() + '\n';
                    }
                    va.TopLevel = false;
                    fpContenedor.Controls.Add(va);
                    Vales.Add(va.ID.ToString());
                    va.Show();
                }

                DataTable dt = InvConsultas.PendienteDeEntrega(Lugar, UsuarioIniciado.Almacen, "POR ENTREGAR", FuncionesComunes.horaInicial(DateTime.Today), split(IDs));
                if (dt != null && dt.Rows.Count > 0)
                {
                    VentaAEntregar ve = new VentaAEntregar();
                    ve.Mi_Click += new System.EventHandler(this.Entrega_Click);
                    ve.ID        = "V" + dt.Rows[0]["ID"].ToString();
                    ve.Mov       = dt.Rows[0]["Mov"].ToString();
                    ve.MovID     = dt.Rows[0]["MovID"].ToString();
                    ve.Agente    = dt.Rows[0]["Agente"].ToString();
                    ve.Cliente   = dt.Rows[0]["Cliente"].ToString();
                    ve.Name      = ve.ID.ToString();
                    foreach (DataRow r in dt.Rows)
                    {
                        ve.Detalle += r["Cantidad"].ToString() + " - " + r["Articulo"].ToString() + ": " + r["Descripcion"].ToString() + '\n';
                    }
                    ve.TopLevel = false;
                    fpContenedor.Controls.Add(ve);
                    IDs.Add(ve.ID.ToString());
                    ve.Show();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ocurrio el siguiente problema: " + ex.Message, "Entrega de Mercancia", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemple #6
0
 private void timerEstatus_Tick(object sender, EventArgs e)
 {
     try
     {
         string estatus = InvConsultas.PendienteEntrega_Estatus(ID.ToString());
         if (estatus == "CANCELADO")
         {
             panelDegradado.ColorArriba = Color.FromArgb(233, 79, 55);
             panelDegradado.ColorAbajo  = Color.FromArgb(233, 79, 55);
         }
     }
     catch (Exception ex)
     {
     }
 }
Exemple #7
0
 private void btnEntregarTodo_Click(object sender, EventArgs e)
 {
     try
     {
         InvConsultas.EntregarTodo(UsuarioIniciado.Estacion, this.ID, this.Modulo);
         cfgOriginal.DataSource            = InvConsultas.ActualizarEntregas(0, UsuarioIniciado.Estacion, Lugar, this.Modulo);
         cfgCorrectos.DataSource           = InvConsultas.ActualizarEntregas(1, UsuarioIniciado.Estacion, Lugar, this.Modulo);
         cfgIncorrectosCantidad.DataSource = InvConsultas.ActualizarEntregas(3, UsuarioIniciado.Estacion, Lugar, this.Modulo);
         cfgIncorrectos.DataSource         = InvConsultas.ActualizarEntregas(4, UsuarioIniciado.Estacion, Lugar, this.Modulo);
         txtCodigoDeBarras.Text            = "";
         txtCodigoDeBarras.Focus();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ocurrio el siguiente problema: " + ex.Message, "Entrega de Mercancia", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 private void Entrega_Click(object sender, EventArgs e)
 {
     try
     {
         if (((VentaAEntregar)sender).Mov == "ValeEntrega")
         {
             string valeid = ((VentaAEntregar)sender).ID;
             InvConsultas.ValeEntrega_Entrega(Lugar, valeid.ToString());
             if (this.fpContenedor.Controls["Vale" + valeid] != null)
             {
                 this.fpContenedor.Controls["Vale" + valeid].Dispose();
                 this.Vales.Remove(valeid.ToString());
             }
             txtID.Text      = "V0000001";
             txtID.ForeColor = Color.Silver;
             txtID.Focus();
         }
         else
         {
             EntregaDeMercancia em = new EntregaDeMercancia();
             em.ID          = ((VentaAEntregar)sender).ID.ToString();
             em.Modulo      = "VTAS";
             em.ModuloClave = "V";
             em.Lugar       = this.Lugar;
             if (em.ShowDialog() == DialogResult.OK)
             {
                 if (this.fpContenedor.Controls[em.ID] != null)
                 {
                     this.fpContenedor.Controls[em.ID].Dispose();
                     this.IDs.Remove(em.ID);
                 }
                 txtID.Text      = "V0000001";
                 txtID.ForeColor = Color.Silver;
                 txtID.Focus();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ocurrio el siguiente problema: " + ex.Message, "Entrega de Mercancia", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemple #9
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         string FechaD = null;
         string FechaH = FuncionesComunes.horaFinal(dtpFechaH.Value);
         string Buscar = txtBuscar.Text.Replace('*', '%');
         if (chkRango.Checked)
         {
             FechaD = FuncionesComunes.horaInicial(dtpFechaD.Value);
         }
         DataTable dt = InvConsultas.BuscarPendienteEntrega(UsuarioIniciado.Almacen, Buscar, FechaD, FechaH);
         cfgPendientesEntrega.DataSource = dt;
         Formato();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ocurrio el siguiente problema: " + ex.Message, "Buscar Ventas", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #10
0
 private void EntregaDeMercancia_Load(object sender, EventArgs e)
 {
     try
     {
         InvConsultas.AgroEntregaInserta(UsuarioIniciado.Estacion, (this.ID), UsuarioIniciado.Usuario);
         DataTable Encabezado = InvConsultas.xpAgroEntregaMov(UsuarioIniciado.Estacion);
         lblID.Text                        = this.ID;
         lblMovID.Text                     = Encabezado.Rows[0]["Movimiento"].ToString() + " " + Encabezado.Rows[0]["Folio"].ToString();
         txtSituacion.Text                 = Encabezado.Rows[0]["Estatus"].ToString();
         cfgOriginal.DataSource            = InvConsultas.ActualizarEntregas(0, UsuarioIniciado.Estacion, Lugar, this.Modulo);
         cfgCorrectos.DataSource           = InvConsultas.ActualizarEntregas(1, UsuarioIniciado.Estacion, Lugar, this.Modulo);
         cfgIncorrectosCantidad.DataSource = InvConsultas.ActualizarEntregas(3, UsuarioIniciado.Estacion, Lugar, this.Modulo);
         cfgIncorrectos.DataSource         = InvConsultas.ActualizarEntregas(4, UsuarioIniciado.Estacion, Lugar, this.Modulo);
         txtCodigoDeBarras.Focus();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ocurrio el siguiente problema: " + ex.Message, "Entrega de Mercancia", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }