Пример #1
0
        public void CaseCareLevelSeveritySaveLink_OnClick(Object sender, EventArgs e)
        {
            // GET REFERENCE TO CURRENT LINK BUTTON WEB CONTROL SAVE LINK FROM SENDER OBJECT

            System.Web.UI.WebControls.LinkButton currentSaveLink = (System.Web.UI.WebControls.LinkButton)sender;

            // GET REFERENCE TO CURRENT WEB CONTROL FROM PARENT OF CURRENT SAVE LINK LINK BUTTON WEB CONTROL

            System.Web.UI.Control currentWebControl = (System.Web.UI.Control)currentSaveLink.Parent;

            // GET REFERENCE TO CURRENT CASE CARE LEVEL SEVERITY CHANGE SELECTION RAD COMBO BOX

            Telerik.Web.UI.RadComboBox currentCaseCareLevelSeverityChangeSelection = (Telerik.Web.UI.RadComboBox)currentWebControl.FindControl("CaseCareLevelSeveritySelection");

            // CREATE REFERENCE TO PARSED SELECTED CARE LEVEL ID

            Int64 parsedselectedCareLevelId;

            // TRY TO PARSE SELECTED VALUE OF CURRENT CASE CARE LEVEL SEVERITY CHANGE SELECTION RAD COMBO BOX AS INT 64

            if (Int64.TryParse(currentCaseCareLevelSeverityChangeSelection.SelectedValue, out parsedselectedCareLevelId))
            {
                // SET SELECTED CARE LEVEL ID AS INT 64 OF SELECTED VALUE OF CURRENT CASE CARE LEVEL SEVERITY CHANGE SELECTION RAD COMBO BOX

                Int64 selectedCareLevelId = Convert.ToInt64(currentCaseCareLevelSeverityChangeSelection.SelectedValue);
            }

            // SET MEMBER CASE CARE PLAN SEVERITY LEVEL

            /* TODO: DAVID: SEVERITY (CARE LEVEL) IS NOT YET A PROPERTY OF MEMEBR CASE CARE PLAN IN CODE OR DATABASE */

            return;
        }
        protected void MemberMetricsGrid_OnItemCreated(Object sender, Telerik.Web.UI.GridItemEventArgs eventArgs)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            if (eventArgs.Item is Telerik.Web.UI.GridCommandItem)
            {
                Telerik.Web.UI.GridCommandItem commandItem = (Telerik.Web.UI.GridCommandItem)eventArgs.Item;

                Telerik.Web.UI.RadToolBar MemberMetricToolbar = (Telerik.Web.UI.RadToolBar)commandItem.FindControl("MemberMetricToolbar");

                ((Telerik.Web.UI.RadToolBarButton)MemberMetricToolbar.Items[0]).Checked = MemberMetricShowHidden;

                Telerik.Web.UI.RadComboBox MemberMetricSelection = (Telerik.Web.UI.RadComboBox)MemberMetricToolbar.Items[2].FindControl("MemberMetricSelection");

                Telerik.Web.UI.RadDateInput MemberMetricEventDate = (Telerik.Web.UI.RadDateInput)MemberMetricToolbar.Items[2].FindControl("MemberMetricEventDate");

                Telerik.Web.UI.RadNumericTextBox MemberMetricValue = (Telerik.Web.UI.RadNumericTextBox)MemberMetricToolbar.Items[2].FindControl("MemberMetricValue");

                if (MemberMetricSelection != null)
                {
                    if (MemberMetricSelection.Items.Count == 0)
                    {
                        MemberMetricSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem("** No Metric Selected", String.Empty));

                        foreach (Client.Core.Metrics.Metric currentMetric in MercuryApplication.MetricsAvailable(true))
                        {
                            if (currentMetric.Enabled)
                            {
                                MemberMetricSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem(currentMetric.Name, currentMetric.Id.ToString()));
                            }
                        }
                    }

                    MemberMetricSelection.SelectedValue = MemberMetricSelection_SelectedValue;
                }

                if (MemberMetricEventDate != null)
                {
                    if (Member != null)
                    {
                        MemberMetricEventDate.MinDate = Member.BirthDate;
                    }

                    MemberMetricEventDate.SelectedDate = MemberMetricEventDate_SelectedDate;
                }

                if (MemberMetricValue != null)
                {
                    MemberMetricValue.Value = MemberMetricValue_SelectedValue;
                }
            }

            return;
        }
Пример #3
0
 private Guid?GetSelectedGuid(Telerik.Web.UI.RadComboBox ddl)
 {
     if (string.IsNullOrEmpty(ddl.SelectedValue))
     {
         return(null);
     }
     try { return(new Guid(ddl.SelectedValue)); }
     catch { return(null); }
 }
Пример #4
0
 public void LlenaCombo(DataSet ds, Telerik.Web.UI.RadComboBox Combo, string Llave, string Descripcion)
 {
     Combo.DataSource     = ds;
     Combo.DataMember     = "DATOS";
     Combo.DataTextField  = Descripcion;
     Combo.DataValueField = Llave;
     Combo.DataBind();
     ds.Tables.Remove("DATOS");
 }
Пример #5
0
        protected void MemberWorkHistoryGrid_OnItemCreated(Object sender, Telerik.Web.UI.GridItemEventArgs eventArgs)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            if (eventArgs.Item is Telerik.Web.UI.GridCommandItem)
            {
                Telerik.Web.UI.GridCommandItem commandItem = (Telerik.Web.UI.GridCommandItem)eventArgs.Item;

                Telerik.Web.UI.RadToolBar MemberWorkHistoryToolbar = (Telerik.Web.UI.RadToolBar)commandItem.FindControl("MemberWorkHistoryToolbar");

                if (AllowUserInteraction)
                {
                    MemberWorkHistoryToolbar.Enabled = true;
                }

                else
                {
                    MemberWorkHistoryToolbar.Enabled = false;
                }


                if (AllowUserInteraction)
                {
                    Telerik.Web.UI.RadComboBox WorkQueueSelection = (Telerik.Web.UI.RadComboBox)MemberWorkHistoryToolbar.Items[0].FindControl("WorkQueueSelection");

                    Telerik.Web.UI.RadNumericTextBox WorkQueueItemPriority = (Telerik.Web.UI.RadNumericTextBox)(MemberWorkHistoryToolbar.Items[0].FindControl("WorkQueueItemPriority"));

                    if (WorkQueueSelection != null)
                    {
                        if (WorkQueueSelection.Items.Count == 0)
                        {
                            WorkQueueSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem("** No Work Queue Selected", String.Empty));

                            foreach (Client.Core.Work.WorkQueue currentWorkQueue in MercuryApplication.WorkQueuesAvailable(true))
                            {
                                if (MercuryApplication.SessionWorkQueueHasManagePermission(currentWorkQueue.Id))
                                {
                                    WorkQueueSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem(currentWorkQueue.Name, currentWorkQueue.Id.ToString()));
                                }
                            }
                        }

                        WorkQueueSelection.SelectedValue = WorkQueueSelection_SelectedValue;
                    }

                    if (WorkQueueItemPriority != null)
                    {
                        WorkQueueItemPriority.Value = WorkQueueItemPriority_Value;
                    }
                }
            }

            return;
        }
Пример #6
0
 public static void Ddl_SelectItem(Telerik.Web.UI.RadComboBox Ddl, string Value)
 {
     if (Ddl.Items.FindItemByValue(Value) != null)
     {
         Ddl.SelectedIndex = Ddl.Items.IndexOf(Ddl.Items.FindItemByValue(Value));
     }
     else if (Ddl.Items.Count > 0)
     {
         Ddl.SelectedIndex = 0;
     }
 }
Пример #7
0
        protected void EntityContactInformationHistoryGrid_OnItemCreated(Object sender, Telerik.Web.UI.GridItemEventArgs eventArgs)
        {
            if (MercuryApplication == null)
            {
                return;
            }


            if (eventArgs.Item is Telerik.Web.UI.GridCommandItem)
            {
                AllowUserInteraction = AllowUserInteraction && (

                    (MercuryApplication.HasEnvironmentPermission(Mercury.Server.EnvironmentPermissions.MemberContactInformationManage))

                    );
            }

            if ((eventArgs.Item is Telerik.Web.UI.GridEditableItem) && (eventArgs.Item.IsInEditMode))
            {
                Telerik.Web.UI.GridEditableItem item = (Telerik.Web.UI.GridEditableItem)eventArgs.Item;

                Telerik.Web.UI.RadComboBox EntityContactInformationEditContactType = (Telerik.Web.UI.RadComboBox)item.FindControl("EntityContactInformationEditContactType");

                Telerik.Web.UI.RadDatePicker effectiveDatePicker = (Telerik.Web.UI.RadDatePicker)item.FindControl("EntityContactInformationEditEffectiveDate");

                Telerik.Web.UI.RadDatePicker terminationDatePicker = (Telerik.Web.UI.RadDatePicker)item.FindControl("EntityContactInformationEditTerminationDate");

                if (eventArgs.Item.OwnerTableView.IsItemInserted)
                {
                    // ITEM TO BE INSERTED, SET INITIAL SETTINGS FOR THE INSERT

                    effectiveDatePicker.SelectedDate = DateTime.Today;
                }

                else
                {
                    // ITEM TO BE EDITED, VALUES ARE DATA BOUND IN THE TEMPLATE DEFINITION UNDER ASP


                    EntityContactInformationEditContactType.SelectedValue = item.GetDataKeyValue("ContactTypeInt32").ToString();

                    effectiveDatePicker.SelectedDate = Convert.ToDateTime(item.GetDataKeyValue("EffectiveDate"));

                    if (!Convert.ToDateTime(item.GetDataKeyValue("TerminationDate")).Equals(new DateTime(9999, 12, 31)))
                    {
                        terminationDatePicker.SelectedDate = Convert.ToDateTime(item.GetDataKeyValue("TerminationDate"));
                    }
                }
            }

            return;
        }
        protected void MemberServicesGrid_OnItemCreated(Object sender, Telerik.Web.UI.GridItemEventArgs eventArgs)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            if (eventArgs.Item is Telerik.Web.UI.GridCommandItem)
            {
                Telerik.Web.UI.GridCommandItem commandItem = (Telerik.Web.UI.GridCommandItem)eventArgs.Item;

                Telerik.Web.UI.RadToolBar MemberServiceToolbar = (Telerik.Web.UI.RadToolBar)commandItem.FindControl("MemberServiceToolbar");

                ((Telerik.Web.UI.RadToolBarButton)MemberServiceToolbar.Items[0]).Checked = MemberServiceShowHidden;

                Telerik.Web.UI.RadComboBox MemberServiceSelection = (Telerik.Web.UI.RadComboBox)MemberServiceToolbar.Items[2].FindControl("MemberServiceSelection");

                Telerik.Web.UI.RadDateInput MemberServiceEventDate = (Telerik.Web.UI.RadDateInput)MemberServiceToolbar.Items[2].FindControl("MemberServiceEventDate");

                if (MemberServiceSelection != null)
                {
                    if (MemberServiceSelection.Items.Count == 0)
                    {
                        MemberServiceSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem("** No Service Selected", String.Empty));

                        foreach (Mercury.Server.Application.SearchResultMedicalServiceHeader currentService in MercuryApplication.MedicalServiceHeadersGet(true))
                        {
                            if (currentService.Enabled)
                            {
                                MemberServiceSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem(currentService.Name, currentService.Id.ToString()));
                            }
                        }
                    }

                    MemberServiceSelection.SelectedValue = MemberServiceSelection_SelectedValue;
                }

                if (MemberServiceEventDate != null)
                {
                    if (Member != null)
                    {
                        MemberServiceEventDate.MinDate = Member.BirthDate;
                    }

                    MemberServiceEventDate.SelectedDate = MemberServiceEventDate_SelectedDate;
                }
            }

            return;
        }
Пример #9
0
        protected void EntityDocumentHistoryGrid_OnItemCommand(Object sender, Telerik.Web.UI.GridCommandEventArgs eventArgs)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            Telerik.Web.UI.RadToolBar EnterFormToolbar;

            String hrefLocation = String.Empty;

            switch (eventArgs.CommandName)
            {
            case "SendCorrespondence":

                hrefLocation = "/Application/Actions/SendCorrespondence.aspx?EntityId=" + Entity.Id.ToString();

                Response.Redirect(hrefLocation, true);

                break;

            case "EnterReceivedForm":

                EnterFormToolbar = (Telerik.Web.UI.RadToolBar)eventArgs.Item.FindControl("EntityDocumentToolbar");

                if (EnterFormToolbar != null)
                {
                    Telerik.Web.UI.RadToolBarItem toolbarItem = EnterFormToolbar.Items.FindItemByValue("EnterReceivedFormToolbarButton");

                    Telerik.Web.UI.RadComboBox FormSelection = (Telerik.Web.UI.RadComboBox)toolbarItem.FindControl("FormSelection");

                    if (!String.IsNullOrEmpty(FormSelection.SelectedValue))
                    {
                        hrefLocation = "/Application/Forms/FormDataEntry/FormDataEntry.aspx?EntityCorrespondenceId=0&FormId=" + FormSelection.SelectedValue + "&EntityId=" + Entity.Id.ToString();

                        Response.Redirect(hrefLocation, true);
                    }
                }

                break;

            default:

                System.Diagnostics.Debug.WriteLine("MemberMetricsGrid_OnItemCommand: " + eventArgs.CommandSource + " " + eventArgs.CommandName + " (" + eventArgs.CommandArgument + ")");

                break;
            }

            return;
        }
