コード例 #1
0
 public Boolean verificarTipoImplemento(String pTipoImplemento)
 {
     try
     {
         cSGGITIPOIMPLEMENTONegocios TipoImplementoIngresado = new cSGGITIPOIMPLEMENTONegocios(Global.gCOD_APLICACION, "CA", 2, "cosejo");
         TipoImplementoIngresado.NOM_TIPOIMPLEMENTO = TextBoxImplementoNuevo.Text;
         DataTable busqueda = TipoImplementoIngresado.Buscar();
         if (busqueda.Rows.Count > 0)
         {
             IdTipoImplemento = Int32.Parse(busqueda.Rows[0][0].ToString());
             return true;
         }
         else
         {
             IdTipoImplemento = -1;
             return false;
         }
     }
     catch (Exception ex)
     {
         return false;
     }
 }
コード例 #2
0
 private void obtenerTiposImplementos()
 {
     try
     {
         cSGGITIPOIMPLEMENTONegocios TipoImplemento = new cSGGITIPOIMPLEMENTONegocios(Global.gCOD_APLICACION, "CA", 2, "cosejo");
         DT_TipoImplementos = new DataTable();
         DT_TipoImplementos = TipoImplemento.SeleccionarTodos();
         llenarComboBoxTipoImplemento();
     }
     catch (Exception ex)
     {
         Page.ClientScript.RegisterStartupScript(this.GetType(), "alerta4", "<script type=\"text/javascript\"> alert(" + "'" + ex.Message + "'" + ");</script>");
     }
 }
コード例 #3
0
 private Boolean agregarTipoImplemento()
 {
     try
     {
         cSGGITIPOIMPLEMENTONegocios TipoImplementoIngresado = new cSGGITIPOIMPLEMENTONegocios(Global.gCOD_APLICACION, "CA", 2, "cosejo");
         TipoImplementoIngresado.NOM_TIPOIMPLEMENTO = TextBoxImplementoNuevo.Text;
         if (!verificarTipoImplemento(TextBoxImplementoNuevo.Text))
         {
             return TipoImplementoIngresado.Insertar();
         }
         throw new Exception("El Nombre digitado ya se encuentra dentro del sistema");
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }