Пример #1
0
 protected void btnGuardar_OnClick(object sender, EventArgs e)
 {
     try
     {
         if (txtDescripcion.Text.Trim() == string.Empty)
         {
             throw new Exception("Descripcion es campo obligatorio");
         }
         if (EsAlta)
         {
             _servicioCatalogo.AgregarRegistroSistema(IdCatalogo, txtDescripcion.Text);
         }
         else
         {
             _servicioCatalogo.ActualizarRegistroSistema(IdCatalogo, txtDescripcion.Text, IdRegistro);
         }
         //_servicioCatalogo.ac
         Limpiar();
         if (OnAceptarModal != null)
         {
             OnAceptarModal();
         }
         if (!EsAlta)
         {
             btnTerminar_OnClick(btnTerminar, null);
         }
     }
     catch (Exception ex)
     {
         if (_lstError == null)
         {
             _lstError = new List <string>();
         }
         _lstError.Add(ex.Message);
         AlertaGeneral = _lstError;
     }
 }