Пример #10
0
        protected void CarePlanInterventionGrid_OnItemCreated(Object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if ((e.Item is Telerik.Web.UI.GridEditableItem) && (e.Item.IsInEditMode))
            {
                if (MemberCaseCarePlan == null)
                {
                    return;
                }

                Telerik.Web.UI.GridEditableItem item = (Telerik.Web.UI.GridEditableItem)e.Item;


                Telerik.Web.UI.RadComboBox AddCarePlanInterventionExistingSelection = (Telerik.Web.UI.RadComboBox)item.FindControl("AddCarePlanInterventionExistingSelection");

                if (AddCarePlanInterventionExistingSelection == null)
                {
                    return;
                }

                AddCarePlanInterventionExistingSelection.DataSource = MercuryApplication.CareInterventionsAvailable(true);

                AddCarePlanInterventionExistingSelection.DataTextField = "Name";

                AddCarePlanInterventionExistingSelection.DataValueField = "Id";


                Telerik.Web.UI.RadComboBox AddCarePlanInterventionCareMeasureSelection = (Telerik.Web.UI.RadComboBox)item.FindControl("AddCarePlanInterventionCareMeasureSelection");

                if (AddCarePlanInterventionCareMeasureSelection == null)
                {
                    return;
                }

                AddCarePlanInterventionCareMeasureSelection.DataSource = MercuryApplication.CareMeasuresAvailableEnabledVisible(true);

                AddCarePlanInterventionCareMeasureSelection.DataTextField = "Name";

                AddCarePlanInterventionCareMeasureSelection.DataValueField = "Id";
            }

            return;
        }
Пример #11
0
        private void InitializeSelectedCarePlanSeverity()
        {
            // GET REFERENCE TO CURRENT CASE CARE LEVEL SEVERITY SELECTION RAD COMBO BOX

            Telerik.Web.UI.RadComboBox currentCaseCareLevelSeveritySelection = (Telerik.Web.UI.RadComboBox)CaseCareLevelSeveritySelection;

            // ADD NOT SPECIFIED SELECTED CARE PLAN SEVERITY RAD COMBO BOX ITEM

            Telerik.Web.UI.RadComboBoxItem notSpecifiedRadComboBoxItem = new Telerik.Web.UI.RadComboBoxItem("** Not Specified", "0");

            // ADD NEW RAD COMBO BOX ITEM TO ITEMS OF CURRENT CASE CARE LEVEL SEVERITY SELECTION RAD COMBO BOX

            currentCaseCareLevelSeveritySelection.Items.Add(notSpecifiedRadComboBoxItem);

            // LOOP THROUGH EACH CARE LEVEL IN CARE LEVELS AVAILABLE

            foreach (Client.Core.Individual.CareLevel currentCareLevel in MercuryApplication.CareLevelsAvailable(false))
            {
                // IF CURRENT CARE LEVEL IS ENABLED AND VISIBLE, THEN CREATE RAD COMBO BOX ITEM FOR CURRENT CARE LEVEL AND ADD TO ITEMS OF CURRENT CASE CARE LEVEL SEVERITY SELECTION RAD COMBO BOX

                if (currentCareLevel.Enabled && currentCareLevel.Visible)
                {
                    // CREATE REFERENCE TO NEW RAD COMBO BOX ITEM WITH VALUE AS ID OF CURRENT CARE LEVEL AND TEXT AS NAME OF CURRENT CARE LEVEL

                    Telerik.Web.UI.RadComboBoxItem newRadComboBoxItem = new Telerik.Web.UI.RadComboBoxItem(currentCareLevel.Name, currentCareLevel.Id.ToString());

                    // ADD NEW RAD COMBO BOX ITEM TO ITEMS OF CURRENT CASE CARE LEVEL SEVERITY SELECTION RAD COMBO BOX

                    currentCaseCareLevelSeveritySelection.Items.Add(newRadComboBoxItem);
                }
            } /* END FOREACH */

            // SET CURRENT CASE LEVEL SEVERITY OF SELECTED MEMBER CASE CARE PLAN

            //String severityValue = MemberCaseCarePlan.Severity.Value.ToString ();

            //String severityName = MemberCaseCarePlan.Severity.Text;



            return;
        }
        private void InitializeMemberCaseProblemClassProviderAssignment()
        {
            // LOOP THROUGH RAD LIST VIEW DATA ITEMS IN PROBLEM CLASS LIST VIEW RAD LIST VIEW

            foreach (Telerik.Web.UI.RadListViewDataItem currentProblemClassList in ProblemClassListView.Items)
            {
                // GET DATA KEY VALUE OF CURRENT PROBLEM CLASS LIST RAD LIST VIEW DATA ITEM

                Int64 dataKeyValue = (Int64)currentProblemClassList.GetDataKeyValue("Id");

                // GET REFERENCE TO PROBLEM CLASS ASSIGNED TO USER SELECTION RAD COMBO BOX

                Telerik.Web.UI.RadComboBox currentProblemClassAssignedToProviderSelection = (Telerik.Web.UI.RadComboBox)currentProblemClassList.FindControl("ProblemClassAssignedToProviderSelection");

                // LOOP THROUGH MEMBER CASE PROBLEM CLASSES IN MEMBER CASE

                foreach (Client.Core.Individual.Case.MemberCaseProblemClass currentMemberCaseProblemClass in Case.ProblemClasses)
                {
                    // IF ID OF CURRENT MEMBER CASE PROBLEM CLASS EQUALS DATA KEY VALUE, THEN PROCESS

                    if (currentMemberCaseProblemClass.Id == dataKeyValue)
                    {
                        // SET IS ASSIGNED TO PROVIDER CHANGE VISIBLE TO TRUE IF CURRENT MEMBER CASE PROBLEM CLASS IS ASSIGNED TO PROVIDER AND FALSE IF IT IS NOT

                        Boolean isAssignedToProviderChangeVisible = true;

                        // GET REFERENCE TO PROBLEM CLASS ASSIGNED TO PROVIDER LABEL

                        Label problemClassAssignedToProviderLabel = (Label)currentProblemClassList.FindControl("ProblemClassAssignedToProviderLabel");

                        // SET TEXT OF PROBLEM CLASS ASSIGNED TO PROVIDER LABEL AS CURRENT ASSIGNED PROVIDER NAME OR IF NOT ASSIGNED AS NOT ASSIGNED

                        problemClassAssignedToProviderLabel.Text = ((currentMemberCaseProblemClass.AssignedToProvider != null)) ? currentMemberCaseProblemClass.AssignedToProvider.Name : "** Not Assigned";

                        // GET REFERENCE TO PROBLEM CLASS ASSIGNED TO PROVIDER CHANGE LINK

                        System.Web.UI.HtmlControls.HtmlGenericControl problemClassAssignedToProviderChangeLink = (System.Web.UI.HtmlControls.HtmlGenericControl)currentProblemClassList.FindControl("ProblemClassAssignedToProviderChangeLink");

                        // SET DISPLAY STYLE OF PROBLEM CLASS ASSIGNED TO PROVIDER CHANGE LINK TO INLINE IF IS ASSIGNED TO PROVIDER CHANGE VISIBLE IS TRUE OR TO NONE IF IS ASSIGNED TO PROVIDER CHANGE LINK IS FALSE

                        problemClassAssignedToProviderChangeLink.Style.Add("display", ((isAssignedToProviderChangeVisible) ? "inline" : "none"));

                        // ADD NOT ASSIGNED RAD COMBO BOX ITEM TO CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION RAD COMBO BOX

                        currentProblemClassAssignedToProviderSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem("** Not Assigned", "0|" + currentMemberCaseProblemClass.Id));


                        // IF CURRENT MEMBER CASE PROBLEM CLASS DOES HAVE A PROVIDER ASSIGNED (ASSIGNED TO PROVIDER ID IS NOT 0), THEN ADD RAD COMBOX ITEM FOR ASSIGNED PROVIDER

                        if (currentMemberCaseProblemClass.AssignedToProviderId != 0)
                        {
                            // CLEAR ITEMS OF CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION RAD COMBO BOX

                            currentProblemClassAssignedToProviderSelection.Items.Clear();

                            // ADD NEW RAD COMBO BOX ITEM FOR CURRENT ASSIGNED TO PROVIDER TO ITEMS OF CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION RAD COMBO BOX

                            currentProblemClassAssignedToProviderSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem(currentMemberCaseProblemClass.AssignedToProvider.Name, currentMemberCaseProblemClass.AssignedToProviderId.ToString() + "|" + currentMemberCaseProblemClass.Id));

                            // ADD NOT ASSIGNED RAD COMBO BOX ITEM TO CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION RAD COMBO BOX

                            currentProblemClassAssignedToProviderSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem("** Not Assigned", "0|" + currentMemberCaseProblemClass.Id));
                        }

                        // IF CURRENT MEMBER CASE PROBLEM CLASS DOES NOT HAVE A PROVIDER ASSIGNED (ASSIGNED TO PROVIDER ID IS 0), THEN DO NOTHING

                        else
                        {
                            /* DO NOTHING */
                        }

                        break;
                    }
                } /* END FOREACH */
            }     /* END FOREACH */

            return;
        }
