Example #1
0
    protected void btnAddBranch_Click(object sender, EventArgs e)
    {
        Telerik.Web.UI.RadTreeNode n = new Telerik.Web.UI.RadTreeNode();
        n.Text = txtCaptionEdit.Text;
        if (rtvLayers.Nodes.Count == 0)
        {
            n.Value = poi_Layers_INSERT(0, txtCaptionEdit.Text).ToString();
            rtvLayers.Nodes.Add(n);
        }
        else
        {
            if (rtvLayers.SelectedNode != null)
            {
                if (rtvLayers.SelectedNode.ParentNode != null)
                {
                    n.Value = poi_Layers_INSERT(int.Parse(rtvLayers.SelectedNode.ParentNode.Value), txtCaptionEdit.Text).ToString();
                    rtvLayers.SelectedNode.ParentNode.Nodes.Add(n);
                }
                else
                {

                }

            }
        }
    }
        private Int32 FilterNodeState(String forNodeValue)
        {
            Telerik.Web.UI.RadTreeView filterTreeView = (Telerik.Web.UI.RadTreeView)BasicFiltersSelection.Items[0].FindControl("BasicFiltersTreeView");

            if (filterTreeView == null)
            {
                return(1);
            }


            Int32 filterState = 1;

            Telerik.Web.UI.RadTreeNode filterNode;

            filterNode = filterTreeView.FindNodeByValue(forNodeValue);


            if (filterNode.Nodes.Count == 2)
            {
                Telerik.Web.UI.RadTreeNode filterValue1 = filterNode.Nodes[0];

                Telerik.Web.UI.RadTreeNode filterValue2 = filterNode.Nodes[1];

                filterState = Convert.ToInt32(filterValue1.Checked) + Convert.ToInt32(filterValue2.Checked);
            }

            else
            {
                filterState = Convert.ToInt32(filterNode.Checked);
            }


            return(filterState);
        }
