예제 #1
0
        protected void CareInterventionFilterClear_OnClick(Object sender, EventArgs e)
        {
            foreach (Telerik.Web.UI.RadTreeNode currentNode in CareInterventionTreeView.GetAllNodes())
            {
                currentNode.Visible = true;

                currentNode.Selected = false;
            }

            return;
        }
예제 #2
0
        protected void CareInterventionFilter_OnClick(Object sender, EventArgs e)
        {
            CareInterventionTreeView.UnselectAllNodes();

            foreach (Telerik.Web.UI.RadTreeNode currentNode in CareInterventionTreeView.GetAllNodes())
            {
                if (currentNode.Text.ToUpper().Contains(CareInterventionFilterText.Text.ToUpper()))
                {
                    currentNode.Visible = true;

                    currentNode.Selected = true;

                    RadTreeView_ExpandToNode(currentNode);

                    RadTreeView_MakeVisibleToNode(currentNode);
                }

                else
                {
                    currentNode.Visible = false;
                }
            }

            // SECOND CYCLE THROUGH, MAKE CHILDREN VISIBLE FROM VISIBLE PARENTS

            foreach (Telerik.Web.UI.RadTreeNode currentNode in CareInterventionTreeView.GetAllNodes())
            {
                if (currentNode.Visible)
                {
                    RadTreeView_MakeChildrenVisibleToNode(currentNode);
                }

                // REMOVE THOSE NODES FROM VIEW THAT HAVE CHILDREN BUT NONE ARE EXPANDED

                if ((!currentNode.Expanded) && (currentNode.Nodes.Count > 0))
                {
                    currentNode.Visible = false;
                }
            }

            return;
        }
예제 #3
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);
        }