예제 #1
0
        public void CaseLockToggleLink_OnClick(Object sender, EventArgs e)
        {
            Server.Application.MemberCaseModificationResponse response = null;

            if (((LinkButton)sender).Text == "(lock)")
            {
                response = MercuryApplication.MemberCase_Lock(Case);
            }

            else
            {
                response = MercuryApplication.MemberCase_Unlock(Case);
            }

            if (response == null)
            {
                return;
            }

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


            // UPDATE FORM FROM UPDATED CASE RECEVIED THROUGH RESPONSE

            if (response.MemberCase != null)
            {
                Case = new Client.Core.Individual.Case.MemberCase(MercuryApplication, response.MemberCase);
            }

            return;
        }
        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;
        }
예제 #3
0
        public void CaseAssignedToUserSaveLink_OnClick(Object sender, EventArgs e)
        {
            Server.Application.MemberCaseModificationResponse response = null;


            Int64 securityAuthorityId = Convert.ToInt64(CaseAssignedToUserSelection.SelectedValue.Split('|')[0]);

            String userAccountId = CaseAssignedToUserSelection.SelectedValue.Split('|')[1];


            // DETERMINE IF THERE WAS AN ACTUAL CHANGE

            if (!((Case.AssignedToSecurityAuthorityId == securityAuthorityId) && (Case.AssignedToUserAccountId == userAccountId)))
            {
                if (securityAuthorityId != 0)
                {
                    // FIND WORK TEAM MEMBERSHIP RECORD THAT IS SELETED

                    Mercury.Server.Application.WorkTeamMembership membership = null;

                    foreach (Mercury.Server.Application.WorkTeamMembership currentMembership in Case.AssignedToWorkTeam.Membership)
                    {
                        if ((currentMembership.SecurityAuthorityId == securityAuthorityId) && (currentMembership.UserAccountId == userAccountId))
                        {
                            membership = currentMembership;
                        }
                    }

                    if (membership != null)
                    {
                        response = MercuryApplication.MemberCase_AssignToUser(Case,

                                                                              membership.SecurityAuthorityId,

                                                                              membership.UserAccountId,

                                                                              membership.UserAccountName,

                                                                              membership.UserDisplayName

                                                                              );
                    }
                }

                else   // REQUEST TO UNASSIGN FROM CURRENT USER

                {
                    response = MercuryApplication.MemberCase_AssignToUser(Case, 0, String.Empty, String.Empty, String.Empty);
                }
            }

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

                // UPDATE FORM FROM UPDATED CASE RECEVIED THROUGH RESPONSE

                if (response.MemberCase != null)
                {
                    Case = new Client.Core.Individual.Case.MemberCase(MercuryApplication, response.MemberCase);
                }
            }

            return;
        }