Example #3
0
        private void FormExplorerTree_Refresh()
        {
            foreach (Client.Core.Forms.Control currentControl in EditorForm.GetAllControls())
            {
                Telerik.Web.UI.RadTreeNode controlNode = FormExplorerTree.FindNodeByValue(currentControl.ControlId.ToString());

                if (controlNode != null)
                {
                    String nodeText = currentControl.Name;

                    if ((currentControl.ReadOnly) || (!currentControl.Visible) || (currentControl.Required))
                    {
                        if (currentControl.Required)
                        {
                            nodeText = nodeText + " { Required }";
                        }

                        if (currentControl.ReadOnly)
                        {
                            nodeText = nodeText + " { Read Only }";
                        }

                        if (!currentControl.Visible)
                        {
                            nodeText = nodeText + " { Not Visible }";
                        }
                    }

                    controlNode.Text = nodeText;
                }
            }

            return;
        }
        private void DoArticleEdit(MainDataSet.ArticleRow articleRow)
        {
            ShowArticleEdit();
            TreeViewParentArticle.Nodes.Clear();
            TreeViewParentArticle.Nodes.Add(new Telerik.Web.UI.RadTreeNode("                                                                                                                                                                                                          ", string.Empty));
            TreeViewParentArticle.DataBind();

            CustomLinksDataBind(UserContext.Current.SelectedInstance.InstanceId);

            if (articleRow != null)
            {
                HtmlEditorBody.ImageManager.ViewPaths = new string[] { articleRow.ArticleGuid.ToString("N") };
                HtmlEditorBody.ImageManager.ContentProviderTypeName = typeof(Micajah.FileService.Providers.ImageDBContentProvider).AssemblyQualifiedName;
                HtmlEditorBody.MediaManager.ViewPaths = new string[] { articleRow.ArticleGuid.ToString("N") };
                HtmlEditorBody.MediaManager.ContentProviderTypeName = typeof(Micajah.FileService.Providers.VideoDBContentProvider).AssemblyQualifiedName;
                HtmlEditorBody.FlashManager.ViewPaths = new string[] { articleRow.ArticleGuid.ToString("N") };
                HtmlEditorBody.FlashManager.ContentProviderTypeName    = typeof(Micajah.FileService.Providers.FlashDBContentProvider).AssemblyQualifiedName;
                HtmlEditorBody.DocumentManager.ViewPaths               = new string[] { articleRow.ArticleGuid.ToString("N") };
                HtmlEditorBody.DocumentManager.ContentProviderTypeName = typeof(Micajah.FileService.Providers.FileDBContentProvider).AssemblyQualifiedName;
                HtmlEditorBody.Content = this.ArticleTableAdapter.GetBody(articleRow.ArticleGuid);

                ImageAdminListCtrl.ArticleGuid = articleRow.ArticleGuid;
                FileAdminListCtrl.ArticleGuid  = articleRow.ArticleGuid;
                ImageAdminListCtrl.DataBind();
                FileAdminListCtrl.DataBind();

                Master.CustomName             = articleRow.Subject;
                TextBoxSubject.Text           = articleRow.Subject;
                SearchDescriptionTextBox.Text = articleRow.SearchDesc;
                if (!articleRow.IsParentArticleGuidNull())
                {
                    Telerik.Web.UI.RadTreeNode node = TreeViewParentArticle.FindNodeByValue(articleRow.ParentArticleGuid.ToString());
                    if (node != null)
                    {
                        node.Selected = true;
                        node.ExpandParentNodes();
                    }
                }
                if (articleRow.Type == ArticleType.Request.ToString())
                {
                    TextBoxAlternateIds.Text = articleRow.Subject;
                }
                else
                {
                    using (MainDataSetTableAdapters.AlternateIdTableAdapter altAdapter = new MainDataSetTableAdapters.AlternateIdTableAdapter())
                    {
                        TextBoxAlternateIds.Text = string.Empty;
                        MainDataSet.AlternateIdDataTable dtAlt = altAdapter.GetDataByArticleGuid(articleRow.ArticleGuid);
                        foreach (MainDataSet.AlternateIdRow row in dtAlt)
                        {
                            TextBoxAlternateIds.Text += row.AlternateId + Environment.NewLine;
                        }
                    }
                }
            }
            else
            {
                Master.CustomName = (string)this.GetLocalResourceObject("AddNewArticle");
            }
        }
        protected void BasicFiltersTreeView_OnNodeCheck(Object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
        {
            Telerik.Web.UI.RadTreeNode filterNode = e.Node;

            Telerik.Web.UI.RadTreeView filterTreeView = (Telerik.Web.UI.RadTreeView)BasicFiltersSelection.Items[0].FindControl("BasicFiltersTreeView");

            if (filterTreeView == null)
            {
                return;
            }

            if (filterNode.Value.Contains("Value"))
            {
                return;
            }


            if (filterNode.Nodes.Count == 2)
            {
                Telerik.Web.UI.RadTreeNode filterValue1 = filterNode.Nodes[0];

                Telerik.Web.UI.RadTreeNode filterValue2 = filterNode.Nodes[1];

                Int32 filterState = Convert.ToInt32(filterValue1.Checked) + Convert.ToInt32(filterValue2.Checked);


                switch ((filterState + 1))
                {
                case 1:      // MOVE FROM NO SELECTED TO INDETERMINATE

                    filterTreeView.FindNodeByValue(filterValue1.Value).Checked = true;

                    filterTreeView.FindNodeByValue(filterValue2.Value).Checked = false;

                    break;

                case 2:      // MOVE FROM INDETERMINATE TO SELECTED

                    filterTreeView.FindNodeByValue(filterValue1.Value).Checked = true;

                    filterTreeView.FindNodeByValue(filterValue2.Value).Checked = true;

                    break;

                case 3:      // MOVE FROM SELECTED TO UNSELECTED

                    filterTreeView.FindNodeByValue(filterValue1.Value).Checked = false;

                    filterTreeView.FindNodeByValue(filterValue2.Value).Checked = false;

                    break;
                }
            }

            WorkQueueItemsGrid.Rebind();

            return;
        }
Example #6
0
        private void FormControlPropertiesGrid_Refresh()
        {
            Telerik.Web.UI.RadTreeNode activeNode = FormExplorerTree.SelectedNode;

            System.Data.DataTable propertiesTable = new System.Data.DataTable();

            propertiesTable.Columns.Add("Name");

            propertiesTable.Columns.Add("Value");

            propertiesTable.Columns.Add("Type");

            if (activeNode != null)
            {
                Client.Core.Forms.Control selectedControl = EditorForm.FindControlById(new Guid(activeNode.Value));

                if (selectedControl != null)
                {
                    foreach (System.Reflection.PropertyInfo currentPropertyInfo in selectedControl.GetType().GetProperties())
                    {
                        propertiesTable.Rows.Add(

                            currentPropertyInfo.Name,

                            (currentPropertyInfo.CanRead) ?

                            ((currentPropertyInfo.GetValue(selectedControl, null) != null) ?  currentPropertyInfo.GetValue(selectedControl, null).ToString() : "null")

                                : " < complex type >",

                            currentPropertyInfo.PropertyType.ToString()

                            );
                    }
                }
            }

            FormControlPropertiesGrid.DataSource = propertiesTable;

            FormControlPropertiesGrid.AutoGenerateColumns = true;

            Telerik.Web.UI.GridSortExpression propertiesSort = new Telerik.Web.UI.GridSortExpression();

            propertiesSort.FieldName = "Name";

            propertiesSort.SortOrder = Telerik.Web.UI.GridSortOrder.Ascending;

            FormControlPropertiesGrid.MasterTableView.SortExpressions.Clear();

            FormControlPropertiesGrid.MasterTableView.SortExpressions.Add(propertiesSort);

            FormControlPropertiesGrid.Rebind();

            return;
        }
        private void RadTreeView_MakeVisibleToNode(Telerik.Web.UI.RadTreeNode forNode)
        {
            forNode.Visible = true;

            if (forNode.ParentNode != null)
            {
                RadTreeView_MakeVisibleToNode(forNode.ParentNode);
            }

            return;
        }
        private void RadTreeView_ExpandToNode(Telerik.Web.UI.RadTreeNode forNode)
        {
            forNode.Expanded = true;

            if (forNode.ParentNode != null)
            {
                RadTreeView_ExpandToNode(forNode.ParentNode);
            }

            return;
        }
Example #9
0
        private void FillTreeView(Guid?SelectedMetricCategoryId, bool ClearText)
        {
            if (ClearText)
            {
                ddlMetricCategory.Text = string.Empty;
            }
            Telerik.Web.UI.RadTreeView tvMetricCategorys = (Telerik.Web.UI.RadTreeView)ddlMetricCategory.Items[0].FindControl("tvMetricCategorys");

            if (!IsFilled)
            {
                tvMetricCategorys.DataSource        = GetDataSource();
                tvMetricCategorys.DataTextField     = "Name";
                tvMetricCategorys.DataFieldParentID = "ParentId";
                tvMetricCategorys.DataValueField    = "MetricCategoryID";
                tvMetricCategorys.DataFieldID       = "MetricCategoryID";
                tvMetricCategorys.DataBind();
            }

            System.Collections.Generic.IList <Telerik.Web.UI.RadTreeNode> AllNodes = tvMetricCategorys.GetAllNodes();
            foreach (Telerik.Web.UI.RadTreeNode node in AllNodes)
            {
                string FullPath = node.Text;
                Telerik.Web.UI.RadTreeNode Parent = node;
                while ((Parent = Parent.ParentNode) != null)
                {
                    FullPath = Parent.Text + " > " + FullPath;
                }

                if (SelectedMetricCategoryId != null && SelectedMetricCategoryId != Guid.Empty && node.Value == SelectedMetricCategoryId.ToString())
                {
                    ddlMetricCategory.Text = FullPath;
                }
                node.Attributes.Add("FullPath", FullPath);

                node.ImageUrl = "~/images/GCATree/";
                switch (node.Level)
                {
                case 0:
                    node.ImageUrl += "group16.gif";
                    break;

                case 1:
                    node.ImageUrl += "category16.gif";
                    break;

                default:
                    node.ImageUrl += "aspect16.gif";
                    break;
                }
            }

            IsFilled = true;
        }
Example #10
0
        private void InitializeFormExplorerTree()
        {
            Telerik.Web.UI.RadTreeNode rootNode = new Telerik.Web.UI.RadTreeNode();

            FormExplorerTree_AddNode(rootNode, EditorForm);

            FormExplorerTree.Nodes.Add(rootNode.Nodes[0]);

            FormExplorerTree.Nodes[0].Expanded = true;

            return;
        }
Example #11
0
 static void ExpandNodeToLevel(Telerik.Web.UI.RadTreeNode node, int level, int maxLevel)
 {
     if (level < maxLevel)
     {
         node.Expanded = true;
         if (node.Nodes != null)
         {
             foreach (Telerik.Web.UI.RadTreeNode child in node.Nodes)
             {
                 ExpandNodeToLevel(child, level + 1, maxLevel);
             }
         }
     }
 }
        private void RadTreeView_MakeChildrenVisibleToNode(Telerik.Web.UI.RadTreeNode forNode)
        {
            if (forNode == null)
            {
                return;
            }

            foreach (Telerik.Web.UI.RadTreeNode currentChildNode in forNode.Nodes)
            {
                currentChildNode.Visible = true;

                RadTreeView_MakeChildrenVisibleToNode(currentChildNode);
            }

            return;
        }
        protected Telerik.Web.UI.RadTreeNode CreateTreeNode(String nodeText, String nodeValue, Boolean isChecked = false)
        {
            Telerik.Web.UI.RadTreeNode treeNode = new Telerik.Web.UI.RadTreeNode();


            treeNode.Text = nodeText;

            treeNode.Value = nodeValue;

            treeNode.Checked = isChecked;

            treeNode.Checkable = true;


            return(treeNode);
        }
Example #14
0
    protected void btnCaptionEdit_Click(object sender, EventArgs e)
    {
        Telerik.Web.UI.RadTreeNode n = new Telerik.Web.UI.RadTreeNode();
        n.Text = txtCaptionEdit.Text;
        if (rtvLayers.Nodes.Count == 0)
        {

        }
        else
        {
            if (rtvLayers.SelectedNode != null)
            {
                rtvLayers.SelectedNode.Text = txtCaptionEdit.Text;
                poi_Layers_UPDATE(int.Parse(rtvLayers.SelectedNode.Value), txtCaptionEdit.Text);
            }
        }
    }
Example #15
0
        private void FormExplorerTree_AddNode(Telerik.Web.UI.RadTreeNode parentNode, Client.Core.Forms.Control formControl)
        {
            Telerik.Web.UI.RadTreeNode currentNode;

            String nodeText = formControl.Name;

            if ((formControl.ReadOnly) || (!formControl.Visible) || (formControl.Required))
            {
                if (formControl.Required)
                {
                    nodeText = nodeText + " { Required }";
                }

                if (formControl.ReadOnly)
                {
                    nodeText = nodeText + " { Read Only }";
                }

                if (!formControl.Visible)
                {
                    nodeText = nodeText + " { Not Visible }";
                }
            }


            currentNode = new Telerik.Web.UI.RadTreeNode();

            currentNode.Text = nodeText;

            currentNode.Value = formControl.ControlId.ToString();

            currentNode.Category = formControl.ControlType.ToString();

            currentNode.ImageUrl = "/Images/Common16/" + formControl.ControlType.ToString() + ".png";

            currentNode.ExpandMode = Telerik.Web.UI.TreeNodeExpandMode.ClientSide;

            parentNode.Nodes.Add(currentNode);

            foreach (Client.Core.Forms.Control currentChildControl in formControl.Controls)
            {
                FormExplorerTree_AddNode(currentNode, currentChildControl);
            }

            return;
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string ruta = "";
         ruta = HostingEnvironment.ApplicationPhysicalPath.ToString() + @"ModulosApoyo\";
         DirectoryInfo di = new DirectoryInfo(ruta);
         foreach (var archivo in di.GetFiles())
         {
             if (archivo.Name.EndsWith("mrt"))
             {
                 Telerik.Web.UI.RadTreeNode nodo = new Telerik.Web.UI.RadTreeNode();
                 nodo.Text  = archivo.Name;
                 nodo.Value = ruta + archivo.Name;
                 rtvReportes.Nodes.Add(nodo);
             }
         }
     }
 }
