Esempio n. 1
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         frmBuscaClientes frm = new frmBuscaClientes();
         frm.ShowDialog();
         u = frm.u;
         if (u != null)
         {
             txtCliente.Text     = u.Cliente;
             txtRecibimosDe.Text = u.Cliente;
             txtEnConcepto.Text  = cmbConceptos.Text;
             Acceso_BD oa = new Acceso_BD();
             DataTable dt = oa.leerDatos("SELECT SUM(HABER-DEBE) as saldo FROM CTACTECLIENTES WHERE IDCLIENTES = '" + u.Idclientes + "'");
             foreach (DataRow dr in dt.Rows)
             {
                 txtSaldo.Text = Convert.ToString(dr["saldo"]);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Guardar: " + ex.Message);
     }
 }
Esempio n. 2
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         deshabilitar();
         limpiar();
         frmBuscaClientes frm = new frmBuscaClientes();
         frm.ShowDialog();
         Clientes u = frm.u;
         if (u != null)
         {
             lblId.Text               = Convert.ToString(u.Idclientes);
             txtCliente.Text          = u.Cliente;
             txtDomicilio.Text        = u.Direccion;
             txtLocalidad.Text        = u.Localidad;
             txtTelefono.Text         = u.Telefono;
             txtCelular.Text          = u.Celular;
             txtFax.Text              = u.Fax;
             txtComentarios.Text      = u.Comentario;
             txtMail.Text             = u.Mail;
             cmbTipoIva.SelectedValue = u.TiposIVA.IdTiposIVA;
             maskedTextBox1.Text      = u.Cuit;
             txtCP.Text               = u.Cp.ToString();
             txtContacto.Text         = u.Contacto;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Guardar: " + ex.Message);
     }
 }
Esempio n. 3
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         frmBuscaClientes frm = new frmBuscaClientes();
         frm.ShowDialog();
         u = frm.u;
         if (u != null)
         {
             textBox1.Text = u.Cliente;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Buscar: " + ex.Message);
     }
 }
Esempio n. 4
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         frmBuscaClientes frm = new frmBuscaClientes();
         frm.ShowDialog();
         Clientes u = frm.u;
         if (u != null)
         {
             lblCliente.Text = Convert.ToString(u.Idclientes);
             txtCliente.Text = u.Cliente;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Guardar: " + ex.Message);
     }
 }
Esempio n. 5
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         frmBuscaClientes frm = new frmBuscaClientes();
         frm.ShowDialog();
         u = frm.u;
         if (u != null)
         {
             Acceso_BD oa   = new Acceso_BD();
             DataTable dt   = oa.leerDatos("select ifnull(count(*), 0) 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.idclientes = '" + u.Idclientes + "' 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;
             }
             lblId.Text        = Convert.ToString(u.Idclientes);
             txtCliente.Text   = u.Cliente;
             txtDomicilio.Text = u.Direccion;
             txtLocalidad.Text = u.Localidad;
             txtTelefono.Text  = u.Telefono;
             txtCelular.Text   = u.Celular;
             txtContacto.Text  = u.Contacto;
             dataGridView1.Rows.Clear();
             buscar(u.Idclientes);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Guardar: " + ex.Message);
     }
 }
Esempio n. 6
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         frmBuscaClientes frm = new frmBuscaClientes();
         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.idclientes = '" + u.Idclientes + "' and o.valorizado = '0' and o.anulado = '0'");
             string where = "where  o.idclientes = '" + u.Idclientes + "' 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)
             {
                 btnOrdenCte.Text    = "Ord.Carga Pendientes " + cant.ToString();
                 btnOrdenCte.Enabled = true;
             }
             else
             {
                 btnOrdenCte.Text    = "";
                 btnOrdenCte.Enabled = false;
             }
             lblCliente.Text      = Convert.ToString(u.Idclientes);
             lblDireccionCte.Text = u.Direccion;
             txtCliente.Text      = u.Cliente;
             dt = oa.leerDatos("SELECT SUM(DEBE-HABER) as saldo FROM CTACTECLIENTES WHERE IDCLIENTES = '" + u.Idclientes + "'");
             foreach (DataRow dr in dt.Rows)
             {
                 txtSaldoCte.Text = Convert.ToString(dr["saldo"]);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Guardar: " + ex.Message);
     }
 }