Пример #13
0
        protected void CarePlanInterventionGrid_OnItemCommand(Object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (MemberCaseCarePlan == null)
            {
                return;
            }

            Mercury.Server.Application.MemberCaseModificationResponse response;

            switch (e.CommandName)
            {
            case Telerik.Web.UI.RadGrid.InitInsertCommandName:

                break;

            case Telerik.Web.UI.RadGrid.PerformInsertCommandName:

                #region Perform Insert of New Intervention


                // RETREIVE REFERENCES TO ALL TEMPLATED CONTROLS

                RadioButtonList AddCarePlanInterventionTypeSelection = (RadioButtonList)e.Item.FindControl("AddCarePlanInterventionTypeSelection");

                if (AddCarePlanInterventionTypeSelection == null)
                {
                    return;
                }

                Telerik.Web.UI.RadTextBox AddCarePlanInterventionName = (Telerik.Web.UI.RadTextBox)e.Item.FindControl("AddCarePlanInterventionName");

                if (AddCarePlanInterventionName == null)
                {
                    return;
                }

                Telerik.Web.UI.RadComboBox AddCarePlanInterventionExistingSelection = (Telerik.Web.UI.RadComboBox)e.Item.FindControl("AddCarePlanInterventionExistingSelection");

                if (AddCarePlanInterventionExistingSelection == null)
                {
                    return;
                }


                Int64 selectedBaselineInterventionId = (AddCarePlanInterventionTypeSelection.SelectedValue == "0") ? Convert.ToInt64(AddCarePlanInterventionExistingSelection.SelectedValue) : 0;

                String carePlanInterventionName = (AddCarePlanInterventionTypeSelection.SelectedValue == "1") ? AddCarePlanInterventionName.Text : String.Empty;


                response = MercuryApplication.MemberCaseCarePlanIntervention_Add(ParentMemberCasePage.Case, MemberCaseCarePlan.Id, selectedBaselineInterventionId, carePlanInterventionName);

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

                else
                {
                    ParentMemberCasePage.Case = new Client.Core.Individual.Case.MemberCase(MercuryApplication, response.MemberCase);
                }


                #endregion

                break;

            case Telerik.Web.UI.RadGrid.DeleteCommandName:

                //response = MercuryApplication.MemberCaseCarePlanIntervention_Delete (ParentMemberCasePage.Case, CarePlan.Interventions[e.Item.ItemIndex].Id);

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

                //else { ParentMemberCasePage.Case = new Client.Core.Individual.Case.MemberCase (MercuryApplication, response.MemberCase); }

                break;

            case Telerik.Web.UI.RadGrid.CancelCommandName:

            case Telerik.Web.UI.RadGrid.RebindGridCommandName:

                //CarePlanInterventionGrid.DataSource = CarePlan.Interventions;

                //CarePlanInterventionGrid.DataBind ();

                CarePlanInterventionGrid.Rebind();

                break;

            default:

                break;
            }

            return;
        }
        protected void WorkQueueItemsGrid_OnNeedDataSource(Object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            if (!e.IsFromDetailTable)
            {
                // MASTER TABLE VIEW NEEDS DATA SOURCE

                switch (e.RebindReason)
                {
                case Telerik.Web.UI.GridRebindReason.InitialLoad:

                case Telerik.Web.UI.GridRebindReason.ExplicitRebind:

                case Telerik.Web.UI.GridRebindReason.PostBackEvent:                 // ALL DATA IS PRE-LOADED

                case Telerik.Web.UI.GridRebindReason.PostbackViewStateNotPersisted: // ALL DATA IS PRE-LOADED


                    Int64 filteredItems = 0;

                    Int64 totalItems = 0;

                    Int32 filterNodeState;


                    List <Mercury.Server.Application.DataFilterDescriptor> filters = new List <Mercury.Server.Application.DataFilterDescriptor> ();

                    filters.Add(MercuryApplication.CreateFilterDescriptor("WorkQueueId", Mercury.Server.Application.DataFilterOperator.IsEqualTo, WorkQueueSelected.Id));


                    totalItems = MercuryApplication.WorkQueueItemsGetCount(filters, false);

                    #region Create Filters from Selections

                    filterNodeState = FilterNodeState("FilterIsCompleted");

                    if (filterNodeState != 1)
                    {
                        filters.Add(MercuryApplication.CreateFilterDescriptor("IsCompleted", Mercury.Server.Application.DataFilterOperator.IsEqualTo, (filterNodeState == 2)));
                    }

                    filterNodeState = FilterNodeState("FilterIsAssigned");

                    if (filterNodeState != 1)
                    {
                        filters.Add(MercuryApplication.CreateFilterDescriptor("IsAssigned", Mercury.Server.Application.DataFilterOperator.IsEqualTo, (filterNodeState == 2)));
                    }

                    filterNodeState = FilterNodeState("FilterHasConstraintDatePassed");

                    if (filterNodeState != 1)
                    {
                        filters.Add(MercuryApplication.CreateFilterDescriptor("HasConstraintDatePassed", Mercury.Server.Application.DataFilterOperator.IsEqualTo, (filterNodeState == 2)));
                    }

                    filterNodeState = FilterNodeState("FilterHasThresholdDatePassed");

                    if (filterNodeState != 1)
                    {
                        filters.Add(MercuryApplication.CreateFilterDescriptor("HasThresholdDatePassed", Mercury.Server.Application.DataFilterOperator.IsEqualTo, (filterNodeState == 2)));
                    }

                    filterNodeState = FilterNodeState("FilterHasDueDatePassed");

                    if (filterNodeState != 1)
                    {
                        filters.Add(MercuryApplication.CreateFilterDescriptor("HasDueDatePassed", Mercury.Server.Application.DataFilterOperator.IsEqualTo, (filterNodeState == 2)));
                    }

                    filterNodeState = FilterNodeState("FilterWithinWorkTimeRestrictions");

                    if (filterNodeState != 1)
                    {
                        filters.Add(MercuryApplication.CreateFilterDescriptor("WithinWorkTimeRestrictions", Mercury.Server.Application.DataFilterOperator.IsEqualTo, (filterNodeState == 2)));
                    }


                    if (FilterNodeState("FilterWorkQueueItemName") == 1)
                    {
                        Telerik.Web.UI.RadComboBox FilterWorkQueueItemNameOperatorSelection = (Telerik.Web.UI.RadComboBox)

                                                                                                  ((Telerik.Web.UI.RadTreeView)BasicFiltersSelection.Items[0].FindControl("BasicFiltersTreeView")).FindNodeByValue("FilterWorkQueueItemName").FindControl("FilterWorkQueueItemNameOperatorSelection");

                        Telerik.Web.UI.RadTextBox FilterWorkQueueItemNameValue = (Telerik.Web.UI.RadTextBox)

                                                                                     ((Telerik.Web.UI.RadTreeView)BasicFiltersSelection.Items[0].FindControl("BasicFiltersTreeView")).FindNodeByValue("FilterWorkQueueItemName").FindControl("FilterWorkQueueItemNameValue");


                        switch (FilterWorkQueueItemNameOperatorSelection.SelectedValue)
                        {
                        case "Contains": filters.Add(MercuryApplication.CreateFilterDescriptor("Name", Mercury.Server.Application.DataFilterOperator.Contains, FilterWorkQueueItemNameValue.Text)); break;

                        case "StartsWith": filters.Add(MercuryApplication.CreateFilterDescriptor("Name", Mercury.Server.Application.DataFilterOperator.StartsWith, FilterWorkQueueItemNameValue.Text)); break;

                        case "EndsWith": filters.Add(MercuryApplication.CreateFilterDescriptor("Name", Mercury.Server.Application.DataFilterOperator.EndsWith, FilterWorkQueueItemNameValue.Text)); break;
                        }
                    }

                    if (FilterNodeState("FilterAssignedToDisplayName") == 1)
                    {
                        Telerik.Web.UI.RadComboBox FilterAssignedToDisplayNameOperatorSelection = (Telerik.Web.UI.RadComboBox)

                                                                                                      ((Telerik.Web.UI.RadTreeView)BasicFiltersSelection.Items[0].FindControl("BasicFiltersTreeView")).FindNodeByValue("FilterAssignedToDisplayName").FindControl("FilterAssignedToDisplayNameOperatorSelection");

                        Telerik.Web.UI.RadTextBox FilterAssignedToDisplayNameValue = (Telerik.Web.UI.RadTextBox)

                                                                                         ((Telerik.Web.UI.RadTreeView)BasicFiltersSelection.Items[0].FindControl("BasicFiltersTreeView")).FindNodeByValue("FilterAssignedToDisplayName").FindControl("FilterAssignedToDisplayNameValue");


                        switch (FilterAssignedToDisplayNameOperatorSelection.SelectedValue)
                        {
                        case "Contains": filters.Add(MercuryApplication.CreateFilterDescriptor("AssignedToUserDisplayName", Mercury.Server.Application.DataFilterOperator.Contains, FilterAssignedToDisplayNameValue.Text)); break;

                        case "StartsWith": filters.Add(MercuryApplication.CreateFilterDescriptor("AssignedToUserDisplayName", Mercury.Server.Application.DataFilterOperator.StartsWith, FilterAssignedToDisplayNameValue.Text)); break;

                        case "EndsWith": filters.Add(MercuryApplication.CreateFilterDescriptor("AssignedToUserDisplayName", Mercury.Server.Application.DataFilterOperator.EndsWith, FilterAssignedToDisplayNameValue.Text)); break;
                        }
                    }
                    #endregion


                    // UPDATE COUNT

                    filteredItems = MercuryApplication.WorkQueueItemsGetCount(WorkQueueViewSelected, filters, false);

                    WorkQueueItemsAvailableCount.Text = filteredItems.ToString() + " / " + totalItems.ToString();

                    WorkQueueItemsGrid.VirtualItemCount = Convert.ToInt32(filteredItems);


                    List <Mercury.Server.Application.DataSortDescriptor> sorts = new List <Server.Application.DataSortDescriptor> ();

                    foreach (Telerik.Web.UI.GridSortExpression currentSortExpression in WorkQueueItemsGrid.MasterTableView.SortExpressions)
                    {
                        switch (currentSortExpression.SortOrder)
                        {
                        case Telerik.Web.UI.GridSortOrder.Ascending:

                        case Telerik.Web.UI.GridSortOrder.Descending:

                            sorts.Add(MercuryApplication.CreateSortDescription(currentSortExpression.FieldName, ((currentSortExpression.SortOrder == Telerik.Web.UI.GridSortOrder.Ascending) ? Mercury.Server.Application.DataSortDirection.Ascending : Mercury.Server.Application.DataSortDirection.Descending)));

                            break;
                        }
                    }


                    Int32 initialRow = (WorkQueueItemsGrid.CurrentPageIndex * WorkQueueItemsGrid.PageSize) + 1;

                    List <Client.Core.Work.WorkQueueItem> workQueueItems = MercuryApplication.WorkQueueItemsGetByViewPage(WorkQueueViewSelected, filters, sorts, initialRow, WorkQueueItemsGrid.PageSize, false);

                    WorkQueueItemsGrid.DataSource = workQueueItems;

                    break;

                default:

                    System.Diagnostics.Debug.WriteLine("Unhandled Master Rebind Reason: " + e.RebindReason);

                    break;
                }
            }

            else   // DETAIL TABLE NEEDS DATA SOURCE

            {
                WorkQueueItemsGrid.MasterTableView.DetailTables[0].DataSource = WorkQueueItemSenders;
            }

            return;
        }
        protected void MemberMetricsGrid_OnNeedDataSource(Object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs eventArgs)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            System.Data.DataTable memberMetricsDataTable = MemberMetricsGrid_DataTable;

            if (!eventArgs.IsFromDetailTable)
            {
                switch (eventArgs.RebindReason)
                {
                case Telerik.Web.UI.GridRebindReason.InitialLoad:

                    #region Initialize Grid

                    MemberMetricsGrid_Count = 0;

                    MemberMetricsGrid_CurrentPage = 0;

                    MemberMetricsGrid_PageSize = 10;


                    MemberMetricsGrid.CurrentPageIndex = MemberMetricsGrid_CurrentPage;

                    MemberMetricsGrid.PageSize = MemberMetricsGrid_PageSize;

                    MemberMetricsGrid.VirtualItemCount = MemberMetricsGrid_Count;

                    #endregion

                    break;

                case Telerik.Web.UI.GridRebindReason.PostbackViewStateNotPersisted:

                    #region Restore Grid State

                    MemberMetricsGrid.CurrentPageIndex = MemberMetricsGrid_CurrentPage;

                    MemberMetricsGrid.PageSize = MemberMetricsGrid_PageSize;

                    MemberMetricsGrid.VirtualItemCount = MemberMetricsGrid_Count;


                    if (MemberMetricToolbar != null)
                    {
                        Telerik.Web.UI.RadComboBox MemberMetricSelection = (Telerik.Web.UI.RadComboBox)MemberMetricToolbar.Items[2].FindControl("MemberMetricSelection");

                        if (MemberMetricSelection != null)
                        {
                            MemberMetricSelection_SelectedValue = MemberMetricSelection.SelectedValue;
                        }

                        Telerik.Web.UI.RadDateInput MemberMetricEventDate = (Telerik.Web.UI.RadDateInput)MemberMetricToolbar.Items[2].FindControl("MemberMetricEventDate");

                        if (MemberMetricEventDate != null)
                        {
                            MemberMetricEventDate_SelectedDate = MemberMetricEventDate.SelectedDate;
                        }

                        Telerik.Web.UI.RadNumericTextBox MemberMetricValue = (Telerik.Web.UI.RadNumericTextBox)MemberMetricToolbar.Items[2].FindControl("MemberMetricValue");

                        if (MemberMetricValue != null)
                        {
                            MemberMetricValue_SelectedValue = MemberMetricValue.Value;
                        }
                    }

                    #endregion

                    break;

                case Telerik.Web.UI.GridRebindReason.ExplicitRebind:

                case Telerik.Web.UI.GridRebindReason.PostBackEvent:

                    #region Initialize Toolbar and Security

                    if (MemberMetricToolbar != null)
                    {
                        MemberMetricToolbar.Items[1].Visible = MercuryApplication.HasEnvironmentPermission(Mercury.Server.EnvironmentPermissions.MemberMetricManage);

                        MemberMetricToolbar.Items[2].Visible = MercuryApplication.HasEnvironmentPermission(Mercury.Server.EnvironmentPermissions.MemberMetricManage);
                    }

                    #endregion

                    #region Rebind Grid

                    if (Member == null)
                    {
                        memberMetricsDataTable.Rows.Clear();
                    }

                    else
                    {
                        if (MemberMetricsGrid_Count == 0)
                        {
                            MemberMetricsGrid_Count = Convert.ToInt32(MercuryApplication.MemberMetricsGetCount(Member.Id, MemberMetricShowHidden));

                            MemberMetricsGrid.VirtualItemCount = MemberMetricsGrid_Count;
                        }

                        MemberMetricsGrid_PageSize = MemberMetricsGrid.PageSize;

                        MemberMetricsGrid_CurrentPage = MemberMetricsGrid.CurrentPageIndex;

                        memberMetricsDataTable.Rows.Clear();

                        List <Mercury.Server.Application.MemberMetric> memberMetrics;

                        memberMetrics = MercuryApplication.MemberMetricsGetByPage(Member.Id, (MemberMetricsGrid.CurrentPageIndex) * MemberMetricsGrid.PageSize + 1, MemberMetricsGrid.PageSize, MemberMetricShowHidden);

                        foreach (Mercury.Server.Application.MemberMetric currentMetric in memberMetrics)
                        {
                            memberMetricsDataTable.Rows.Add(

                                currentMetric.Id.ToString(),

                                currentMetric.Metric.Name,

                                currentMetric.Metric.MetricType,

                                currentMetric.MetricValue.ToString(),

                                currentMetric.EventDate.ToString("MM/dd/yyyy"),

                                currentMetric.AddedManually.ToString(),

                                currentMetric.CreateAccountInfo.UserAccountName,

                                currentMetric.CreateAccountInfo.ActionDate.ToString("MM/dd/yyyy")

                                );
                        }
                    }

                    #endregion

                    break;

                default:

                    System.Diagnostics.Debug.WriteLine(eventArgs.RebindReason + " [" + eventArgs.IsFromDetailTable.ToString() + "]");

                    break;
                }

                MemberMetricsGrid_DataTable = memberMetricsDataTable;

                MemberMetricsGrid.DataSource = MemberMetricsGrid_DataTable;
            }

            return;
        }
Пример #16
0
        protected void Page_Prerender(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                for (int i = 1; i < RowCount; i++)
                {
                    HideRow(i);
                }
                if (mWhereCriteriaUpdated && mWhereCriteria.Count > 0)
                {
                    for (int i = 0; i < mWhereCriteria.Count; i++)
                    {
                        var c = mWhereCriteria[i];
                        ShowRow(i);
                        if (i > 0)
                        {
                            HideListManager(i - 1);
                        }

                        RepeaterItem it = rpWhere.Items[i];

                        ColumnSelect    csWhere   = (ColumnSelect)it.FindControl("csWhere");
                        ConditionSelect Condition = (ConditionSelect)it.FindControl("Condition");
                        PlaceHolder     phValue   = (PlaceHolder)it.FindControl("phValue");
                        System.Web.UI.WebControls.TextBox tbValue  = (System.Web.UI.WebControls.TextBox)it.FindControl("tbValue");
                        Telerik.Web.UI.RadComboBox        rcbValue = (Telerik.Web.UI.RadComboBox)it.FindControl("rcbValue");
                        Telerik.Web.UI.RadNumericTextBox  rnValue  = (Telerik.Web.UI.RadNumericTextBox)it.FindControl("rnValue");

                        tbValue.Visible  = false;
                        rcbValue.Visible = false;
                        rnValue.Visible  = false;

                        csWhere.Select(c.TableName, c.ColumnName);
                        string OutTable;
                        string OutColumn;
                        string TextColumn;
                        string SelectControl;
                        if (!csWhere.SelectedField(DataViewTypeID, out OutTable, out OutColumn, out TextColumn, out SelectControl))
                        {
                            continue;
                        }

                        Type t = typeof(MetricTrac.Bll.LinqMicajahEntitybase).Assembly.GetType("MetricTrac.Bll." + c.TableName);
                        if (t == null)
                        {
                            continue;
                        }

                        System.Reflection.PropertyInfo pi = t.GetProperty(c.ColumnName);
                        if (pi == null)
                        {
                            continue;
                        }

                        if (SelectControl != null)
                        {
                            Condition.Mode = ConditionSelect.ConditionViewMode.Equal;
                            foreach (Panel p in phValue.Controls)
                            {
                                if (p.ID != System.IO.Path.GetFileNameWithoutExtension(SelectControl))
                                {
                                    continue;
                                }
                                if (!(p.Controls[0] is MetricTrac.Utils.IValueSelectControl))
                                {
                                    continue;
                                }
                                MetricTrac.Utils.IValueSelectControl iv = (MetricTrac.Utils.IValueSelectControl)p.Controls[0];
                                iv.SelectedValue = c.CompareValue;
                                p.Style[HtmlTextWriterStyle.Display] = "block";
                                break;
                            }

                            continue;
                        }

                        if (pi.PropertyType == typeof(string))
                        {
                            Condition.Mode  = ConditionSelect.ConditionViewMode.Like;
                            tbValue.Visible = true;
                            tbValue.Text    = c.CompareValue;
                            continue;
                        }
                        if (pi.PropertyType == typeof(Guid) || pi.PropertyType == typeof(Guid?))
                        {
                            Condition.Mode          = ConditionSelect.ConditionViewMode.Equal;
                            rcbValue.Visible        = true;
                            rcbValue.DataValueField = c.ColumnName;
                            rcbValue.DataTextField  = TextColumn;
                            rcbValue.DataSource     = MetricTrac.Bll.LinqMicajahDataContext.SelectGuid(c.TableName, c.ColumnName, TextColumn);
                            rcbValue.DataBind();
                            rcbValue.SelectedValue = c.CompareValue;
                            continue;
                        }

                        foreach (Type nt in NumericType)
                        {
                            if (pi.PropertyType == nt)
                            {
                                Condition.Mode  = ConditionSelect.ConditionViewMode.Compare;
                                rnValue.Visible = true;
                                double v;
                                if (!double.TryParse(c.CompareValue, out v))
                                {
                                    continue;
                                }
                                rnValue.Value = v;
                                continue;
                            }
                        }

                        Condition.Mode  = ConditionSelect.ConditionViewMode.All;
                        tbValue.Visible = true;
                    }
                    ShowListManager(mWhereCriteria.Count - 1);
                }
                else
                {
                    ShowRow(0);
                    ShowRow(1);
                    ShowRow(2);
                    HideListManager(0);
                    HideListManager(1);
                    ShowListManager(2);
                }
            }
        }
