Example #1
0
 private void TxtRucProveedor_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == Convert.ToChar(Keys.Enter))
     {
         if (string.IsNullOrEmpty(TxtRucProveedor.Text))
         {
             MessageBox.Show("Ingrese Código del Proveedor", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             NProveedor boProducto = new NProveedor();
             EProveedor proveedor  = boProducto.Seleccionar(TxtRucProveedor.Text);
             if (string.IsNullOrEmpty(proveedor.Ruc))
             {
                 MessageBox.Show("No Existe Proveedor", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
             LblIDProveedor.Text = proveedor.ID.ToString();
             TxtRazonSocial.Text = proveedor.RazonSocial;
         }
     }
 }