Example #17
0
        private void FillTreeView(Guid?SelectedOrgLocationId, bool ClearText)
        {
            if (ShowNullAsRooOrgLocation && SelectedOrgLocationId == null)
            {
                SelectedOrgLocationId = Guid.Empty;
            }
            if (ClearText)
            {
                ddlOrgLocation.Text = string.Empty;
            }
            Telerik.Web.UI.RadTreeView tvOrgLocations = GetTvOrgLocations();

            if (!IsFilled)
            {
                tvOrgLocations.DataSource        = GetDataSource();
                tvOrgLocations.DataTextField     = "Name";
                tvOrgLocations.DataFieldParentID = "ParentEntityNodeId";
                tvOrgLocations.DataValueField    = "EntityNodeId";
                tvOrgLocations.DataFieldID       = "EntityNodeId";
                tvOrgLocations.DataBind();
            }

            System.Collections.Generic.IList <Telerik.Web.UI.RadTreeNode> AllNodes = tvOrgLocations.GetAllNodes();
            foreach (Telerik.Web.UI.RadTreeNode node in AllNodes)
            {
                string FullPath = node.Text;
                Telerik.Web.UI.RadTreeNode Parent = node;
                while ((Parent = Parent.ParentNode) != null)
                {
                    FullPath = Parent.Text + " > " + FullPath;
                }

                if (SelectedOrgLocationId != null && node.Value == SelectedOrgLocationId.ToString())
                {
                    ddlOrgLocation.Text = FullPath;
                }
                node.Attributes.Add("FullPath", FullPath);

                node.ImageUrl = "~/images/GCATree/OrgLocation.gif";
            }

            IsFilled = true;
        }
Example #18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack && !Page.IsCallback)
     {
         foreach (XElement elm in xdoc.Element("RadTreeNodes").Elements())
         {
             radQuickNav.Nodes.Add(new Telerik.Web.UI.RadTreeNode(elm.Attribute("Text").Value));
         }
         if (!string.IsNullOrEmpty(this.ExpandNode))
         {
             Telerik.Web.UI.RadTreeNode node = radQuickNav.FindNodeByText(this.ExpandNode);
             foreach (XElement elm in xdoc.Element("RadTreeNodes").Elements().First(el => el.Attribute("Text").Value == this.ExpandNode).Element("RadTreeNodes").Elements())
             {
                 node.Nodes.Add(new Telerik.Web.UI.RadTreeNode(elm.Attribute("Text").Value, "", elm.Attribute("NavUrl").Value));
             }
             if (node.Nodes.Count > 0)
             {
                 node.Nodes[0].Selected = true;
             }
             node.Expanded = true;
         }
     }
 }
Example #19
0
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Telerik.Web.UI.RadTreeNode n = new Telerik.Web.UI.RadTreeNode();
        n.Text = "---";
        if (rtvLayers.Nodes.Count == 0)
        {
            n.Value = poi_Layers_INSERT(0, "---").ToString();
            rtvLayers.Nodes.Add(n);
        }
        else
        {
            if (rtvLayers.SelectedNode != null)
            {
                n.Value = poi_Layers_INSERT(int.Parse(rtvLayers.SelectedNode.ParentNode.Value), "---").ToString();

                rtvLayers.SelectedNode.ParentNode.Nodes.Add(n);
            }
        }
    }
