private void UpdateMenu_Estatus(Int32 idMenu, MenuActionTypes MenuActionType) { ENTMenu oENTMenu = new ENTMenu(); ENTResponse oENTResponse = new ENTResponse(); BPMenu oBPMenu = new BPMenu(); try { // Formulario oENTMenu.idMenu = idMenu; switch (MenuActionType) { case MenuActionTypes.DeleteMenu: oENTMenu.tiActivo = 0; break; case MenuActionTypes.ReactivateMenu: oENTMenu.tiActivo = 1; break; default: throw new Exception("Opción inválida"); } // Transacción oENTResponse = oBPMenu.UpdateMenu_Estatus(oENTMenu); // Validaciones if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); } if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); } // Actualizar datos SelectMenu(); } catch (Exception ex) { throw (ex); } }
private void SetPanel(MenuActionTypes MenuActionType, Int32 idItem = 0) { try { // Acciones comunes this.pnlAction.Visible = true; this.hddMenu.Value = idItem.ToString(); // Detalle de acción switch (MenuActionType) { case MenuActionTypes.InsertMenu: this.lblActionTitle.Text = "Nuevo Menú"; this.btnAction.Text = "Crear Menú"; break; case MenuActionTypes.UpdateMenu: this.lblActionTitle.Text = "Edición de Menú"; this.btnAction.Text = "Actualizar Menú"; SelectMenu_ForEdit(idItem); break; default: throw (new Exception("Opción inválida")); } // Foco ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "focusControl('" + this.txtActionNombre.ClientID + "');", true); } catch (Exception ex) { throw (ex); } }