Ejemplo n.º 1
0
 private void LlenarCampos()
 {
     try
     {
         Program.Evento = 1;
         Pr.Idproducto  = Program.Idproducto;
         DataTable dt  = Pr.DatosProducto();
         DataTable dt2 = Pr.DatosProveedores();
         txtDescripcion.Text       = dt.Rows[0][1].ToString();
         txtReferencia.Text        = dt.Rows[0][2].ToString();
         cbCategoria.SelectedValue = dt.Rows[0][3].ToString();
         cbMarca.SelectedValue     = dt.Rows[0][4].ToString();
         cbUnidad.SelectedValue    = dt.Rows[0][5].ToString();
         cbItbis.SelectedValue     = dt.Rows[0][6].ToString();
         txtPuntoR.Text            = dt.Rows[0][7].ToString();
         txtPuntoMax.Text          = dt.Rows[0][8].ToString();
         txtCostoC.Text            = dt.Rows[0][9].ToString();
         txtCostoP.Text            = dt.Rows[0][10].ToString();
         txtCodigoB.Text           = dt.Rows[0][11].ToString();
         for (int x = 0; x < dt2.Rows.Count; x++)
         {
             dtgProveedor.Rows.Add(dt2.Rows[x][0]);
             dtgProveedor.Rows[x].Cells[0].Value = dt2.Rows[x][0].ToString();
             dtgProveedor.Rows[x].Cells[1].Value = dt2.Rows[x][1].ToString();
         }
     }
     catch (Exception ex)
     {
         MessageBoxEx.Show(ex.Message);
     }
 }