Example #20
0
        private void InitializeCareInterventionTreeView()
        {
            Client.Core.Individual.CarePlanGoal originalCarePlanGoal = MemberCaseCarePlanGoal.MemberCaseCarePlan.CarePlan.CarePlanGoal(MemberCaseCarePlanGoal.CarePlanGoalId);

            Telerik.Web.UI.RadTreeNode careInterventionNode;


            #region Create Root Nodes

            Telerik.Web.UI.RadTreeNode rootCurrentNode = new Telerik.Web.UI.RadTreeNode("Current", "RootCurrent");

            rootCurrentNode.Checkable = false;

            rootCurrentNode.Expanded = false;

            CareInterventionTreeView.Nodes.Add(rootCurrentNode);


            Telerik.Web.UI.RadTreeNode rootRequiredNode = new Telerik.Web.UI.RadTreeNode("Required", "RootRequired");

            rootRequiredNode.Checkable = false;

            rootRequiredNode.Expanded = true;

            CareInterventionTreeView.Nodes.Add(rootRequiredNode);


            Telerik.Web.UI.RadTreeNode rootSuggestedNode = new Telerik.Web.UI.RadTreeNode("Suggested", "RootSuggested");

            rootSuggestedNode.Checkable = false;

            rootSuggestedNode.Expanded = true;

            CareInterventionTreeView.Nodes.Add(rootSuggestedNode);


            Telerik.Web.UI.RadTreeNode rootOptionalNode = new Telerik.Web.UI.RadTreeNode("Optional", "RootOptional");

            rootOptionalNode.Checkable = false;

            rootOptionalNode.Expanded = false;

            CareInterventionTreeView.Nodes.Add(rootOptionalNode);


            Telerik.Web.UI.RadTreeNode rootAllNode = new Telerik.Web.UI.RadTreeNode("All Others", "RootAll");

            rootAllNode.Checkable = false;

            rootAllNode.Expanded = false;

            CareInterventionTreeView.Nodes.Add(rootAllNode);

            #endregion


            List <Client.Core.Individual.CareIntervention> careInterventionsCurrent =

                (from currentCarePlanGoalIntervention in MemberCaseCarePlanGoal.Interventions

                 where

                 // ALTERED TO REMOVE THOSE WHERE CARE INTERVENTION IS NULL

                 (currentCarePlanGoalIntervention.CareIntervention != null) && (

                     (currentCarePlanGoalIntervention.CareIntervention != null ?

                      ((currentCarePlanGoalIntervention.CareIntervention.Status == Mercury.Server.Application.CaseItemStatus.UnderDevelopment)

                       || (currentCarePlanGoalIntervention.CareIntervention.Status == Mercury.Server.Application.CaseItemStatus.Active))

                    : (currentCarePlanGoalIntervention.Id == currentCarePlanGoalIntervention.Id)))

                 select currentCarePlanGoalIntervention.CareIntervention.CareIntervention

                ).Distinct().ToList();


            foreach (Client.Core.Individual.CareIntervention currentCareIntervention in careInterventionsCurrent)
            {
                // EXISTING CARE INTERVENTIONS WILL HAVE "Checked" TRUE AND "ForeColor" System.Drawing.Color.Black

                // IF THE CARE INTERVENTION EXISTS AND IS ACTIVE IN THE CASE ALREADY, DO NOT ALLOW IT TO BE ADDED AGAIN

                careInterventionNode = new Telerik.Web.UI.RadTreeNode(currentCareIntervention.Name, currentCareIntervention.Id.ToString());

                careInterventionNode.Checkable = false;

                careInterventionNode.ImageUrl = "/Images/Common16/Check.png";

                careInterventionNode.ForeColor = System.Drawing.Color.Black;


                // ADD EARLY SO THAT EXPAND TO NODE WORKS (PARENT RELATIONSHIP REQUIRED)

                rootCurrentNode.Nodes.Add(careInterventionNode);
            }


            List <Client.Core.Individual.CareIntervention> careInterventionsAvailable = MercuryApplication.CareInterventionsAvailable(true);

            careInterventionsAvailable =

                (from currentCareIntervention in careInterventionsAvailable

                 where (currentCareIntervention.Enabled == true)

                 orderby currentCareIntervention.Name

                 select currentCareIntervention).ToList();



            foreach (Client.Core.Individual.CareIntervention currentCareIntervention in careInterventionsAvailable)
            {
                // MAKE SURE THAT THE NODE DOES NOT ALREADY EXIST (FROM THE "CURRENT" SELECTION)

                if (CareInterventionTreeView.FindNodeByValue(currentCareIntervention.Id.ToString()) == null)
                {
                    Telerik.Web.UI.RadTreeNode parentNode = rootAllNode;


                    if (originalCarePlanGoal != null)   // IT IS POSSIBLE THAT THE GOAL WAS A CUSTOM CREATED GOAL

                    // USE THE ORIGINAL CARE PLAN OF THE CARE PLAN GOAL TO CHECK TO SEE IF THE INTERVENTION IS REQUIRED/SUGGESTED/OPTIONAL IN THE ORIGINAL

                    {
                        Client.Core.Individual.CarePlanIntervention originalCarePlanIntervention = originalCarePlanGoal.CarePlanIntervention(currentCareIntervention.Id);


                        if (originalCarePlanIntervention != null)
                        {
                            switch (originalCarePlanIntervention.Inclusion)
                            {
                            case Mercury.Server.Application.CarePlanItemInclusion.Required: parentNode = rootRequiredNode; break;

                            case Mercury.Server.Application.CarePlanItemInclusion.Suggested: parentNode = rootSuggestedNode; break;

                            case Mercury.Server.Application.CarePlanItemInclusion.Optional: parentNode = rootOptionalNode; break;
                            }
                        }
                    }

                    careInterventionNode = new Telerik.Web.UI.RadTreeNode(currentCareIntervention.Name, currentCareIntervention.Id.ToString());

                    parentNode.Nodes.Add(careInterventionNode);


                    // IDENTIFY CARE INTERVENTIONS THAT ARE ALREADY IN USE BY CURRENT CARE PLAN OR OTHER CARE PLAN

                    List <Client.Core.Individual.Case.MemberCaseProblemCarePlan> memberCaseProblemCarePlans =

                        (from currentMemberCaseCarePlan in Case.CarePlans

                         from currentMemberCaseCarePlanGoal in currentMemberCaseCarePlan.Goals

                         from currentMemberCaseCarePlanGoalIntervention in currentMemberCaseCarePlanGoal.Interventions

                         from currentProblems in currentMemberCaseCarePlanGoalIntervention.MemberCaseCarePlanGoal.MemberCaseCarePlan.Problems

                         // ALTERED TO CHECK IF CARE INTERVENTION IS NULL

                         where ((currentMemberCaseCarePlanGoalIntervention.CareIntervention != null) ? (currentMemberCaseCarePlanGoalIntervention.CareIntervention.CareInterventionId == currentCareIntervention.Id)

                                && ((currentMemberCaseCarePlanGoalIntervention.CareIntervention.Status == Mercury.Server.Application.CaseItemStatus.UnderDevelopment))

                                || (currentMemberCaseCarePlanGoalIntervention.CareIntervention.Status == Mercury.Server.Application.CaseItemStatus.Active) : (currentMemberCaseCarePlanGoalIntervention.Id == currentMemberCaseCarePlanGoalIntervention.Id))

                         select currentProblems).Distinct().ToList();

                    foreach (Client.Core.Individual.Case.MemberCaseProblemCarePlan currentMemberCaseProblemCarePlan in memberCaseProblemCarePlans)
                    {
                        Telerik.Web.UI.RadTreeNode problemNode = new Telerik.Web.UI.RadTreeNode(currentMemberCaseProblemCarePlan.ProblemStatementClassificationWithName, currentCareIntervention.Id.ToString() + "|" + currentMemberCaseProblemCarePlan.Id.ToString());

                        problemNode.Checkable = false;

                        careInterventionNode.Nodes.Add(problemNode);
                    }
                }
            }

            return;
        }
