Exemplo n.º 1
0
        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);
                }
            }
        }