コード例 #1
0
ファイル: scatArea.aspx.cs プロジェクト: GCSoft/CEDHNL
        private void UpdateArea_Estatus(Int32 idArea, AreaActionTypes AreaActionType)
        {
            ENTArea oENTArea = new ENTArea();
            ENTResponse oENTResponse = new ENTResponse();

            BPArea oBPArea = new BPArea();

            try
            {

                // Formulario
                oENTArea.idArea = idArea;
                switch (AreaActionType)
                {
                    case AreaActionTypes.DeleteArea:
                        oENTArea.tiActivo = 0;
                        break;
                    case AreaActionTypes.ReactivateArea:
                        oENTArea.tiActivo = 1;
                        break;
                    default:
                        throw new Exception("Opción inválida");
                }

                // Transacción
                oENTResponse = oBPArea.UpdateArea_Estatus(oENTArea);

                // Validaciones
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

                // Actualizar datos
                SelectArea();

            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
コード例 #2
0
ファイル: scatArea.aspx.cs プロジェクト: GCSoft/CEDHNL
        private void SetPanel(AreaActionTypes AreaActionType, Int32 idItem = 0)
        {
            try
            {

                // Acciones comunes
                this.pnlAction.Visible = true;
                this.hddArea.Value = idItem.ToString();

                // Detalle de acción
                switch (AreaActionType)
                {
                    case AreaActionTypes.InsertArea:
                        this.lblActionTitle.Text = "Nueva Área";
                        this.btnAction.Text = "Crear Área";

                        break;

                    case AreaActionTypes.UpdateArea:
                        this.lblActionTitle.Text = "Edición de Área";
                        this.btnAction.Text = "Actualizar Área";
                        SelectArea_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);
            }
        }