protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            string          Mode = Request.QueryString["Mode"].ToString();
            OperationResult objOperationResult = new OperationResult();

            if (Mode == "New")
            {
                // Create the entity
                attentioninareaDto objEntity = new attentioninareaDto();

                // Populate the entity
                objEntity.v_Name         = txtName.Text.Trim().ToUpper();
                objEntity.v_OfficeNumber = txtOfficeNumber.Text.Trim().ToUpper();

                // Save the data
                AttentionInAreaId = _objNodeBL.AddAttentionInAreaByNode(ref objOperationResult, objEntity, InsertAttentionAreaComponent(), ((ClientSession)Session["objClientSession"]).GetAsList());
            }
            else if (Mode == "Edit")
            {
                // Obtener el usuario autenticado
                int intUserPersonId = ((ClientSession)Session["objClientSession"]).i_SystemUserId;

                // Get the entity from the session
                attentioninareaDto objEntity = (attentioninareaDto)Session["objEntity"];

                // Populate the entity
                objEntity.v_Name         = txtName.Text.Trim().ToUpper();
                objEntity.v_OfficeNumber = txtOfficeNumber.Text.Trim().ToUpper();

                var objAddAttentionAreaComponentList    = UpdateAttentionAreaComponent();
                var objDeleteAttentionAreaComponentList = DeleteAttentionAreaComponent();

                // Save the data
                _objNodeBL.UpdateAttentionInAreaByNode(ref objOperationResult, objEntity, objAddAttentionAreaComponentList, objDeleteAttentionAreaComponentList, ((attentioninareaDto)Session["objEntity"]).v_AttentionInAreaId, ((ClientSession)Session["objClientSession"]).GetAsList());
            }

            //Analizar el resultado de la operación
            if (objOperationResult.Success == 1)  // Operación sin error
            {
                // Cerrar página actual y hacer postback en el padre para actualizar
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else  // Operación con error
            {
                Alert.ShowInTop("Error en operación:" + System.Environment.NewLine + objOperationResult.ExceptionMessage);
                // Se queda en el formulario.
            }
        }
        private void LoadData()
        {
            OperationResult objOperationResult = new OperationResult();
            //Llenado de combos
            Utils UtilComboBox = new Utils();
            //Utils.LoadDropDownList(ddlComponentId, "Value1", "Id", BLL.Utils.GetComponents(ref objOperationResult), DropDownListAction.Select);

            string Mode = Request.QueryString["Mode"].ToString();
            string AttentionInAreaId = "";

            if (Request.QueryString["v_AttentionInAreaId"] != null)
            {
                AttentionInAreaId = Request.QueryString["v_AttentionInAreaId"].ToString();
            }

            LoadTreeView();
            if (Mode == "New")
            {
                txtName.Text         = "";
                txtOfficeNumber.Text = "";
                //ddlComponentId.SelectedValue = "-1";
            }
            else if (Mode == "Edit")
            {
                // Get the Entity Data
                attentioninareaDto objEntity = _objNodeBL.GetAttentionInAreaByNode(ref objOperationResult, AttentionInAreaId);

                // Save the entity on the session
                Session["objEntity"] = objEntity;

                // Show the data on the form
                txtName.Text         = objEntity.v_Name;
                txtOfficeNumber.Text = objEntity.v_OfficeNumber;

                var x = Sigesoft.Server.WebClientAdmin.BLL.Utils.GetComponentsByAttentionInArea(ref objOperationResult, AttentionInAreaId);

                foreach (var item in x)
                {
                    SearchNode(tvComponent.Nodes, item.Id, true);
                }
            }
        }