Example #21
0
        protected Boolean ApplyChanges()
        {
            Boolean isModified = false;

            Boolean success = false;

            List <Int64> careInterventionIds = new List <Int64> (); // CARE INTERVENTIONS TO ADD

            Int64 careInterventionId = 0;

            Mercury.Server.Application.MemberCaseModificationResponse response;


            // IDENTIFY ALL REQUESTED CARE INTERVENTIONS TO ADD

            foreach (Telerik.Web.UI.RadTreeNode currentNode in CareInterventionTreeView.GetAllNodes())
            {
                // VALIDATE THAT THE NODE IS CHECKED AND REQUESTED TO BE ADDED TO THE GOAL

                if (currentNode.Checked)
                {
                    // VALIDATE THAT THE NODE IS A CARE INTERVENTION NODE

                    if (Int64.TryParse(currentNode.Value, out careInterventionId))
                    {
                        careInterventionIds.Add(careInterventionId);
                    }
                }
            }

            isModified = (careInterventionIds.Count > 0);

            if (isModified)
            {
                success = true;

                foreach (Int64 currentCareInterventionId in careInterventionIds)
                {
                    // TODO: ADD SINGLE INSTANCE SUPPORT HERE

                    response = MercuryApplication.MemberCaseCarePlanGoal_AddCareIntervention(Case, MemberCaseCarePlanGoal.Id, currentCareInterventionId, false);

                    Case = new Client.Core.Individual.Case.MemberCase(MercuryApplication, response.MemberCase);

                    if (response.HasException)
                    {
                        ExceptionMessage = response.Exception.Message;

                        success = false;

                        // REBUILD TREE AND SET ERROR NODE ACTIVE

                        CareInterventionTreeView.Nodes.Clear();

                        InitializeCareInterventionTreeView();

                        Telerik.Web.UI.RadTreeNode careInterventionNode = CareInterventionTreeView.FindNodeByValue(currentCareInterventionId.ToString());

                        if (careInterventionNode != null)
                        {
                            careInterventionNode.Expanded = true;

                            careInterventionNode.ParentNode.Expanded = true; // ONLY TWO LEVELS DEEP

                            careInterventionNode.Selected = true;
                        }

                        break;
                    }
                }

                if (success)   // IF ALL PROBLEMS WERE ADDED WITHOUT PROBLEMS, REFRESH TREE

                {
                    CareInterventionTreeView.Nodes.Clear();

                    InitializeCareInterventionTreeView();
                }
            }

            else
            {
                ExceptionMessage = "No Changes Detected";

                success = true;
            }


            return(success);
        }
Example #22
0
    private void LoadMainCats(Telerik.Web.UI.RadTreeView RadTreeViewX)
    {
        Telerik.Web.UI.RadTreeNode MainNodI = new Telerik.Web.UI.RadTreeNode("شجرة الحسابات", "-1");
        MainNodI.ImageUrl = "~/Images/Folders.png";
        MainNodI.Category = "0";
        MainNodI.LongDesc = "0";
        RadTreeViewX.Nodes.Add(MainNodI);

        DataTable GeneralItems = new DataTable("FX2010-12");
        GeneralItems = MC.LoadDataTable(@"Select AccountId, AccountName, AccountTreeId From TblAccounts Where BasicAccountId = 0", "");
        foreach (DataRow R in GeneralItems.Rows)
        {
            Telerik.Web.UI.RadTreeNode NodI = new Telerik.Web.UI.RadTreeNode(R["AccountName"].ToString(), R["AccountId"].ToString())
            { ImageUrl = "~/Images/Folders.png", Category = R["AccountTreeId"].ToString() };
            MainNodI.Nodes.Add(NodI);
            LoadChildCats(NodI);
        }
    }
Example #23
0
 private void LoadChildCats(Telerik.Web.UI.RadTreeNode Node)
 {
     DataTable ItemChilds = new DataTable("FX2010-11");
     ItemChilds = MC.LoadDataTable("Select AccountId, AccountName, AccountTreeId, BasicAccountId From TblAccounts Where BasicAccountId = " + Node.Value, "");
     foreach (DataRow R in ItemChilds.Rows)
     {
         Telerik.Web.UI.RadTreeNode NodI = new Telerik.Web.UI.RadTreeNode(R["AccountName"].ToString(), R["AccountId"].ToString());
         NodI.ImageUrl = "~/Images/Folders.png";
         NodI.Category = R["AccountTreeId"].ToString();
         NodI.LongDesc = R["BasicAccountId"].ToString();
         Node.Nodes.Add(NodI);
         LoadChildCats(NodI);
     }
 }
Example #24
0
 protected void LinkButton4_Click(object sender, EventArgs e)
 {
     Telerik.Web.UI.RadTreeNode n = new Telerik.Web.UI.RadTreeNode();
     n.Text = txtCaptionEdit.Text;
     if (rtvLayers.Nodes.Count == 0)
     {
         //n.Value = poi_Layers_INSERT(0, "---").ToString();
         //rtvLayers.Nodes.Add(n);
     }
     else
     {
         if (rtvLayers.SelectedNode != null)
         {
             rtvLayers.SelectedNode.Text = txtCaptionEdit.Text;
             poi_Layers_UPDATE(int.Parse(rtvLayers.SelectedNode.Value), txtCaptionEdit.Text);
         }
     }
     pnl_edit.Visible = false;
 }
