Пример #1
0
 //Realiza la validacion y guarda cambios
 private void btnAplicarCambios_Click(object sender, EventArgs e)
 {
     if (IsValidateBusinessRules)
     {
         try
         {
             UpdateCorporateCRUD updateCRUD = FillUpdateCorporate();
             UpdateCoporateCRUDBL.UpdateCorporateCRUD(updateCRUD);
             MessageBox.Show(Resources.Constants.CAMBIOS_SOLICITADOS_SATISFACTORIOS, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
             ClearControls();
         }
         catch (Exception ex)
         {
             MessageBox.Show(Resources.Constants.HA_OCURRIDO_ERROR_MODIFICA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
Пример #2
0
 //Realizar cada una de las reglas en especifico
 private void Commands()
 {
     if (optionSelected == Resources.Constants.CORPORATE_CRUD_HIGH)
     {
         if (IsValidateExistDK)
         {
             MessageBox.Show(Resources.Constants.YA_EXISTE_DK, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
             txtDKPrincipal.Focus();
         }
         else if (!IsValidateExistDK)
         {
             try
             {
                 AddCorporateCRUD corporateCRUD = FillCorporateCRUD();
                 AddCorporateCRUDBL.AddCorporateCRUD(corporateCRUD);
                 MessageBox.Show(Resources.Constants.CORPORATIVO_REGISTRADO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                 ClearControls();
             }
             catch (Exception ex)
             {
                 MessageBox.Show(Resources.Constants.HUBO_UN_ERROR_AL_INGRESAR_DATOS, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     else if (optionSelected == Resources.Constants.CORPORATE_CRUD_MODIFICATION)
     {
         if (rdoBuscar.Checked)
         {
             if (IsValidateExistDK)
             {
                 SeeInformation();
                 txtDKPrincipal.Focus();
             }
         }
         else if (rdoModificar.Checked)
         {
             if (IsValidateBusinessRules)
             {
                 try
                 {
                     UpdateCorporateCRUD updateCRUD = FillUpdateCorporate();
                     UpdateCoporateCRUDBL.UpdateCorporateCRUD(updateCRUD);
                     MessageBox.Show(Resources.Constants.CAMBIOS_SOLICITADOS_SATISFACTORIOS, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                     ClearControls();
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show(Resources.Constants.HA_OCURRIDO_ERROR_MODIFICA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
         }
     }
     else if (optionSelected == Resources.Constants.CORPORAT_CRUD_DROP)
     {
         if (rdoBuscar.Checked)
         {
             if (IsValidateExistDK)
             {
                 SeeInformation();
             }
         }
         else if (rdoModificar.Checked)
         {
             DialogResult result = MessageBox.Show(Resources.Constants.MENSAJE_EMILINACION, Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
             if (result == DialogResult.Yes)
             {
                 try
                 {
                     AddToolOnlineRulesDelete deleteRules = FillDeleteCorporate();
                     AddToolOnlineRulesDeleteBL.AddCorporateDelete(deleteRules);
                     DeleteToolOnlineRulesBL.DeleteToolOnlineRules(attribute1);
                     MessageBox.Show(Resources.Constants.ELIMINACION_SOLICITADA_SATISFACTORIA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                     ClearControls();
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show(Resources.Constants.HA_CORRUDIO_UN_ERRO_ELIMINAR, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
         }
     }
 }