Пример #17
0
        public void AgregarSeleccioneCombo(Telerik.Web.UI.RadComboBox Combo, string Descripcion)
        {
            string Texto = "Seleccione " + Descripcion;

            Combo.Items.Insert(0, Texto);
        }
        public void ProblemClassAssignedToProviderSaveLink_OnClick(Object sender, EventArgs e)
        {
            // GET REFERENCE TO CURRENT SAVE LINK BUTTON

            System.Web.UI.WebControls.LinkButton currentSaveLinkButton = (System.Web.UI.WebControls.LinkButton)sender;

            // GET REFERENCE TO CURRENT PROBLEM CLASS RAD LIST VIEW ITEM

            Telerik.Web.UI.RadListViewItem currentProblemClassRadListViewItem = (Telerik.Web.UI.RadListViewItem)currentSaveLinkButton.Parent;

            // GET REFERENCE TO CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION RAD COMBO BOX

            Telerik.Web.UI.RadComboBox currentProblemClassAssignedToProviderSelection = (Telerik.Web.UI.RadComboBox)currentProblemClassRadListViewItem.FindControl("ProblemClassAssignedToProviderSelection");

            // CREATE REFERENCE TO SELECTED PROVIDER ID AND DEFAULT IT TO 0

            Int64 selectedProviderId = 0;

            // IF SELECTED VALUE OF CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION RAD COMBO BOX IS NOT AN EMPTY STRING, THEN TRY TO PARSE SELECTED VALUE TO INT64

            if (currentProblemClassAssignedToProviderSelection.SelectedValue != "")
            {
                // SET SELECTED VALUE AS SELECTED VALUE OF CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION

                String selectedValue = currentProblemClassAssignedToProviderSelection.SelectedValue;

                // CREATE REFERENCE TO PARSED SELECTED PROVIDER ID AND DEFAULT IT TO 0

                Int64 parsedSelectedProviderId = 0;

                // IF SELECTED VALUE OF CURRENT PROBLAM CLASS ASSIGNED TO PROVIDER SELECTION CAN BE PARSED AS AN INT64, THEN SET SELECTED PROVIDER ID TO PARSED VALUE OF SELECTED VALUE OF CURRENT PROBLAM CLASS ASSIGNED TO PROVIDER SELECTION

                if (Int64.TryParse(selectedValue.Split('|')[0], out (parsedSelectedProviderId)))
                {
                    // SET SELECTED PROVIDER ID TO PARSED VALUE OF SELECTED VALUE OF CURRENT PROBLAM CLASS ASSIGNED TO PROVIDER SELECTION

                    selectedProviderId = Convert.ToInt64(selectedValue.Split('|')[0]);
                }

                // CREATE REFERENCE TO MEMBER CASE PROBLEM CLASS ID

                Int64 memberCaseProblemClassId = 0;

                // CREATE REFERENCE TO PARSED MEMBER CASE PROBLEM CLASS ID

                Int64 parsedMemberCaseProblemClassId = 0;

                // TRY TO PARSE FIRST INDEX OF SPIT STRING OF SELECTED VALUE AS INT64

                if (Int64.TryParse(selectedValue.Split('|')[1], out (parsedMemberCaseProblemClassId)))
                {
                    // SET MEMBER CASE PROBLEM CLASS ID TO INT64 OF FIRST INDEX OF SPLIT STRING OF SELECTED VALUE

                    memberCaseProblemClassId = Convert.ToInt64(selectedValue.Split('|')[1]);
                }

                // IF UNASSIGNING PROVIDER FOR MEMBER CASE PROBLEM CLASS (SELECTED PTOVIDER ID IS 0),

                if (selectedProviderId == 0)
                {
                    // CREATE REFERENCE TO MEMBER CASE MODIFICATION RESPONSE

                    Mercury.Server.Application.MemberCaseModificationResponse response = new Mercury.Server.Application.MemberCaseModificationResponse();

                    // ASSIGN MEMBER CASE PROBLEM CLASS TO PROVIDER

                    response = MercuryApplication.MemberCaseProblemClass_AssignToProvider(Case, memberCaseProblemClassId, selectedProviderId);

                    // IF RESPOSNE IS NOT NULL, THEN EVALUATE IF EXCEPTION EXISTS

                    if (response != null)
                    {
                        // IF RESPONSE HAS EXCEPTION, THEN SET EXCEPTION MESSAGE OF PARENT MEMBER CASE PAGE AS MESAGE OF EXCEPTION OF RESPONSE

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

                        // UPDATE FORM FROM UPDATED CASE RECEVIED THROUGH RESPONSE

                        if (response.MemberCase != null)
                        {
                            // RELOAD MEMBER CASE

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

                // IF ASSIGNING PROVIDER FOR MEMBER CASE PROBLEM CLASS (SELECTED PROVIDER ID IS NOT 0),

                else
                {
                    // GET REFERENCE TO MEMBER CASE MODIFICATION REPONSE

                    Mercury.Server.Application.MemberCaseModificationResponse response = new Mercury.Server.Application.MemberCaseModificationResponse();

                    // TRY TO ASSIGN MEMBER CASE PROBLEM CLASS TO PROVIDER

                    response = MercuryApplication.MemberCaseProblemClass_AssignToProvider(Case, memberCaseProblemClassId, selectedProviderId);

                    // IF RESPOSNE IS NOT NULL, THEN EVALUATE IF EXCEPTION EXISTS

                    if (response != null)
                    {
                        // IF RESPONSE HAS EXCEPTION, THEN SET EXCEPTION MESSAGE OF PARENT MEMBER CASE PAGE AS MESAGE OF EXCEPTION OF RESPONSE

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

                        // UPDATE FORM FROM UPDATED CASE RECEVIED THROUGH RESPONSE

                        if (response.MemberCase != null)
                        {
                            // RELOAD MEMBER CASE

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

            return;
        }
Пример #19
0
        protected void EntityDocumentHistoryGrid_OnNeedDataSource(Object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs eventArgs)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            System.Data.DataTable dataTable = EntityDocumentHistoryGrid_DataTable;


            switch (eventArgs.RebindReason)
            {
            case Telerik.Web.UI.GridRebindReason.InitialLoad:

                #region Initialize Grid

                EntityDocumentHistoryGrid_Count = 0;

                EntityDocumentHistoryGrid_CurrentPage = 0;

                EntityDocumentHistoryGrid_PageSize = 10;


                EntityDocumentHistoryGrid.CurrentPageIndex = EntityDocumentHistoryGrid_CurrentPage;

                EntityDocumentHistoryGrid.PageSize = EntityDocumentHistoryGrid_PageSize;

                EntityDocumentHistoryGrid.VirtualItemCount = EntityDocumentHistoryGrid_Count;

                #endregion

                break;

            case Telerik.Web.UI.GridRebindReason.PostbackViewStateNotPersisted:

                #region Restore Grid State

                if (EntityDocumentHistoryGrid_CurrentPage >= 0)
                {
                    EntityDocumentHistoryGrid.CurrentPageIndex = EntityDocumentHistoryGrid_CurrentPage;
                }

                EntityDocumentHistoryGrid.PageSize = EntityDocumentHistoryGrid_PageSize;

                EntityDocumentHistoryGrid.VirtualItemCount = EntityDocumentHistoryGrid_Count;


                if (EntityDocumentToolbar != null)
                {
                    Telerik.Web.UI.RadToolBarItem toolbarItem = EntityDocumentToolbar.Items.FindItemByValue("EnterReceivedFormToolbarButton");

                    Telerik.Web.UI.RadComboBox FormSelection = (Telerik.Web.UI.RadComboBox)toolbarItem.FindControl("FormSelection");

                    if (FormSelection != null)
                    {
                        FormSelection_SelectedValue = FormSelection.SelectedValue;
                    }
                }

                #endregion

                break;

            case Telerik.Web.UI.GridRebindReason.ExplicitRebind:

            case Telerik.Web.UI.GridRebindReason.PostBackEvent:

                #region Rebind Grid

                if (Entity == null)
                {
                    dataTable.Rows.Clear();
                }

                else
                {
                    if (EntityDocumentHistoryGrid_Count == 0)
                    {
                        EntityDocumentHistoryGrid_Count = Convert.ToInt32(MercuryApplication.EntityDocumentsGetCount(Entity.Id));

                        EntityDocumentHistoryGrid.VirtualItemCount = Convert.ToInt32(EntityDocumentHistoryGrid_Count);
                    }

                    if (!pageSizeChanged)
                    {
                        EntityDocumentHistoryGrid_PageSize = EntityDocumentHistoryGrid.PageSize;
                    }

                    else
                    {
                        EntityDocumentHistoryGrid.PageSize = EntityDocumentHistoryGrid_PageSize;

                        pageSizeChanged = false;
                    }


                    EntityDocumentHistoryGrid_CurrentPage = EntityDocumentHistoryGrid.CurrentPageIndex;

                    dataTable.Rows.Clear();

                    List <Mercury.Server.Application.EntityDocumentDataView> entityDocuments;

                    Int32 initialRow = EntityDocumentHistoryGrid.CurrentPageIndex * EntityDocumentHistoryGrid.PageSize + 1;

                    entityDocuments = MercuryApplication.EntityDocumentsGetByPage(Entity.Id, initialRow, EntityDocumentHistoryGrid.PageSize);

                    foreach (Mercury.Server.Application.EntityDocumentDataView currentDocument in entityDocuments)
                    {
                        #region Create Data Row

                        String detail = String.Empty;

                        String markSent = "&nbsp";

                        String markReceived = "&nbsp";

                        String markReturned = "&nbsp";

                        String automation = "&nbsp";

                        String relatedEntity = String.Empty;


                        if (currentDocument.DocumentType == "Correspondence")
                        {
                            Client.Core.Reference.Correspondence correspondence = MercuryApplication.CorrespondenceGet(currentDocument.DocumentId, true);


                            if ((currentDocument.HasImage) || (correspondence.Content.Count > 0))
                            {
                                detail = "<a href=\"javascript:void(0);\" onclick=\"javascript:window.open ('/Application/Common/Image.aspx?ObjectType=EntityCorrespondence&ObjectId=" + currentDocument.EntityDocumentId.ToString() + "&Render=true', '_blank', 'toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=1, resizable=1');\"><img src=\"/Images/Common16/Document.png\" border=\"0\" /></a>";
                            }


                            if (currentDocument.SentDate.HasValue)
                            {
                                markSent = currentDocument.SentDate.Value.ToString("MM/dd/yyyy");

                                if (currentDocument.ReturnedDate.HasValue)
                                {
                                    markReturned = currentDocument.ReturnedDate.Value.ToString("MM/dd/yyyy");
                                }

                                else if ((!currentDocument.ReceivedDate.HasValue) && (correspondence != null))
                                {
                                    markReturned = " <a href=\"javascript:Correspondence_MarkReturned (" + currentDocument.EntityDocumentId.ToString() + ", '" + correspondence.Name + "', '" + currentDocument.SentDate.Value.ToString("MM/dd/yyyy") + "')\" title=\"Mark the correspondence as returned as undeliverable.\">(mark returned)</a>";
                                }
                            }

                            else
                            {
                                markSent = " <a href=\"javascript:Correspondence_MarkSent (" + currentDocument.EntityDocumentId.ToString() + ", '" + correspondence.Name + "', '" + currentDocument.ReadyToSendDate.Value.ToString("MM/dd/yyyy") + "')\">(mark sent)</a>";
                            }


                            // MCM-1175: Received Date was not visible unless the sent date had a value. This was not true for

                            // inbound correspondence only. Moved the received date setter outside.

                            if (currentDocument.ReceivedDate.HasValue)
                            {
                                markReceived = currentDocument.ReceivedDate.Value.ToString("MM/dd/yyyy");
                            }

                            // ALLOW DATA ENTRY ON THOSE OUTBOUND CORRESPONDENCE THAT HAVE BEEN SENT

                            else if ((currentDocument.SentDate.HasValue) && (!currentDocument.ReturnedDate.HasValue) && (correspondence.FormId != 0) && (currentDocument.EntityFormId == 0))
                            {
                                markReceived = " <a href=\"/Application/Forms/FormDataEntry/FormDataEntry.aspx?EntityCorrespondenceId=" + currentDocument.EntityDocumentId.ToString() + "&formid=" + correspondence.FormId.ToString() + "\">(received - data enter)</a>";
                            }


                            // TODO: MOVE AUTOMATION INTO THE DATA VIEW

                            Client.Core.Entity.EntityCorrespondence entityCorrespondence = MercuryApplication.EntityCorrespondenceGet(currentDocument.EntityDocumentId, true);

                            if (entityCorrespondence != null)
                            {
                                String automationTitle = ((entityCorrespondence.AutomationDate.HasValue) ? "[" + entityCorrespondence.AutomationDate.Value.ToString("MM/dd/yyyy") + "] " : String.Empty);

                                automationTitle += entityCorrespondence.AutomationStatus.ToString();

                                automationTitle += (!String.IsNullOrWhiteSpace(entityCorrespondence.AutomationException)) ? ": " + entityCorrespondence.AutomationException : String.Empty;

                                automation = "<span title=\"" + automationTitle + "\"><img src=\"/Images/Common16/Automation" + entityCorrespondence.AutomationStatus.ToString() + ".png\" /></span>";
                            }


                            if (entityCorrespondence.RelatedEntity != null)
                            {
                                relatedEntity = entityCorrespondence.RelatedEntity.Name;

                                switch (entityCorrespondence.RelatedEntity.EntityType)
                                {
                                case Mercury.Server.Application.EntityType.Member:

                                    relatedEntity = CommonFunctions.MemberProfileAnchor(entityCorrespondence.RelatedEntityId, relatedEntity).Replace("MemberId=", "EntityId=");

                                    break;

                                case Mercury.Server.Application.EntityType.Provider:

                                    relatedEntity = CommonFunctions.ProviderProfileAnchor(entityCorrespondence.RelatedEntityId, relatedEntity).Replace("ProviderId=", "EntityId=");

                                    break;
                                }
                            }
                        }

                        dataTable.Rows.Add(

                            detail,

                            currentDocument.DocumentType,

                            currentDocument.EntityDocumentId.ToString(),

                            currentDocument.DocumentId.ToString(),

                            currentDocument.EntityId.ToString(),

                            (currentDocument.DocumentType == "Form") ? CommonFunctions.FormAnchor(currentDocument.EntityDocumentId, currentDocument.Name) : currentDocument.Name,

                            String.Format("{0:0.00######}", currentDocument.Version),

                            ((currentDocument.ContactType != Mercury.Server.Application.EntityContactType.NotSpecified) ? Mercury.Server.CommonFunctions.EnumerationToString(currentDocument.ContactType) : String.Empty),

                            (currentDocument.ReadyToSendDate.HasValue) ? currentDocument.ReadyToSendDate.Value.ToString("MM/dd/yyyy") : "&nbsp",

                            markSent,

                            markReceived,

                            markReturned,

                            relatedEntity,

                            automation,

                            currentDocument.CreateAccountInfo.ActionDate.ToString(),

                            currentDocument.CreateAccountInfo.UserAccountName,

                            currentDocument.ModifiedAccountInfo.ActionDate.ToString(),

                            currentDocument.ModifiedAccountInfo.UserAccountName

                            );

                        #endregion
                    }
                }

                break;

                #endregion

            default:

                System.Diagnostics.Debug.WriteLine(eventArgs.RebindReason + " [" + eventArgs.IsFromDetailTable.ToString() + "]");

                break;
            }


            EntityDocumentHistoryGrid_DataTable = dataTable;

            EntityDocumentHistoryGrid.DataSource = EntityDocumentHistoryGrid_DataTable;

            return;
        }
Пример #20
0
        protected void EntityDocumentHistoryGrid_OnItemCreated(Object sender, Telerik.Web.UI.GridItemEventArgs eventArgs)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            if (eventArgs.Item is Telerik.Web.UI.GridCommandItem)
            {
                Telerik.Web.UI.GridCommandItem commandItem = (Telerik.Web.UI.GridCommandItem)eventArgs.Item;

                Telerik.Web.UI.RadToolBar EnterFormToolbar = (Telerik.Web.UI.RadToolBar)commandItem.FindControl("EntityDocumentToolbar");

                Telerik.Web.UI.RadToolBarItem toolbarItem;


                AllowUserInteraction = AllowUserInteraction && (

                    (MercuryApplication.HasEnvironmentPermission(Mercury.Server.EnvironmentPermissions.MemberActionSendCorrespondence))

                    || (MercuryApplication.HasEnvironmentPermission(Mercury.Server.EnvironmentPermissions.MemberActionDataEnterForm))

                    );


                if (!AllowUserInteraction)
                {
                    EnterFormToolbar.Visible = false;
                }


                // OVERRIDE TOOLBAR VISIBILTIY

                EnterFormToolbar.Visible = false;


                toolbarItem = EnterFormToolbar.Items.FindItemByValue("SendCorrespondence");

                toolbarItem.Visible = (MercuryApplication.HasEnvironmentPermission(Mercury.Server.EnvironmentPermissions.MemberActionSendCorrespondence));

                #region Enter Form

                toolbarItem = EnterFormToolbar.Items.FindItemByValue("EnterReceivedFormToolbarButton");

                toolbarItem.Visible = (MercuryApplication.HasEnvironmentPermission(Mercury.Server.EnvironmentPermissions.MemberActionDataEnterForm));

                Telerik.Web.UI.RadComboBox FormSelection = (Telerik.Web.UI.RadComboBox)toolbarItem.FindControl("FormSelection");

                if (FormSelection != null)
                {
                    if (FormSelection.Items.Count == 0)
                    {
                        FormSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem("** No Form Selected", String.Empty));

                        foreach (Mercury.Server.Application.SearchResultFormHeader currentForm in MercuryApplication.FormsAvailable(true))
                        {
                            if (currentForm.Enabled)
                            {
                                FormSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem(currentForm.Name, currentForm.Id.ToString()));
                            }
                        }
                    }

                    FormSelection.SelectedValue = FormSelection_SelectedValue;
                }

                #endregion
            }

            return;
        }
        protected void MemberServicesGrid_OnItemCommand(Object sender, Telerik.Web.UI.GridCommandEventArgs eventArgs)
        {
            if (MercuryApplication == null)
            {
                return;
            }


            System.Data.DataTable detailTable = null;

            Telerik.Web.UI.RadToolBar gridToolBar = null;

            Boolean success = false;

            String postScript = String.Empty;


            switch (eventArgs.CommandName)
            {
            case "ExpandCollapse":

                #region Expand/Collapse

                Telerik.Web.UI.GridDataItem gridItem = (Telerik.Web.UI.GridDataItem)eventArgs.Item;

                Int64 memberServiceId;

                if (Int64.TryParse(gridItem["MemberServiceId"].Text, out memberServiceId))
                {
                    switch (gridItem["ServiceType"].Text)
                    {
                    case "Singleton":

                        #region Singleton Detail Table

                        detailTable = MemberServicesGrid_DataTableSingletonTable;

                        detailTable.Rows.Clear();

                        List <Mercury.Server.Application.MemberServiceDetailSingleton> detailSingletons;

                        detailSingletons = MercuryApplication.MemberServiceDetailSingletonGet(memberServiceId);

                        foreach (Mercury.Server.Application.MemberServiceDetailSingleton currentDetail in detailSingletons)
                        {
                            // String principalDiagnosisInformation = "<span title=\"" + MercuryApplication.DiagnosisDescription (currentDetail.PrincipalDiagnosisCode, currentDetail.PrincipalDiagnosisVersion) + "\">" + currentDetail.PrincipalDiagnosisCode + "</span>";

                            // String diagnosisInformation = "<span title=\"" + MercuryApplication.DiagnosisDescription (currentDetail.DiagnosisCode, currentDetail.DiagnosisVersion) + "\">" + currentDetail.DiagnosisCode + "</span>";

                            String principalDiagnosisInformation = CommonFunctions.DiagnosisDescription(MercuryApplication, currentDetail.PrincipalDiagnosisCode, currentDetail.PrincipalDiagnosisVersion);

                            String diagnosisInformation = CommonFunctions.DiagnosisDescription(MercuryApplication, currentDetail.DiagnosisCode, currentDetail.DiagnosisVersion);


                            String revenueCodeInformation = "<span title=\"" + MercuryApplication.RevenueCodeDescription(currentDetail.RevenueCode) + "\">" + currentDetail.RevenueCode + "</span>";

                            String procedureCodeInformation = "<span title=\"" + MercuryApplication.ProcedureCodeDescription(currentDetail.ProcedureCode) + "\">" + currentDetail.ProcedureCode + "</span>";

                            String billTypeInformation = "<span title=\"" + MercuryApplication.BillTypeDescription(currentDetail.BillType) + "\">" + currentDetail.BillType + "</span>";

                            String icd9ProcedureCodeInformation = "<span title=\"" + MercuryApplication.Icd9ProcedureCodeDescription(currentDetail.Icd9ProcedureCode) + "\">" + currentDetail.Icd9ProcedureCode + "</span>";

                            detailTable.Rows.Add(

                                currentDetail.MemberServiceId.ToString(),

                                currentDetail.SingletonDefinitionId.ToString(),

                                currentDetail.EventDate.ToString("MM/dd/yyyy"),

                                currentDetail.ExternalClaimId,

                                currentDetail.ClaimLine.ToString(),

                                currentDetail.ClaimType,

                                billTypeInformation,

                                principalDiagnosisInformation,

                                diagnosisInformation,

                                icd9ProcedureCodeInformation,

                                currentDetail.LocationCode,

                                revenueCodeInformation,

                                procedureCodeInformation,

                                currentDetail.ModifierCode,

                                currentDetail.SpecialtyName,

                                currentDetail.IsPcpClaim.ToString(),

                                currentDetail.NdcCode,

                                currentDetail.Units.ToString(),

                                currentDetail.TherapeuticClassification,

                                currentDetail.LabLoincCode,

                                currentDetail.LabValue.ToString(),

                                currentDetail.Description

                                );
                        }

                        MemberServicesGrid_DataTableSingletonTable = detailTable;

                        MemberServicesGrid.MasterTableView.DetailTables[0].DataSource = detailTable;


                        #endregion

                        break;

                    case "Set":

                        #region Set Detail Table

                        detailTable = MemberServicesGrid_DataTableSetTable;

                        detailTable.Rows.Clear();

                        List <Mercury.Server.Application.MemberServiceDetailSet> detailSets;

                        detailSets = MercuryApplication.MemberServiceDetailSetGet(memberServiceId);

                        foreach (Mercury.Server.Application.MemberServiceDetailSet currentDetail in detailSets)
                        {
                            detailTable.Rows.Add(

                                currentDetail.MemberServiceId.ToString(),

                                currentDetail.SetDefinitionId.ToString(),

                                currentDetail.DetailMemberServiceId.ToString(),

                                currentDetail.EventDate.ToString("MM/dd/yyyy"),

                                currentDetail.ServiceName,

                                currentDetail.ServiceType.ToString()

                                );
                        }

                        MemberServicesGrid_DataTableSetTable = detailTable;

                        MemberServicesGrid.MasterTableView.DetailTables[1].DataSource = detailTable;

                        #endregion

                        break;
                    }
                }

                #endregion

                break;

            case "MemberServiceAdd":

                #region Member Service Add

                gridToolBar = (Telerik.Web.UI.RadToolBar)eventArgs.Item.FindControl("MemberServiceToolbar");

                if (gridToolBar != null)
                {
                    Telerik.Web.UI.RadComboBox MemberServiceSelection = (Telerik.Web.UI.RadComboBox)(gridToolBar.Items[2].FindControl("MemberServiceSelection"));

                    Telerik.Web.UI.RadDateInput MemberServiceEventDate = (Telerik.Web.UI.RadDateInput)(gridToolBar.Items[2].FindControl("MemberServiceEventDate"));

                    if (MemberServiceSelection != null)
                    {
                        if (!String.IsNullOrEmpty(MemberServiceSelection.SelectedValue))
                        {
                            if (MemberServiceEventDate.SelectedDate.HasValue)
                            {
                                success = MercuryApplication.MemberServiceAddManual(Member.Id, Convert.ToInt64(MemberServiceSelection.SelectedValue), MemberServiceEventDate.SelectedDate.Value);

                                if (!success)
                                {
                                    postScript = ("alert (\"" + MercuryApplication.LastException.Message.Replace("\"", "\\") + "\");");
                                }

                                else
                                {
                                    MemberServicesGrid_Count = 0;

                                    MemberServicesGrid.DataSource = null;

                                    MemberServicesGrid.Rebind();
                                }
                            }

                            else
                            {
                                postScript = ("alert (\"Event Date of Service is Required.\");");
                            }
                        }

                        else
                        {
                            postScript = ("alert (\"No Service Selected for Manual Add.\");");
                        }
                    }

                    else
                    {
                        postScript = ("alert (\"Internal Error: Unable to Find Control MemberServiceSelection.\");");
                    }


                    if ((TelerikAjaxManager != null) && (!String.IsNullOrEmpty(postScript)))
                    {
                        TelerikAjaxManager.ResponseScripts.Add(postScript);
                    }
                }

                #endregion

                break;

            default:

                System.Diagnostics.Debug.WriteLine("MemberServicesGrid_OnItemCommand: " + eventArgs.CommandSource + " " + eventArgs.CommandName + " (" + eventArgs.CommandArgument + ")");

                break;
            }

            return;
        }
Пример #22
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            Telerik.Web.UI.RadAjaxManager m = Telerik.Web.UI.RadAjaxManager.GetCurrent(Page);
            foreach (RepeaterItem it in rpWhere.Items)
            {
                ColumnSelect    csWhere   = (ColumnSelect)it.FindControl("csWhere");
                ConditionSelect Condition = (ConditionSelect)it.FindControl("Condition");
                PlaceHolder     phValue   = (PlaceHolder)it.FindControl("phValue");
                System.Web.UI.WebControls.TextBox tbValue  = (System.Web.UI.WebControls.TextBox)it.FindControl("tbValue");
                Telerik.Web.UI.RadComboBox        rcbValue = (Telerik.Web.UI.RadComboBox)it.FindControl("rcbValue");
                Telerik.Web.UI.RadNumericTextBox  rnValue  = (Telerik.Web.UI.RadNumericTextBox)it.FindControl("rnValue");

                rcbValue.Visible = false;
                rnValue.Visible  = false;

                string Table;
                string Column;
                string TextColumn;
                string SelectControl;
                if (!csWhere.SelectedField(DataViewTypeID, out Table, out Column, out TextColumn, out SelectControl))
                {
                    continue;
                }
                tbValue.Visible = false;

                Type t = typeof(MetricTrac.Bll.LinqMicajahEntitybase).Assembly.GetType("MetricTrac.Bll." + Table);
                if (t == null)
                {
                    continue;
                }

                System.Reflection.PropertyInfo pi = t.GetProperty(Column);
                if (pi == null)
                {
                    continue;
                }

                if (SelectControl != null)
                {
                    Condition.Mode = ConditionSelect.ConditionViewMode.Equal;
                    foreach (Panel p in phValue.Controls)
                    {
                        if (p.ID != System.IO.Path.GetFileNameWithoutExtension(SelectControl))
                        {
                            continue;
                        }
                        p.Style["display"] = "block";
                    }

                    continue;
                }

                if (pi.PropertyType == typeof(string))
                {
                    Condition.Mode  = ConditionSelect.ConditionViewMode.Like;
                    tbValue.Visible = true;
                    continue;
                }
                if (pi.PropertyType == typeof(Guid) || pi.PropertyType == typeof(Guid?))
                {
                    Condition.Mode          = ConditionSelect.ConditionViewMode.Equal;
                    rcbValue.Visible        = true;
                    rcbValue.DataValueField = Column;
                    rcbValue.DataTextField  = TextColumn;
                    rcbValue.DataSource     = MetricTrac.Bll.LinqMicajahDataContext.SelectGuid(Table, Column, TextColumn);
                    rcbValue.DataBind();
                    continue;
                }

                foreach (Type nt in NumericType)
                {
                    if (pi.PropertyType == nt)
                    {
                        Condition.Mode  = ConditionSelect.ConditionViewMode.Compare;
                        rnValue.Visible = true;
                        continue;
                    }
                }

                Condition.Mode  = ConditionSelect.ConditionViewMode.All;
                tbValue.Visible = true;
            }
        }
Пример #23
0
        private string GetValue(RepeaterItem it, string Table, string Column, string SelectControl)
        {
            ConditionSelect Condition = (ConditionSelect)it.FindControl("Condition");
            PlaceHolder     phValue   = (PlaceHolder)it.FindControl("phValue");

            System.Web.UI.WebControls.TextBox tbValue  = (System.Web.UI.WebControls.TextBox)it.FindControl("tbValue");
            Telerik.Web.UI.RadComboBox        rcbValue = (Telerik.Web.UI.RadComboBox)it.FindControl("rcbValue");
            Telerik.Web.UI.RadNumericTextBox  rnValue  = (Telerik.Web.UI.RadNumericTextBox)it.FindControl("rnValue");


            Type t = typeof(MetricTrac.Bll.LinqMicajahEntitybase).Assembly.GetType("MetricTrac.Bll." + Table);

            if (t == null)
            {
                return(null);
            }

            System.Reflection.PropertyInfo pi = t.GetProperty(Column);
            if (pi == null)
            {
                return(null);
            }

            if (SelectControl != null)
            {
                foreach (Panel p in phValue.Controls)
                {
                    if (p.ID != System.IO.Path.GetFileNameWithoutExtension(SelectControl))
                    {
                        continue;
                    }
                    if (p.Controls.Count < 1)
                    {
                        return(null);
                    }
                    if (!(p.Controls[0] is MetricTrac.Utils.IValueSelectControl))
                    {
                        return(null);
                    }
                    MetricTrac.Utils.IValueSelectControl iv = (MetricTrac.Utils.IValueSelectControl)p.Controls[0];
                    if (!iv.IsValueSelected)
                    {
                        return(null);
                    }
                    return(iv.SelectedValue.ToString());
                }

                return(null);
            }

            if (pi.PropertyType == typeof(string))
            {
                if (tbValue.Text == string.Empty)
                {
                    return(null);
                }
                return(tbValue.Text);
            }
            if (pi.PropertyType == typeof(Guid) || pi.PropertyType == typeof(Guid?))
            {
                if (string.IsNullOrEmpty(rcbValue.SelectedValue))
                {
                    return(null);
                }
                return(rcbValue.SelectedValue);
            }

            foreach (Type nt in NumericType)
            {
                if (pi.PropertyType == nt)
                {
                    if (rnValue.Value == null)
                    {
                        return(null);
                    }
                    return(((double)rnValue.Value).ToString());
                }
            }

            return(null);
        }
        public void ProblemClassAssignedToUserSaveLink_OnClick(Object sender, EventArgs e)
        {
            // GET REFERENCE OF CURRENT SAVE LINK BUTTON

            System.Web.UI.WebControls.LinkButton currentSaveLinkButton = (System.Web.UI.WebControls.LinkButton)sender;

            // GET REFERENCE OF CURRENT PROBLEM CLASS RAD LIST VIEW ITEM

            Telerik.Web.UI.RadListViewItem currentProblemClassRadListViewItem = (Telerik.Web.UI.RadListViewItem)currentSaveLinkButton.Parent;

            // GET REFERENCE TO CURRENT PROBLEM CLASS ASSIGNED TO USER SELECTION

            Telerik.Web.UI.RadComboBox currentProblemClassAssignedToUserSelection = (Telerik.Web.UI.RadComboBox)currentProblemClassRadListViewItem.FindControl("ProblemClassAssignedToUserSelection");

            // IF SELECTED VALUE OF CURRENT PROBLEM CLASS ASSIGNED TO USER SELECT IS NOT AN EMPTY STRING, THEN EVALUATE SELECTED VALUE

            if (currentProblemClassAssignedToUserSelection.SelectedValue != "")
            {
                // SET USER NAME AS TEXT OF SELECTED ITEM OF CURRENT PROBLEM CLASS ASSIGNED TO USER SELECTION

                String userName = currentProblemClassAssignedToUserSelection.SelectedItem.Text;

                // IF USER NAME IS NOT "NOT ASSIGNED", THEN GET ASSIGNED TO USER INFORMATION

                if (userName != "** Not Assigned")
                {
                    // SET SELECTED VALUE AS SELECTED VALUE OF CURRENT PROBLEM CLASS ASSIGNED TO USER SELECTION

                    String selectedValue = currentProblemClassAssignedToUserSelection.SelectedValue;

                    // SET ASSIGNED TO SECURITY AUTHORITY ID AS 0 INDEX OF SELECTED VALUE

                    Int64 assignedToSecurityAuthorityId = Convert.ToInt64(selectedValue.Split('|')[0]);

                    // SET ASSIGNED TO USER ACCOUNT ID AS 2 INDEX OF SELECTED VALUE

                    String assignedToUserAccountId = selectedValue.Split('|')[1];

                    // SET MEMBER CASE PROBLEM CLASS ID AS 2 INDEX OF SELECTED VALUE

                    Int64 memberCaseProblemClassId = Convert.ToInt64(selectedValue.Split('|')[2]);

                    // SAVE MEMBER CASE PROBLEM CLASS ASSIGNMENT, ASSIGN USER TO MEMBER CASE PROBLEM CLASS

                    Mercury.Server.Application.MemberCaseModificationResponse response = new Mercury.Server.Application.MemberCaseModificationResponse();

                    // ASSIGN MEMBER CASE PROBLEM CLASS TO USER

                    response = MercuryApplication.MemberCaseProblemClass_AssignToUser(Case, memberCaseProblemClassId,

                                                                                      assignedToSecurityAuthorityId, assignedToUserAccountId, userName, userName);

                    // IF RESPOSNE IS NOT NULL, THEN EVALUATE IF EXCEPTION EXISTS

                    if (response != null)
                    {
                        // IF RESPONSE HAS EXCEPTION, THEN SET EXCEPTION MESSAGE OF PARENT MEMBER CASE PAGE AS MESAGE OF EXCEPTION OF RESPONSE

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

                        // UPDATE FORM FROM UPDATED CASE RECEVIED THROUGH RESPONSE

                        if (response.MemberCase != null)
                        {
                            // RELOAD MEMBER CASE

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

                // IF USER NAME IS NOT ASSIGNED, THEN CHECK IF CURRENT MEMBER PROBLEM CLASS IS CURRENTLY NOT ASSIGNED, IF NOT THEN SET CURRENT MEMBER PROBLEM CLASS AS NOT ASSIGNED

                else
                {
                    // SET SELECTED VALUE AS SELECTED VALUE OF CURRENT PROBLEM CLASS ASSIGNED TO USER SELECTION

                    String selectedValue = currentProblemClassAssignedToUserSelection.SelectedValue;

                    // SET MEMBER CASE PROBLEM CLASS ID AS 2 INDEX OF SELECTED VALUE

                    Int64 memberCaseProblemClassId = Convert.ToInt64(selectedValue.Split('|')[2]);

                    // SAVE MEMBER CASE PROBLEM CLASS ASSIGNMENT, UNASSIGN USER MEMBER CASE PROBLEM CLASS ASSIGNMENT

                    Mercury.Server.Application.MemberCaseModificationResponse response = new Server.Application.MemberCaseModificationResponse();

                    // ASSIGN MEMBER CASE PROBLEM CLASS TO USER

                    response = MercuryApplication.MemberCaseProblemClass_AssignToUser(Case, memberCaseProblemClassId, 0, String.Empty, String.Empty, String.Empty);

                    // IF RESPOSNE IS NOT NULL, THEN EVALUATE IF EXCEPTION EXISTS

                    if (response != null)
                    {
                        // IF RESPONSE HAS EXCEPTION, THEN SET EXCEPTION MESSAGE OF PARENT MEMBER CASE PAGE AS MESAGE OF EXCEPTION OF RESPONSE

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

                        // UPDATE FORM FROM UPDATED CASE RECEVIED THROUGH RESPONSE

                        if (response.MemberCase != null)
                        {
                            // RELOAD MEMBER CASE

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

            return;
        }
        private void InitializeMemberCaseProblemClassUserAssignment()
        {
            // LOOP THROUGH RAD LIST VIEW DATA ITEMS IN PROBLEM CLASS LIST VIEW RAD LIST VIEW

            foreach (Telerik.Web.UI.RadListViewDataItem currentProblemClassList in ProblemClassListView.Items)
            {
                // GET DATA KEY VALUE OF CURRENT PROBLEM CLASS LIST RAD LIST VIEW DATA ITEM

                Int64 dataKeyValue = (Int64)currentProblemClassList.GetDataKeyValue("Id");

                // LOOP THROUGH MEMBER CASE PROBLEM CLASSES IN MEMBER CASE

                foreach (Client.Core.Individual.Case.MemberCaseProblemClass currentMemberCaseProblemClass in Case.ProblemClasses)
                {
                    // IF ID OF CURRENT MEMBER CASE PROBLEM CLASS EQUALS DATA KEY VALUE, THEN PROCESS

                    if (currentMemberCaseProblemClass.Id == dataKeyValue)
                    {
                        // CREATE REFERENCE TO IS ASSIGNED TO USER CHANGE VISIBLE AND DEFAULT IT TO FALSE

                        Boolean isAssignedToUserChangeVisible = false;

                        // GET REFERENCE TO PROBLEM CLASS ASSIGNED TO USER LABEL

                        Label problemClassAssignedToUserLabel = (Label)currentProblemClassList.FindControl("ProblemClassAssignedToUserLabel");

                        // SET TEXT OF PROBLEM CLASS ASSIGNED TO USER LABEL AS CURRENT ASSIGNED USER NAME OR IF NOT ASSIGNED AS NOT ASSIGNED

                        problemClassAssignedToUserLabel.Text = (!String.IsNullOrEmpty(currentMemberCaseProblemClass.AssignedToUserAccountId)) ? currentMemberCaseProblemClass.AssignedToUserDisplayName : "** Not Assigned";

                        // IF ASSIGNED TO THE CURRENT USER, THE USER CAN UNASSIGN THEMSELVES

                        if ((currentMemberCaseProblemClass.AssignedToSecurityAuthorityId == MercuryApplication.Session.SecurityAuthorityId) && (currentMemberCaseProblemClass.AssignedToUserAccountId == MercuryApplication.Session.UserAccountId))
                        {
                            // SET IS ASSIGNED TO USER CHANGE VISIBLE AS TRUE

                            isAssignedToUserChangeVisible = true;
                        }

                        // IF CURRENT MEMBER CASE PROBLEM CLASS IS NOT ASSIGNED TO CURRENT USER, EVALUATE MEMBER CASE ASSIGNMENT

                        else
                        {
                            // IF CASE IS ASSIGNED TO A WORK TEAM, AND MEMBER IS PART OF THAT WORK TEAM, THEY CAN SELF ASSIGN (OR A MANAGER MAY ASSIGN TO ANY USER)

                            if (Case.HasWorkTeamAssignment)
                            {
                                // IF THE CURRENT USER IS A MANAGER IN THE TEAM THAT IS ASSIGNED TO THE CURRENT MEMBER CASE, THEN SET IS ASSIGNED TO USER CHANGE VISIBLE AS TRUE

                                if (Case.AssignedToThisSessionTeamManager)
                                {
                                    // SET IS ASSIGNED TO USER CHANGE VISIBLE AS TRUE

                                    isAssignedToUserChangeVisible = true;
                                }

                                // IF THE CURRENT USER IS A MEMBER IN THE TEAM THAT IS ASSIGNED TO THE CURRENT MEMBER CASE, THEN SET IS ASSIGNED TO USER CHANGE VISIBLE TO TRUE

                                else if (Case.AssignedToThisSessionTeam)
                                {
                                    // SET IS ASSIGNED TO USER CHANGE VISIBLE TO TRUE

                                    isAssignedToUserChangeVisible = true;
                                }
                            }
                        }

                        // GET REFERENCE TO PROBLEM CLASS ASSIGNED TO USER CHANGE LINK

                        System.Web.UI.HtmlControls.HtmlGenericControl problemClassAssignedToUserChangeLink = (System.Web.UI.HtmlControls.HtmlGenericControl)currentProblemClassList.FindControl("ProblemClassAssignedToUserChangeLink");

                        // SET DISPLAY STYLE OF PROBLEM CLASS ASSIGNED TO USER CHANGE LINK TO INLINE IF IS ASSIGNED TO USER CHANGE VISIBLE IS TRUE OR TO NONE IF IS ASSIGNED TO USER CHANGE LINK IS FALSE

                        problemClassAssignedToUserChangeLink.Style.Add("display", ((isAssignedToUserChangeVisible) ? "inline" : "none"));

                        // GET REFERENCE TO PROBLEM CLASS ASSIGNED TO USER SELECTION RAD COMBO BOX

                        Telerik.Web.UI.RadComboBox problemClassAssignedToUserSelection = (Telerik.Web.UI.RadComboBox)currentProblemClassList.FindControl("ProblemClassAssignedToUserSelection");


                        // IF IS ASSIGNED TO USER CHANGE VISIBLE IS TRUE, THEN ADD AVAILABLE CARE TEAM MEMBERS TO SELECTION

                        if (isAssignedToUserChangeVisible)
                        {
                            // CLEAR ITEMS OF PROBLEM CLASS ASSIGNED TO USER SELECTION RAD COMBO BOX

                            problemClassAssignedToUserSelection.Items.Clear();

                            // ADD NOT ASIGNED RAD COMBO BOX ITEM TO PROBLEM CLASS ASSIGNED TO USER SELECTION RAD COMBO BOX

                            problemClassAssignedToUserSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem("** Not Assigned", "0|0|" + currentMemberCaseProblemClass.Id));

                            // IF CASE IS CURRENTLY ASSIGNED TO A WORK TEAM, ADD TEAM MEMBERS TO SELECTION

                            if (Case.AssignedToWorkTeam != null)
                            {
                                // LOOP THROUGH WORK TEAM MEMBERSHIPS OF TEAM MEMBERSHIPS OF WORK TEAM CURRENTLY ASSIGNED TO MEMBER CASE

                                foreach (Mercury.Server.Application.WorkTeamMembership currentMembership in Case.AssignedToWorkTeam.Membership)
                                {
                                    // IF USER IS TEAM MANAGER, CAN ASSIGN TO ANY USER

                                    Boolean canAddMembership = Case.AssignedToThisSessionTeamManager;

                                    // IF THE CASE IS NOT ASSIGNED TO ANYONE, AND USER IS MEMBER OF TEAM, CAN "SELF-ASSIGN";

                                    canAddMembership |= ((!currentMemberCaseProblemClass.AssignedToDate.HasValue) && ((currentMembership.SecurityAuthorityId == MercuryApplication.Session.SecurityAuthorityId) && (currentMembership.UserAccountId == MercuryApplication.Session.UserAccountId)));

                                    // IF CAN ADD MEMBERSHIP IS TRUE, THEN ADD NEW RAD COMBO BOX ITEM FOR CURRENT TEAM MEMBER TO ITEMS OF PROBLEM CLASS ASSIGNED TO USER SELECTION RAD COMBO BOX

                                    if (canAddMembership)
                                    {
                                        // ADD NEW RAD COMBO BOX ITEM FOR CURRENT TEAM MEMBER TO ITEMS OF PROBLEM CLASS ASSIGNED TO USER SELECTION RAD COMBO BOX

                                        problemClassAssignedToUserSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem(currentMembership.UserDisplayName, currentMembership.SecurityAuthorityId.ToString() + "|" + currentMembership.UserAccountId + "|" + currentMemberCaseProblemClass.Id));
                                    }
                                } /* END FOREACH */

                                // SET SELECTED VALUE OF PROBLEM CLASS ASSIGNED TO USER SELECTION RAD COMBO BOX TO CURRENT MEMBER CASE PROBLEM CLASS ASSIGNED USER

                                problemClassAssignedToUserSelection.SelectedValue = currentMemberCaseProblemClass.AssignedToSecurityAuthorityId.ToString() + "|" + currentMemberCaseProblemClass.AssignedToUserAccountId + "|" + currentMemberCaseProblemClass.Id;
                            }
                        }
                    }
                } /* END FOREACH */
            }     /* END FOREACH */

            return;
        }
Пример #26
0
        protected void MemberWorkHistoryGrid_OnNeedDataSource(Object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs eventArgs)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            System.Data.DataTable dataTable = MemberWorkHistoryGrid_DataTable;


            if (!eventArgs.IsFromDetailTable)
            {
                switch (eventArgs.RebindReason)
                {
                case Telerik.Web.UI.GridRebindReason.InitialLoad:

                    #region Initialize Grid

                    MemberWorkHistoryGrid_Count = 0;

                    MemberWorkHistoryGrid_CurrentPage = 0;

                    MemberWorkHistoryGrid_PageSize = 10;


                    MemberWorkHistoryGrid.CurrentPageIndex = MemberWorkHistoryGrid_CurrentPage;

                    MemberWorkHistoryGrid.PageSize = MemberWorkHistoryGrid_PageSize;

                    MemberWorkHistoryGrid.VirtualItemCount = MemberWorkHistoryGrid_Count;

                    #endregion

                    break;

                case Telerik.Web.UI.GridRebindReason.PostbackViewStateNotPersisted:

                    #region Restore Grid State

                    MemberWorkHistoryGrid.CurrentPageIndex = MemberWorkHistoryGrid_CurrentPage;

                    MemberWorkHistoryGrid.PageSize = MemberWorkHistoryGrid_PageSize;

                    MemberWorkHistoryGrid.VirtualItemCount = MemberWorkHistoryGrid_Count;


                    if (MemberWorkHistoryToolbar != null)
                    {
                        Telerik.Web.UI.RadComboBox WorkQueueSelection = (Telerik.Web.UI.RadComboBox)MemberWorkHistoryToolbar.Items[0].FindControl("WorkQueueSelection");

                        if (WorkQueueSelection != null)
                        {
                            WorkQueueSelection_SelectedValue = WorkQueueSelection.SelectedValue;
                        }

                        Telerik.Web.UI.RadNumericTextBox WorkQueueItemPriority = (Telerik.Web.UI.RadNumericTextBox)(MemberWorkHistoryToolbar.Items[0].FindControl("WorkQueueItemPriority"));

                        if (WorkQueueItemPriority != null)
                        {
                            WorkQueueItemPriority_Value = WorkQueueItemPriority.Value;
                        }
                    }

                    #endregion

                    break;

                case Telerik.Web.UI.GridRebindReason.ExplicitRebind:

                case Telerik.Web.UI.GridRebindReason.PostBackEvent:

                    #region Rebind Grid

                    if (Member == null)
                    {
                        dataTable.Rows.Clear();
                    }

                    else
                    {
                        if (MemberWorkHistoryGrid_Count == 0)
                        {
                            MemberWorkHistoryGrid_Count = Convert.ToInt32(MercuryApplication.WorkQueueItemsGetCount(MemberFilters(), false));

                            // OLD METHOD BELOW

                            // MemberWorkHistoryGrid_Count = Convert.ToInt32 (MercuryApplication.WorkQueueItemGetCountByObject ("Member", Member.Id));

                            MemberWorkHistoryGrid.VirtualItemCount = MemberWorkHistoryGrid_Count;
                        }

                        if (!pageSizeChanged)
                        {
                            MemberWorkHistoryGrid_PageSize = MemberWorkHistoryGrid.PageSize;
                        }

                        else
                        {
                            MemberWorkHistoryGrid.PageSize = MemberWorkHistoryGrid_PageSize;

                            pageSizeChanged = false;
                        }

                        MemberWorkHistoryGrid_CurrentPage = MemberWorkHistoryGrid.CurrentPageIndex;

                        dataTable.Rows.Clear();

                        List <Client.Core.Work.WorkQueueItem> memberWorkHistory;

                        Int32 initialRow = MemberWorkHistoryGrid.CurrentPageIndex * MemberWorkHistoryGrid.PageSize + 1;

                        memberWorkHistory = MercuryApplication.WorkQueueItemsGetByViewPage((Client.Core.Work.WorkQueueView)null, MemberFilters(), null, initialRow, MemberWorkHistoryGrid.PageSize, false);

                        // OLD METHOD BELOW

                        // memberWorkHistory = MercuryApplication.WorkQueueItemGetByObjectPage ("Member", Member.MemberId, initialRow, MemberWorkHistoryGrid.PageSize);

                        WorkQueueItems = memberWorkHistory;

                        foreach (Client.Core.Work.WorkQueueItem currentItem in memberWorkHistory)
                        {
                            dataTable.Rows.Add(

                                "&nbsp",

                                currentItem.WorkQueueId.ToString(),

                                currentItem.Id.ToString(),

                                currentItem.WorkQueueName,

                                currentItem.WorkflowName,

                                currentItem.WorkflowLastStep,

                                currentItem.WorkflowNextStep,

                                currentItem.AddedDate.ToString("MM/dd/yyyy"),

                                (currentItem.LastWorkedDate.HasValue) ? currentItem.LastWorkedDate.Value.ToString("MM/dd/yyyy") : "&nbsp",

                                currentItem.ConstraintDate.ToString("MM/dd/yyyy"),

                                currentItem.MilestoneDate.ToString("MM/dd/yyyy"),

                                currentItem.ThresholdDate.ToString("MM/dd/yyyy"),

                                currentItem.DueDate.ToString("MM/dd/yyyy"),

                                (currentItem.CompletionDate.HasValue) ? currentItem.CompletionDate.Value.ToString("MM/dd/yyyy") : "&nbsp",

                                currentItem.WorkOutcomeName,

                                currentItem.Priority,

                                (!String.IsNullOrEmpty(currentItem.AssignedToUserAccountName)) ? currentItem.AssignedToUserAccountName : "&nbsp",

                                (currentItem.AssignedToDate.HasValue) ? currentItem.AssignedToDate.Value.ToString("MM/dd/yyyy") : "&nbsp"

                                );
                        }
                    }

                    #endregion

                    break;

                default:

                    System.Diagnostics.Debug.WriteLine(eventArgs.RebindReason + " [" + eventArgs.IsFromDetailTable.ToString() + "]");

                    break;
                }
            }

            MemberWorkHistoryGrid_DataTable = dataTable;

            MemberWorkHistoryGrid.DataSource = MemberWorkHistoryGrid_DataTable;

            MemberWorkHistoryGrid.MasterTableView.DetailTables[0].DataSource = MemberWorkHistoryGrid_SenderTable;

            return;
        }
        protected void MemberMetricsGrid_OnItemCommand(Object sender, Telerik.Web.UI.GridCommandEventArgs eventArgs)
        {
            if (MercuryApplication == null)
            {
                return;
            }


            Telerik.Web.UI.RadToolBar gridToolBar = null;

            Boolean success = false;

            String postScript = String.Empty;


            switch (eventArgs.CommandName)
            {
            case "ExpandCollapse":

                #region Expand/Collapse

                Telerik.Web.UI.GridDataItem gridItem = (Telerik.Web.UI.GridDataItem)eventArgs.Item;

                Int64 memberServiceId;

                if (Int64.TryParse(gridItem["MemberMetricId"].Text, out memberServiceId))
                {
                    // TODO?
                }

                #endregion

                break;

            case "MemberMetricAdd":

                #region Add Member Metric

                gridToolBar = (Telerik.Web.UI.RadToolBar)eventArgs.Item.FindControl("MemberMetricToolbar");

                if (gridToolBar != null)
                {
                    Telerik.Web.UI.RadComboBox MemberMetricSelection = (Telerik.Web.UI.RadComboBox)(gridToolBar.Items[2].FindControl("MemberMetricSelection"));

                    Telerik.Web.UI.RadDateInput MemberMetricEventDate = (Telerik.Web.UI.RadDateInput)(gridToolBar.Items[2].FindControl("MemberMetricEventDate"));

                    Telerik.Web.UI.RadNumericTextBox MemberMetricValue = (Telerik.Web.UI.RadNumericTextBox)(gridToolBar.Items[2].FindControl("MemberMetricValue"));

                    if (MemberMetricSelection != null)
                    {
                        if (!String.IsNullOrEmpty(MemberMetricSelection.SelectedValue))
                        {
                            if ((MemberMetricEventDate.SelectedDate.HasValue) && (MemberMetricValue.Value.HasValue))
                            {
                                success = MercuryApplication.MemberMetricAddManual(Member.Id, Convert.ToInt64(MemberMetricSelection.SelectedValue), MemberMetricEventDate.SelectedDate.Value, Convert.ToDecimal(MemberMetricValue.Value.Value));

                                if (!success)
                                {
                                    postScript = ("alert (\"" + MercuryApplication.LastException.Message.Replace("\"", "\\") + "\");");
                                }

                                else
                                {
                                    MemberMetricsGrid_Count = 0;

                                    MemberMetricsGrid.DataSource = null;

                                    MemberMetricsGrid.Rebind();
                                }
                            }

                            else
                            {
                                postScript = ("alert (\"Event Date and Value of Metric is Required.\");");
                            }
                        }

                        else
                        {
                            postScript = ("alert (\"No Metric Selected for Manual Add.\");");
                        }
                    }

                    else
                    {
                        postScript = ("alert (\"Internal Error: Unable to Find Control MemberMetricSelection.\");");
                    }


                    if ((TelerikAjaxManager != null) && (!String.IsNullOrEmpty(postScript)))
                    {
                        TelerikAjaxManager.ResponseScripts.Add(postScript);
                    }
                }

                #endregion

                break;

            default:

                System.Diagnostics.Debug.WriteLine("MemberMetricsGrid_OnItemCommand: " + eventArgs.CommandSource + " " + eventArgs.CommandName + " (" + eventArgs.CommandArgument + ")");

                break;
            }

            return;
        }
Пример #28
0
        protected void MemberWorkHistoryGrid_OnItemCommand(Object sender, Telerik.Web.UI.GridCommandEventArgs eventArgs)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            //System.Data.DataTable detailTable = null;

            Telerik.Web.UI.RadToolBar gridToolBar = null;

            switch (eventArgs.CommandName)
            {
            case "ExpandCollapse":

                #region Expand/Collapse

                Telerik.Web.UI.GridDataItem gridItem = (Telerik.Web.UI.GridDataItem)eventArgs.Item;

                Int64 workQueueItemId;


                if (Int64.TryParse(gridItem["WorkQueueItemId"].Text, out workQueueItemId))
                {
                    System.Data.DataTable sendersTable = MemberWorkHistoryGrid_SenderTable;

                    sendersTable.Rows.Clear();


                    List <Mercury.Client.Core.Work.WorkQueueItemSender> senders = MercuryApplication.WorkQueueItemSendersGet(workQueueItemId, false);

                    foreach (Mercury.Client.Core.Work.WorkQueueItemSender currentSender in senders)
                    {
                        sendersTable.Rows.Add(

                            workQueueItemId.ToString(),

                            currentSender.Id.ToString(),

                            currentSender.EventDescription,

                            currentSender.Priority,

                            currentSender.CreateAccountInfo.UserAccountName,

                            currentSender.CreateAccountInfo.ActionDate.ToString("MM/dd/yyyy")

                            );
                    }

                    MemberWorkHistoryGrid.MasterTableView.DetailTables[0].DataSource = sendersTable;

                    MemberWorkHistoryGrid.MasterTableView.DetailTables[0].DataBind();
                }

                #endregion

                break;

            case "WorkQueueItemAdd":

                #region Add to Work Queue

                gridToolBar = (Telerik.Web.UI.RadToolBar)eventArgs.Item.FindControl("MemberWorkHistoryToolbar");

                if (gridToolBar != null)
                {
                    Telerik.Web.UI.RadComboBox WorkQueueSelection = (Telerik.Web.UI.RadComboBox)(gridToolBar.Items[0].FindControl("WorkQueueSelection"));

                    Telerik.Web.UI.RadNumericTextBox WorkQueueItemPriority = (Telerik.Web.UI.RadNumericTextBox)(gridToolBar.Items[0].FindControl("WorkQueueItemPriority"));

                    if (WorkQueueSelection != null)
                    {
                        if (!String.IsNullOrEmpty(WorkQueueSelection.SelectedValue))
                        {
                            Int64 workQueueId = Int64.Parse(WorkQueueSelection.SelectedValue);

                            Int32 priority = 0;


                            if (WorkQueueItemPriority.Value.HasValue)
                            {
                                Int32.TryParse(WorkQueueItemPriority.Value.Value.ToString(), out priority);
                            }


                            Boolean insertSuccess = MercuryApplication.WorkQueueInsertEntity(workQueueId, Member.EntityId, null, null, 0, "Manual Addition", priority);

                            MemberWorkHistoryGrid_ManualDataRebind();
                        }
                    }
                }

                #endregion

                break;

            default:

                System.Diagnostics.Debug.WriteLine("MemberMetricsGrid_OnItemCommand: " + eventArgs.CommandSource + " " + eventArgs.CommandName + " (" + eventArgs.CommandArgument + ")");

                break;
            }

            return;
        }
        protected void ActivityThresholdsGrid_OnItemDataBound(Object sender, Telerik.Web.UI.GridItemEventArgs eventArgs)
        {
            Telerik.Web.UI.RadNumericTextBox thresholdRelativeDateValue;

            Telerik.Web.UI.RadComboBox thresholdRelativeDateQualifier;

            Telerik.Web.UI.RadComboBox thresholdStatusSelection;

            Telerik.Web.UI.RadComboBox thresholdActionSelection;

            Client.Core.Activity.ActivityThreshold threshold;

            System.Collections.Generic.Dictionary <String, String> bindingContexts;


            if (MercuryApplication == null)
            {
                return;
            }


            if ((eventArgs.Item is Telerik.Web.UI.GridEditableItem) && (eventArgs.Item.IsInEditMode))
            {
                Telerik.Web.UI.GridEditableItem editItem = (Telerik.Web.UI.GridEditableItem)eventArgs.Item;


                switch (eventArgs.Item.OwnerTableView.Name)
                {
                case "Thresholds":

                    thresholdRelativeDateValue = (Telerik.Web.UI.RadNumericTextBox)editItem.FindControl("ActivityThresholdRelativeDateValue");

                    thresholdRelativeDateQualifier = (Telerik.Web.UI.RadComboBox)editItem.FindControl("ActivityThresholdRelativeDateQualifier");

                    thresholdStatusSelection = (Telerik.Web.UI.RadComboBox)editItem.FindControl("ActivityThresholdStatusSelection");


                    // RESERVED IF ACTIONS ARE ADDED TO CARE LEVEL ACTIVITY THRESHOLDS

                    //thresholdActionSelection = (Telerik.Web.UI.RadComboBox)editItem.FindControl ("ActivityThresholdActionSelection");


                    //thresholdActionSelection.Items.Clear ();

                    //thresholdActionSelection.Items.Add (new Telerik.Web.UI.RadComboBoxItem ("* No Action Selected", "0"));

                    //foreach (Mercury.Server.Application.Action currentAction in MercuryApplication.ActionsAvailable (false)) {

                    //    thresholdActionSelection.Items.Add (new Telerik.Web.UI.RadComboBoxItem (currentAction.Name, currentAction.Id.ToString ()));

                    //}


                    if (eventArgs.Item.ItemIndex != -1)
                    {
                        threshold = EditCareInterventionActivity.SortedThresholds.Values[eventArgs.Item.ItemIndex];

                        if (threshold != null)
                        {
                            thresholdRelativeDateValue.Value = threshold.RelativeDateValue;

                            thresholdRelativeDateQualifier.SelectedValue = threshold.RelativeDateQualifier.ToString();

                            thresholdStatusSelection.SelectedValue = ((Int32)threshold.Status).ToString();


                            // RESERVED IF ACTIONS ARE ADDED TO CARE LEVEL ACTIVITY THRESHOLDS

                            // thresholdActionSelection.SelectedValue = threshold.Action.Id.ToString ();
                        }
                    }

                    break;

                case "ThresholdParameters":     // RESERVED IF ACTIONS ARE ADDED TO CARE LEVEL ACTIVITY THRESHOLDS

                    Int64 thresholdKey = Int64.Parse((String)((Telerik.Web.UI.GridEditableItem)eventArgs.Item).OwnerTableView.DataKeyValues[eventArgs.Item.ItemIndex]["ThresholdKey"]);

                    threshold = EditCareInterventionActivity.SortedThresholds[thresholdKey];

                    String parameterName = (String)editItem.OwnerTableView.DataKeyValues[eventArgs.Item.ItemIndex]["ParameterName"];

                    Telerik.Web.UI.RadComboBox parameterValueSelection = (Telerik.Web.UI.RadComboBox)eventArgs.Item.FindControl("ActivityThresholdParameterValue");

                    Telerik.Web.UI.RadTextBox parameterFixedValue = (Telerik.Web.UI.RadTextBox)eventArgs.Item.FindControl("ActivityThresholdParameterFixedValue");


                    parameterValueSelection.Items.Clear();

                    if (!threshold.Action.ActionParameters[parameterName].Required)
                    {
                        parameterValueSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem("* Not Assigned", "0"));
                    }



                    bindingContexts = (new Client.Core.Individual.Case.MemberCase(MercuryApplication)).ParameterValueSelection(threshold.Action.ActionParameters[parameterName].DataType);

                    foreach (String currentBindingContextName in bindingContexts.Keys)
                    {
                        parameterValueSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem(currentBindingContextName, bindingContexts[currentBindingContextName]));
                    }

                    parameterFixedValue.Enabled = threshold.Action.ActionParameters[parameterName].AllowFixedValue;

                    parameterFixedValue.EmptyMessage = (threshold.Action.ActionParameters[parameterName].AllowFixedValue) ? String.Empty : "(Not Available)";

                    parameterFixedValue.Text = String.Empty;

                    break;
                }
            }

            return;
        }
        public void ProblemClassAssignedToProviderSelection_OnItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            // GET REFERENCE TO CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECT RAD COMBO BOX THROUGH SENDER ARGUMENT

            Telerik.Web.UI.RadComboBox currentProblemClassAssignedToProviderSelection = (Telerik.Web.UI.RadComboBox)sender;

            // DEFAULT CURRENT MEMBER CASE PROBLEM CLASS ID TO 0

            Int64 currentMemberCaseProblemClassId = 0;

            // SET MEMBER CASE PROBLEM CLASS ID TO ZERO INDEX OF SLPIT STRING OF VALUE OF FZERO INDEX ITEM OF CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION (GETS ID FROM VALUE OF NOT ASSIGNED ITEM)

            currentMemberCaseProblemClassId = Convert.ToInt64(currentProblemClassAssignedToProviderSelection.Items[0].Value.Split('|')[1]);

            // EVALUATE IF ENTERED TEXT IS GREATER THAN 3 IN LENGTH (HANDLED IN "ON CLIENT ITEM REQUESTING" CLIENT-SIDE EVENT)

            if (e.Text.Length >= 3)
            {
                // CREATE REFERENCE TO SEARCH RESULTS PROVIDER RESPONSE OBJECT

                Mercury.Server.Application.SearchResultsProviderResponse providerSearchResponse;

                // GET PROVIDER SEARCH RESPONSE THROUGH SEARCH PROVIDER METHOD

                providerSearchResponse = MercuryApplication.SearchProvider(e.Text, e.Text);

                // EVALUATE IF PROVIDER SEARCH RESPONSE HAS EXCEPTION, IF SO ADD RAD COMBO BOX ITEM TO CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION RAD COMBO BOX TO INFORM USER OF EXCEPTION

                if (providerSearchResponse.HasException)
                {
                    // ADD RAD COMBO BOX ITEM TO CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION RAD COMBO BOX TO INFORM USER OF EXCEPTION

                    currentProblemClassAssignedToProviderSelection.Items.Add(new Telerik.Web.UI.RadComboBoxItem(("alert ('" + providerSearchResponse.Exception.Message.Replace("'", "''") + "');"), "0"));
                }

                // IF PROVIDER SEARCH RESPONSE DOES NOT HAVE EXCEPTION, THAN ADD RAD COMBO BOX ITEMS TO CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION RAD COMBO BOX

                else
                {
                    // GET AND SET SEARCH RESULTS PROVIDERS ARRAY AS RESULTS OF PROVIDER SEARCH RESPONSE

                    Mercury.Server.Application.SearchResultProvider[] searchResultProviders = providerSearchResponse.Results;

                    // IF COUNT OF SEARCH RESULT PROVIDERS IS GREATER THAN OR EQUAL TO 1 AND LESS THAN OR EQUAL TO 25, THEN ADD RAD COMBO BOX ITEMS FOR EACH PROVIDER IN SEARCH RESULT PROVIDERS

                    if ((searchResultProviders.Count() >= 1) && (searchResultProviders.Count() <= 25))
                    {
                        // LOOP THROUGH EACH SEARCH RESULT PROVIDER IN SEARCH RESULTS PROVIDERS, THEN ADD RAD COMBO BOX ITEMS FOR EACH PROVIDER INTO ITEMS OF CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION RAD COMBO BOX

                        foreach (Mercury.Server.Application.SearchResultProvider currentSearchResultProvider in searchResultProviders)
                        {
                            // CREATE REFERENCE TO NEW RAD COMBO BOX ITEM WITH TEXT AS NAME OF CURRENT PROVIDER AND VALUE AS PROVIDER ID OF CURRENT PROVIDER

                            Telerik.Web.UI.RadComboBoxItem newRadComboBoxItem = new Telerik.Web.UI.RadComboBoxItem(currentSearchResultProvider.Name, currentSearchResultProvider.ProviderId.ToString() + "|" + currentMemberCaseProblemClassId);

                            // ADD NEW RAD COMBO BOX ITEMS TO CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION RAD COMBO BOX

                            currentProblemClassAssignedToProviderSelection.Items.Add(newRadComboBoxItem);
                        } /* END FOREACH */
                    }

                    // IF COUNT OF SEARCH RESULT PROVIDERS IS GREATER THAN 25, THEN ADD RAD COMBO BOX ITEM THAT INDICATES TO USER THAT TOO MANY PROVIDERS WERE RETURNED

                    else if (searchResultProviders.Count() > 25)
                    {
                        // CREATE REFERENCE TO NEW RAD COMBO BOX ITEM WITH TEXT AS EXPLANATION TO USER THAT TOO MANY PROVIDERS WERE RETURNED AND VALUE AS 0

                        Telerik.Web.UI.RadComboBoxItem newRadComboBoxItem = new Telerik.Web.UI.RadComboBoxItem("**Too many providers returned (" + searchResultProviders.Count().ToString() + ". Please narrow search by entering more letters.", "0|0");

                        // ADD NEW RAD COMBO BOX ITEMS TO CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION RAD COMBO BOX

                        currentProblemClassAssignedToProviderSelection.Items.Add(newRadComboBoxItem);
                    }

                    // IF COUNT OF SEARCH RESULT PROVIDERS IS EQUAL TO 0, THEN ADD RAD COMBO BOX ITEM THAT INDICATES TO USER THAT NO PROVIDERS WERE RETURNED

                    else if (searchResultProviders.Count() == 0)
                    {
                        // CREATE REFERENCE TO NEW RAD COMBO BOX ITEM WITH TEXT AS EXPLANATION TO USER THAT NO PROVIDERS WERE RETURNED AND VALUE AS 0

                        Telerik.Web.UI.RadComboBoxItem newRadComboBoxItem = new Telerik.Web.UI.RadComboBoxItem("**No providers returned. Please widen search by entering fewer letters.", "0|0");

                        // ADD NEW RAD COMBO BOX ITEMS TO CURRENT PROBLEM CLASS ASSIGNED TO PROVIDER SELECTION RAD COMBO BOX

                        currentProblemClassAssignedToProviderSelection.Items.Add(newRadComboBoxItem);
                    }
                }
            }

            return;
        }