Example #25
0
    /////////////////////////////////////////////////////////////////////////////////////////////////////////
    void FillTree()
    {
        string qry = " SELECT  * FROM tbl_poi_layers " +
                     " WHERE pl_owner_link = " + Session["OwnerID"].ToString() +
                     " AND pl_weight = " + Session["OwnerWeight"].ToString() +
                     " Order By pl_parent_node_id , pl_id ";

        SqlDataAdapter sda = new SqlDataAdapter(qry, GetConnectionString());
        DataSet ds = new DataSet();
        ds.Clear();
        sda.Fill(ds);
        int parID, priParID = 0;
        if (ds.Tables[0].Rows.Count > 0)
        {
            int mainNodeCount = 0;
            Boolean nodeAdded = false;
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                nodeAdded = false;
                Telerik.Web.UI.RadTreeNode n = new Telerik.Web.UI.RadTreeNode();
                n.Value = ds.Tables[0].Rows[i]["pl_id"].ToString().Trim();
                n.Text = ds.Tables[0].Rows[i]["pl_caption"].ToString().Trim();
                n.NavigateUrl = "javascript:SetActiveNodeID(" + ds.Tables[0].Rows[i]["pl_id"].ToString() + ",'" + ds.Tables[0].Rows[i]["pl_caption"].ToString() + "');";

                if (ds.Tables[0].Rows[i]["pl_parent_node_id"].ToString() == "0")
                {
                    rtvLayers.Nodes.Add(n);
                    mainNodeCount++;
                    nodeAdded = true;
                }
                else
                {
                    for (int j = 0; j < rtvLayers.Nodes.Count; j++)
                    {
                        if (ds.Tables[0].Rows[i]["pl_parent_node_id"].ToString() == rtvLayers.Nodes[j].Value)
                        {
                            rtvLayers.Nodes[j].Nodes.Add(n);
                            nodeAdded = true;
                        }

                    }

                }
                if (nodeAdded == false)
                {
                    for (int z = 0; z < mainNodeCount; z++)
                    {
                        if (node(rtvLayers.Nodes[z], ds.Tables[0].Rows[i]["pl_parent_node_id"].ToString()) != null)
                        {
                            node(rtvLayers.Nodes[z], ds.Tables[0].Rows[i]["pl_parent_node_id"].ToString()).Nodes.Add(n);  //
                        }
                    }
                }
            }

        }
    }
        private void InitializeTreeViewOfMember()
        {
            DataExplorerTreeView.Nodes.Clear();


            Telerik.Web.UI.RadTreeNode rootNode = CreateTreeNode("Member", "Member");

            rootNode.Checkable = false;

            rootNode.Expanded = false;

            DataExplorerTreeView.Nodes.Add(rootNode);


            rootNode.Nodes.Add(CreateTreeNode("Id", "Id", false));

            rootNode.Nodes.Add(CreateTreeNode("Name", "Name"));

            rootNode.Nodes.Add(CreateTreeNode("Description", "Description"));



            rootNode.Nodes.Add(CreateTreeNode("Birth Date", "BirthDateDescription"));

            rootNode.Nodes.Add(CreateTreeNode("Death Date", "DeathDate"));

            rootNode.Nodes.Add(CreateTreeNode("Gender Description", "GenderDescription"));

            rootNode.Nodes.Add(CreateTreeNode("Ethnicity Description", "EthnicityDescription"));

            rootNode.Nodes.Add(CreateTreeNode("Citizenship Description", "CitizenshipDescription"));

            rootNode.Nodes.Add(CreateTreeNode("Language Description", "LanguageDescription"));

            rootNode.Nodes.Add(CreateTreeNode("Marital Status Description", "MaritalStatusDescription"));

            rootNode.Nodes.Add(CreateTreeNode("Family Id", "FamilyId"));



            rootNode.Nodes.Add(CreateTreeNode("Current Age (Years)", "CurrentAge"));

            rootNode.Nodes.Add(CreateTreeNode("Current Age (Months)", "CurrentAgeInMonths"));

            rootNode.Nodes.Add(CreateTreeNode("Current Age Description", "CurrentAgeDescription"));



            Telerik.Web.UI.RadTreeNode entityNode = CreateTreeNode("Entity", "Entity");

            entityNode.Checkable = false;

            DataExplorerTreeView.Nodes.Add(entityNode);


            entityNode.Nodes.Add(CreateTreeNode("Id", "Entity.Id"));

            entityNode.Nodes.Add(CreateTreeNode("Name", "Entity.Name"));

            entityNode.Nodes.Add(CreateTreeNode("Description", "Entity.Description"));



            entityNode.Nodes.Add(CreateTreeNode("Name Last", "Entity.NameLast"));

            entityNode.Nodes.Add(CreateTreeNode("Name First", "Entity.NameFirst"));

            entityNode.Nodes.Add(CreateTreeNode("Name Middle", "Entity.NameMiddle"));

            entityNode.Nodes.Add(CreateTreeNode("Name Prefix", "Entity.NamePrefix"));

            entityNode.Nodes.Add(CreateTreeNode("Name Suffix", "Entity.NameSuffix"));

            entityNode.Nodes.Add(CreateTreeNode("Federal Tax Id", "Entity.FederalTaxId"));

            entityNode.Nodes.Add(CreateTreeNode("Id Code Qualifier", "Entity.IdCodeQualifier"));

            entityNode.Nodes.Add(CreateTreeNode("Unique Id", "Entity.UniqueId"));


            #region Entity.CurrentMailingAddress

            Telerik.Web.UI.RadTreeNode entityCurrentMailingAddress = CreateTreeNode("Current Mailing Address", "Entity.CurrentMailingAddress");

            entityCurrentMailingAddress.Checkable = false;

            DataExplorerTreeView.Nodes.Add(entityCurrentMailingAddress);


            entityCurrentMailingAddress.Nodes.Add(CreateTreeNode("Address Line 1", "Entity.CurrentMailingAddress.Line1"));

            entityCurrentMailingAddress.Nodes.Add(CreateTreeNode("Address Line 2", "Entity.CurrentMailingAddress.Line2"));

            entityCurrentMailingAddress.Nodes.Add(CreateTreeNode("City", "Entity.CurrentMailingAddress.City"));

            entityCurrentMailingAddress.Nodes.Add(CreateTreeNode("State", "Entity.CurrentMailingAddress.State"));

            entityCurrentMailingAddress.Nodes.Add(CreateTreeNode("ZIP Code", "Entity.CurrentMailingAddress.ZipCode"));

            entityCurrentMailingAddress.Nodes.Add(CreateTreeNode("ZIP Plus 4", "Entity.CurrentMailingAddress.ZipPlus4"));

            entityCurrentMailingAddress.Nodes.Add(CreateTreeNode("Address Single Line", "Entity.CurrentMailingAddress.AddressSingleLine"));

            entityCurrentMailingAddress.Nodes.Add(CreateTreeNode("City, State ZIP", "Entity.CurrentMailingAddress.CityStateZipCode"));

            entityCurrentMailingAddress.Nodes.Add(CreateTreeNode("Longitude", "Entity.CurrentMailingAddress.Longitude"));

            entityCurrentMailingAddress.Nodes.Add(CreateTreeNode("Latitude", "Entity.CurrentMailingAddress.Latitude"));

            #endregion


            #region Entity.CurrentPhysicalAddress

            Telerik.Web.UI.RadTreeNode entityCurrentPhysicalAddress = CreateTreeNode("Current Physical Address", "Entity.CurrentPhysicalAddress");

            entityCurrentPhysicalAddress.Checkable = false;

            DataExplorerTreeView.Nodes.Add(entityCurrentPhysicalAddress);


            entityCurrentPhysicalAddress.Nodes.Add(CreateTreeNode("Address Line 1", "Entity.CurrentPhysicalAddress.Line1"));

            entityCurrentPhysicalAddress.Nodes.Add(CreateTreeNode("Address Line 2", "Entity.CurrentPhysicalAddress.Line2"));

            entityCurrentPhysicalAddress.Nodes.Add(CreateTreeNode("City", "Entity.CurrentPhysicalAddress.City"));

            entityCurrentPhysicalAddress.Nodes.Add(CreateTreeNode("State", "Entity.CurrentPhysicalAddress.State"));

            entityCurrentPhysicalAddress.Nodes.Add(CreateTreeNode("ZIP Code", "Entity.CurrentPhysicalAddress.ZipCode"));

            entityCurrentPhysicalAddress.Nodes.Add(CreateTreeNode("ZIP Plus 4", "Entity.CurrentPhysicalAddress.ZipPlus4"));

            entityCurrentPhysicalAddress.Nodes.Add(CreateTreeNode("Address Single Line", "Entity.CurrentPhysicalAddress.AddressSingleLine"));

            entityCurrentPhysicalAddress.Nodes.Add(CreateTreeNode("City, State ZIP", "Entity.CurrentPhysicalAddress.CityStateZipCode"));

            entityCurrentPhysicalAddress.Nodes.Add(CreateTreeNode("Longitude", "Entity.CurrentPhysicalAddress.Longitude"));

            entityCurrentPhysicalAddress.Nodes.Add(CreateTreeNode("Latitude", "Entity.CurrentPhysicalAddress.Latitude"));

            #endregion


            #region Entity.CurrentContactInformationTelephone

            Telerik.Web.UI.RadTreeNode entityCurrentTelephone = CreateTreeNode("Current Contact Information", "Entity.CurrentContactInformation");

            entityCurrentTelephone.Checkable = false;

            DataExplorerTreeView.Nodes.Add(entityCurrentTelephone);


            entityCurrentTelephone.Nodes.Add(CreateTreeNode("Alternate Telephone Number", "Entity.CurrentContactInformationAlternateTelephone.NumberFormatted"));

            entityCurrentTelephone.Nodes.Add(CreateTreeNode("Telephone Number", "Entity.CurrentContactInformationTelephone.NumberFormatted"));

            #endregion


            #region Current Enrollment

            Telerik.Web.UI.RadTreeNode currentEnrollmentNode = CreateTreeNode("Current Enrollment", "CurrentEnrollment");

            currentEnrollmentNode.Checkable = false;

            DataExplorerTreeView.Nodes.Add(currentEnrollmentNode);


            currentEnrollmentNode.Nodes.Add(CreateTreeNode("Sponsor Id", "CurrentEnrollment.SponsorId"));

            currentEnrollmentNode.Nodes.Add(CreateTreeNode("Sponsor Name", "CurrentEnrollment.Sponsor.Name"));


            currentEnrollmentNode.Nodes.Add(CreateTreeNode("Subscriber Id", "CurrentEnrollment.SubscriberId"));

            currentEnrollmentNode.Nodes.Add(CreateTreeNode("Subscriber Name", "CurrentEnrollment.Subscriber.Name"));

            currentEnrollmentNode.Nodes.Add(CreateTreeNode("Insurer Id", "CurrentEnrollment.Insurer"));

            currentEnrollmentNode.Nodes.Add(CreateTreeNode("Insurer Name", "CurrentEnrollment.Insurer.Name"));

            currentEnrollmentNode.Nodes.Add(CreateTreeNode("Program Id", "CurrentEnrollment.ProgramId"));

            currentEnrollmentNode.Nodes.Add(CreateTreeNode("Program Name", "CurrentEnrollment.Program.Name"));

            currentEnrollmentNode.Nodes.Add(CreateTreeNode("Program Member Id", "CurrentEnrollment.ProgramMemberId"));

            currentEnrollmentNode.Nodes.Add(CreateTreeNode("Effective Date", "CurrentEnrollment.EffectiveDate"));

            currentEnrollmentNode.Nodes.Add(CreateTreeNode("Termination Date", "CurrentEnrollment.TerminationDate"));

            #endregion


            #region Current Enrollment Coverage

            Telerik.Web.UI.RadTreeNode currentEnrollmentCoverageNode = CreateTreeNode("Current Enrollment Coverage", "CurrentEnrollmentCoverage");

            currentEnrollmentCoverageNode.Checkable = false;

            DataExplorerTreeView.Nodes.Add(currentEnrollmentCoverageNode);


            currentEnrollmentCoverageNode.Nodes.Add(CreateTreeNode("Benefit Plan Id", "CurrentEnrollmentCoverage.BenefitPlanId"));

            currentEnrollmentCoverageNode.Nodes.Add(CreateTreeNode("Benefit Plan Name", "CurrentEnrollmentCoverage.BenefitPlanName"));

            currentEnrollmentCoverageNode.Nodes.Add(CreateTreeNode("Coverage Type", "CurrentEnrollmentCoverage.CoverageTypeName"));

            currentEnrollmentCoverageNode.Nodes.Add(CreateTreeNode("Coverage Level", "CurrentEnrollmentCoverage.CoverageLevelName"));

            currentEnrollmentCoverageNode.Nodes.Add(CreateTreeNode("Rate Code", "CurrentEnrollmentCoverage.Insurer"));

            currentEnrollmentCoverageNode.Nodes.Add(CreateTreeNode("Effective Date", "CurrentEnrollmentCoverage.EffectiveDate"));

            currentEnrollmentCoverageNode.Nodes.Add(CreateTreeNode("Termination Date", "CurrentEnrollmentCoverage.TerminationDate"));

            #endregion



            #region Current Enrollment Pcp

            Telerik.Web.UI.RadTreeNode currentEnrollmentPcpNode = CreateTreeNode("Current Enrollment PCP", "CurrentEnrollmentPcp");

            currentEnrollmentPcpNode.Checkable = false;

            DataExplorerTreeView.Nodes.Add(currentEnrollmentPcpNode);


            #region Current Enrollment Pcp - Pcp Provider

            Telerik.Web.UI.RadTreeNode currentEnrollmentPcpProviderNode = CreateTreeNode("PCP Provider", "CurrentEnrollmentPcpProvider");

            currentEnrollmentPcpProviderNode.Checkable = false;

            currentEnrollmentPcpNode.Nodes.Add(currentEnrollmentPcpProviderNode);

            currentEnrollmentPcpProviderNode.Nodes.Add(CreateTreeNode("PCP Provider Name", "CurrentEnrollmentPcp.PcpProvider.Name"));


            #region Entity.CurrentMailingAddress

            Telerik.Web.UI.RadTreeNode pcpProviderCurrentMailingAddress = CreateTreeNode("Current Mailing Address", "CurrentEnrollmentPcp.PcpProvider.Entity.CurrentMailingAddress");

            pcpProviderCurrentMailingAddress.Checkable = false;

            currentEnrollmentPcpProviderNode.Nodes.Add(pcpProviderCurrentMailingAddress);


            pcpProviderCurrentMailingAddress.Nodes.Add(CreateTreeNode("Address Line 1", "CurrentEnrollmentPcp.PcpProvider.Entity.CurrentMailingAddress.Line1"));

            pcpProviderCurrentMailingAddress.Nodes.Add(CreateTreeNode("Address Line 2", "CurrentEnrollmentPcp.PcpProvider.Entity.CurrentMailingAddress.Line2"));

            pcpProviderCurrentMailingAddress.Nodes.Add(CreateTreeNode("City", "CurrentEnrollmentPcp.PcpProvider.Entity.CurrentMailingAddress.City"));

            pcpProviderCurrentMailingAddress.Nodes.Add(CreateTreeNode("State", "CurrentEnrollmentPcp.PcpProvider.Entity.CurrentMailingAddress.State"));

            pcpProviderCurrentMailingAddress.Nodes.Add(CreateTreeNode("ZIP Code", "CurrentEnrollmentPcp.PcpProvider.Entity.CurrentMailingAddress.ZipCode"));

            pcpProviderCurrentMailingAddress.Nodes.Add(CreateTreeNode("ZIP Plus 4", "CurrentEnrollmentPcp.PcpProvider.Entity.CurrentMailingAddress.ZipPlus4"));

            pcpProviderCurrentMailingAddress.Nodes.Add(CreateTreeNode("Address Single Line", "CurrentEnrollmentPcp.PcpProvider.Entity.CurrentMailingAddress.AddressSingleLine"));

            pcpProviderCurrentMailingAddress.Nodes.Add(CreateTreeNode("City, State ZIP", "CurrentEnrollmentPcp.PcpProvider.Entity.CurrentMailingAddress.CityStateZipCode"));

            pcpProviderCurrentMailingAddress.Nodes.Add(CreateTreeNode("Longitude", "CurrentEnrollmentPcp.PcpProvider.Entity.CurrentMailingAddress.Longitude"));

            pcpProviderCurrentMailingAddress.Nodes.Add(CreateTreeNode("Latitude", "CurrentEnrollmentPcp.PcpProvider.Entity.CurrentMailingAddress.Latitude"));

            #endregion


            #endregion


            currentEnrollmentPcpNode.Nodes.Add(CreateTreeNode("PCP Affiliate Provider Name", "CurrentEnrollmentPcp.PcpAffiliateProvider.Name"));

            currentEnrollmentPcpNode.Nodes.Add(CreateTreeNode("Effective Date", "CurrentEnrollmentPcp.EffectiveDate"));

            currentEnrollmentPcpNode.Nodes.Add(CreateTreeNode("Termination Date", "CurrentEnrollmentPcp.TerminationDate"));

            #endregion

            DataExplorerTreeViewState = DataExplorerTreeView.GetXml();

            return;
        }
        protected Boolean ApplyChanges()
        {
            Boolean isModified = false;

            Boolean success = false;

            List <Int64> problemStatementIds = new List <Int64> (); // PROBLEM STATEMENTS TO ADD

            Int64 problemStatementId = 0;

            Mercury.Server.Application.MemberCaseModificationResponse response;



            // IDENTIFY ALL REQUESTED PROBLEM STATEMENTS TO ADD

            foreach (Telerik.Web.UI.RadTreeNode currentNode in ProblemStatementTreeView.GetAllNodes())
            {
                // VALIDATE THAT THE NODE IS CHECKED AND REQUESTED TO BE ADDED TO CASE

                if (currentNode.Checked)
                {
                    // VALIDATE THAT THE NODE IS A PROBLEM STATEMENT NODE

                    if (Int64.TryParse(currentNode.Value, out problemStatementId))
                    {
                        problemStatementIds.Add(problemStatementId);
                    }
                }
            }


            isModified = (problemStatementIds.Count > 0);

            if (isModified)
            {
                success = true;

                foreach (Int64 currentProblemStatementId in problemStatementIds)
                {
                    // TODO: ADD SINGLE INSTANCE SUPPORT HERE

                    response = MercuryApplication.MemberCase_AddProblemStatement(Case, currentProblemStatementId, false);

                    Case = new Client.Core.Individual.Case.MemberCase(MercuryApplication, response.MemberCase);

                    if (response.HasException)
                    {
                        ExceptionMessage = response.Exception.Message;

                        success = false;

                        // REBUILD TREE AND SET ERROR NODE ACTIVE

                        ProblemStatementTreeView.Nodes.Clear();

                        InitializeProblemStatementTreeView();

                        Telerik.Web.UI.RadTreeNode problemStatementNode = ProblemStatementTreeView.FindNodeByValue(currentProblemStatementId.ToString());

                        if (problemStatementNode != null)
                        {
                            problemStatementNode.Expanded = true;

                            problemStatementNode.ParentNode.Expanded = true;

                            problemStatementNode.ParentNode.ParentNode.Expanded = true;

                            problemStatementNode.Selected = true;
                        }

                        break;
                    }
                }

                if (success)   // IF ALL PROBLEMS WERE ADDED WITHOUT PROBLEMS, REFRESH TREE

                {
                    ProblemStatementTreeView.Nodes.Clear();

                    InitializeProblemStatementTreeView();
                }
            }

            else
            {
                ExceptionMessage = "No Changes Detected";

                success = true;
            }

            return(success);
        }
        private void InitializeProblemStatementTreeView()
        {
            List <Client.Core.Individual.ProblemStatement> problemStatementsAvailable = MercuryApplication.ProblemStatementsAvailable(true);

            List <Client.Core.Individual.MemberProblemStatementIdentified> memberProblemStatementidentifiedAvailable = MercuryApplication.MemberProblemStatementIdentifiedAvailable(Case.MemberId, false, false);

            problemStatementsAvailable =

                (from currentProblemStatement in problemStatementsAvailable

                 orderby currentProblemStatement.Classification, currentProblemStatement.Name

                 select currentProblemStatement).ToList();


            Dictionary <Int64, Client.Core.Individual.ProblemStatement> problemStatementsActive = Case.ProblemStatementsActive;


            foreach (Client.Core.Individual.ProblemStatement currentProblemStatement in problemStatementsAvailable)
            {
                Telerik.Web.UI.RadTreeNode domainNode = ProblemStatementTreeView.FindNodeByValue("ProblemDomain_" + currentProblemStatement.ProblemDomainId);

                Telerik.Web.UI.RadTreeNode classNode = ProblemStatementTreeView.FindNodeByValue("ProblemClass_" + currentProblemStatement.ProblemDomainId + "_" + currentProblemStatement.ProblemClassId);

                Telerik.Web.UI.RadTreeNode problemStatementNode = new Telerik.Web.UI.RadTreeNode(currentProblemStatement.Name, currentProblemStatement.Id.ToString());


                if (domainNode == null)
                {
                    domainNode = new Telerik.Web.UI.RadTreeNode(currentProblemStatement.ProblemDomainName, "ProblemDomain_" + currentProblemStatement.ProblemDomainId);

                    domainNode.Checkable = false;

                    ProblemStatementTreeView.Nodes.Add(domainNode);
                }

                if (classNode == null)
                {
                    classNode = new Telerik.Web.UI.RadTreeNode(currentProblemStatement.ProblemClassName, "ProblemClass_" + currentProblemStatement.ProblemDomainId + "_" + currentProblemStatement.ProblemClassId);

                    classNode.Checkable = false;

                    domainNode.Nodes.Add(classNode);
                }


                // EXISTING PROBLEMS STATEMENTS WILL HAVE "Checked" TRUE AND "ForeColor" System.Drawing.Color.Black

                // IF THE PROBLEM STATEMENT EXISTS AND IS ACTIVE IN THE CASE ALREADY, DO NOT ALLOW IT TO BE ADDED AGAIN

                // IF THE PROBLEM STATEMENT IS AN IDENTIFIED PROBLEM STATEMENT, BOLD IT AND RECOMMEND IT

                if (problemStatementsActive.ContainsKey(currentProblemStatement.Id))
                {
                    problemStatementNode.Checkable = false;

                    problemStatementNode.ImageUrl = "/Images/Common16/Check.png";

                    problemStatementNode.ForeColor = System.Drawing.Color.Black;
                }

                // ADD EARLY SO THAT EXPAND TO NODE WORKS (PARENT RELATIONSHIP REQUIRED)

                classNode.Nodes.Add(problemStatementNode);

                // DETERMINE IF IT IS AN IDENTIFIED PROBLEM STATEMENT

                Boolean identifiedProblemStatement =

                    (from currentIdentifiedProblemStatement in memberProblemStatementidentifiedAvailable

                     where currentIdentifiedProblemStatement.ProblemStatementId == currentProblemStatement.Id

                     select currentIdentifiedProblemStatement).ToList().Count > 0;

                if (identifiedProblemStatement)
                {
                    problemStatementNode.Text += " (recommended)";

                    problemStatementNode.Expanded = true;

                    RadTreeView_ExpandToNode(problemStatementNode);

                    problemStatementNode.Font.Bold = false;

                    problemStatementNode.ForeColor = System.Drawing.Color.Red;
                }
            }


            return;
        }