コード例 #1
0
 private void Registrar()
 {
     try
     {
         if (string.IsNullOrEmpty(txtName.Text))
         {
             txtName.Focus();
             epMarca.SetError(txtName, "Campo requerido ingrese una marca");
         }
         else
         {
             MarcaEntity dato = new MarcaEntity();
             dato.IdEquipo    = (int)cboEquipo.SelectedValue;
             dato.Nombre      = txtName.Text.Trim().ToUpper();
             dato.Descripcion = txtDescription.Text;
             objMarcaController.Add(dato);
             MessageConfirmation("Datos registrados correctamente");
             Limpiar();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(string.Format("Error: {0}", ex.Message), "Error inesperado");
     }
 }