Пример #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            try
            {
                frmBuscaFleteros frm = new frmBuscaFleteros();
                frm.ShowDialog();
                f = frm.u;
                if (f != null)
                {
                    Acceso_BD oa   = new Acceso_BD();
                    DataTable dt   = oa.leerDatos("select count(*) as cant from ordenescarga o inner join clientes c on o.idclientes = c.idclientes inner join fleteros f on f.idfleteros = o.idfleteros inner join tiposcamion t on f.idtiposcamion = t.idtiposcamion left join empresas e on f.idempresas = e.idempresas inner join sucursales s on s.idsucursales = o.idsucursales where  o.idfleteros = '" + f.Idfleteros + "' and o.valorizado = '0' and o.anulado = '0'");
                    int       cant = 0;
                    foreach (DataRow dr in dt.Rows)
                    {
                        cant = Convert.ToInt32(dr["cant"]);
                    }
                    if (cant > 0)
                    {
                        btnOrdenFlet.Text    = "Ord.Carga Pendientes " + cant.ToString();
                        btnOrdenFlet.Enabled = true;
                    }
                    else
                    {
                        btnOrdenFlet.Text    = "";
                        btnOrdenFlet.Enabled = false;
                    }
                    lblFletero.Text             = Convert.ToString(f.Idfleteros);
                    lblEmpresa.Text             = f.Empresas.Idempresas.ToString();
                    txtEmpresa.Text             = f.Empresas.Empresa;
                    txtFletero.Text             = f.Fletero;
                    txtDomicilio.Text           = f.Direccion;
                    txtLocalidad.Text           = f.Localidad;
                    txtTelefono.Text            = f.Telefono;
                    txtCelular.Text             = f.Celular;
                    txtModelo.Text              = f.Camion;
                    cmbTipoCamion.SelectedValue = f.Tiposcamion.Idtiposcamion;
                    txtCP.Text        = f.Cp.ToString();
                    txtChapaA.Text    = f.Chapaacoplado;
                    txtChapaC.Text    = f.Chapacamion;
                    txtDocumento.Text = f.Documento.ToString();
                    dt = oa.leerDatos("SELECT SUM(DEBE-HABER) as saldo FROM ctactefleteros  WHERE idfleteros = '" + f.Idfleteros + "' and idempresas = '" + f.Empresas.Idempresas + "'");

                    foreach (DataRow dr in dt.Rows)
                    {
                        txtSaldoFlet.Text = Convert.ToString(dr["saldo"]);
                    }

                    dt = oa.leerDatos("SELECT SUM(DEBE-HABER) as saldo FROM ctactefleteros  WHERE idempresas = '" + f.Empresas.Idempresas + "'");

                    foreach (DataRow dr in dt.Rows)
                    {
                        txtSaldoEmp.Text = Convert.ToString(dr["saldo"]);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al Guardar: " + ex.Message);
            }
        }
Пример #2
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         frmBuscaFleteros frm = new frmBuscaFleteros();
         frm.ShowDialog();
         u = frm.u;
         if (u != null)
         {
             txtCliente.Text     = u.Fletero;
             txtRecibimosDe.Text = u.Fletero;
             txtEnConcepto.Text  = cmbConceptos.Text;
             buscar();
             Acceso_BD oa = new Acceso_BD();
             DataTable dt = oa.leerDatos("SELECT SUM(HABER-DEBE) as saldo FROM ctactefleteros WHERE idfleteros = '" + u.Idfleteros + "' and idempresas = '" + u.Empresas.Idempresas + "'");
             cmbemp.SelectedValue = u.Empresas.Idempresas;
             foreach (DataRow dr in dt.Rows)
             {
                 txtSaldo.Text = Convert.ToString(dr["saldo"]);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Guardar: " + ex.Message);
     }
 }
Пример #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         frmBuscaFleteros frm = new frmBuscaFleteros();
         frm.ShowDialog();
         Fleteros u = frm.u;
         if (u != null)
         {
             lblFletero.Text = Convert.ToString(u.Idfleteros);
             txtFletero.Text = u.Fletero;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Guardar: " + ex.Message);
     }
 }
Пример #4
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                frmBuscaFleteros frm = new frmBuscaFleteros();
                frm.ShowDialog();
                u = frm.u;
                if (u != null)
                {
                    Acceso_BD oa   = new Acceso_BD();
                    DataTable dt   = oa.leerDatos("select count(*) as cant from ordenescarga o inner join clientes c on o.idclientes = c.idclientes inner join fleteros f on f.idfleteros = o.idfleteros inner join tiposcamion t on f.idtiposcamion = t.idtiposcamion left join empresas e on f.idempresas = e.idempresas inner join sucursales s on s.idsucursales = o.idsucursales where  o.idfleteros = '" + u.Idfleteros + "' and o.valorizado = '0' and o.anulado = '0'");
                    int       cant = 0;
                    foreach (DataRow dr in dt.Rows)
                    {
                        cant = Convert.ToInt32(dr["cant"]);
                    }
                    if (cant > 0)
                    {
                        button5.Text    = "Ord.Carga Pendientes " + cant.ToString();
                        button5.Enabled = true;
                    }
                    else
                    {
                        button5.Text    = "";
                        button5.Enabled = false;
                    }

                    dataGridView1.Rows.Clear();
                    dataGridView2.Rows.Clear();
                    buscar1();
                    buscar(u.Empresas.Idempresas);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al Guardar: " + ex.Message);
            }
        }
Пример #5
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         deshabilitar();
         limpiar();
         frmBuscaFleteros frm = new frmBuscaFleteros();
         frm.ShowDialog();
         Fleteros u = frm.u;
         if (u != null)
         {
             txtcomentario.Text          = u.Comentario;
             lblIdFletero.Text           = Convert.ToString(u.Idfleteros);
             lblIdEmpresa.Text           = u.Empresas.Idempresas.ToString();
             txtEmpresa.Text             = u.Empresas.Empresa;
             txtCliente.Text             = u.Fletero;
             txtDomicilio.Text           = u.Direccion;
             txtLocalidad.Text           = u.Localidad;
             txtTelefono.Text            = u.Telefono;
             txtCelular.Text             = u.Celular;
             txtFax.Text                 = u.Fax;
             txtModelo.Text              = u.Camion;
             txtMail.Text                = u.Mail;
             cmbTipoCamion.SelectedValue = u.Tiposcamion.Idtiposcamion;
             txtCP.Text               = u.Cp.ToString();
             txtChapaA.Text           = u.Chapaacoplado;
             txtChapaC.Text           = u.Chapacamion;
             txtDocumento.Text        = u.Documento.ToString();
             cmbTipoIva.SelectedValue = u.TiposIVA.IdTiposIVA;
             maskedTextBox1.Text      = u.Cuit;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Guardar: " + ex.Message);
     }
 }