Esempio n. 1
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         deshabilitar();
         limpiar();
         frmBuscaProductos frm = new frmBuscaProductos();
         frm.ShowDialog();
          u = frm.u;
         if (u != null)
         {
             textBox1.Text = u.Idproductos.ToString();
             lblId.Text = Convert.ToString(u.Idproductos);
             txtProducto.Text = u.Detalle;
             txtSesiones.Value = u.Sesiones;
             txtStock.Text = u.Stock.ToString();
             txtPrecioV.Text = u.Precioventa.ToString().Replace(',','.');
             txtPrecioC.Text = u.Preciocalculo.ToString().Replace(',', '.');
             if (u.Activo == 0)
             {
                 chkActivo.Checked = false;
                 //tabPageCargaEmpleados.BackColor = Color.LightCoral;
             }
             else if (u.Activo == 1)
             {
                 chkActivo.Checked = true;
                 //tabPageCargaEmpleados.BackColor = SystemColors.Info;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error: " + ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 private void btnBuscar_Click_1(object sender, EventArgs e)
 {
     try
     {
         frmBuscaProductos frm = new frmBuscaProductos();
         frm.ShowDialog();
         prod = frm.u;
         if (prod != null)
         {
             txtCodigo.Text = prod.Idproductos.ToString();
             txtProducto.Text = prod.Detalle;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error: " + ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         frmBuscaProductos frm = new frmBuscaProductos();
         frm.ShowDialog();
         prod = frm.u;
         if (prod != null)
         {
             txtCodigo.Text = prod.Idproductos.ToString();
             txtProducto.Text = prod.Detalle;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }