protected void Page_Load(object sender, EventArgs e)
        {
            Int64 forMemberId = 0;

            Int64 forEntityId = 0;


            if (MercuryApplication == null)
            {
                return;
            }


            if (!Page.IsPostBack)
            {
                #region Initial Page Load

                if (Request.QueryString["MemberId"] != null)
                {
                    if (Int64.TryParse((String)Request.QueryString ["MemberId"], out forMemberId))
                    {
                        Member = MercuryApplication.MemberGetDemographics(forMemberId, true);  // FORCE LOAD OF ALL DEMOGRAPHICS INFORMATION DURING ONE REQUEST

                        if (Member == null)
                        {
                            forMemberId = 0;
                        }
                    }
                }

                else if (Request.QueryString["EntityId"] != null)
                {
                    if (Int64.TryParse((String)Request.QueryString["EntityId"], out forEntityId))
                    {
                        Member = MercuryApplication.MemberGetDemographicsByEntityId(forEntityId, true);  // FORCE LOAD OF ALL DEMOGRAPHICS INFORMATION DURING ONE REQUEST

                        if (Member == null)
                        {
                            forMemberId = 0;
                        }

                        else
                        {
                            forMemberId = Member.Id;
                        }
                    }
                }


                if (forMemberId == 0)
                {
                    Server.Transfer("/PermissionDenied.aspx"); return;
                }

                Page.Title = "Member Profile: " + Member.Name;

                MemberDemographicHeaderLabel.Text = Member.Name + " (" + Member.CurrentAge + " | " + Member.GenderDescription + ((Member.MostRecentEnrollment != null) ? " | " + Member.MostRecentEnrollment.ProgramMemberId : String.Empty) + ")";


                #region Note Alert Icons

                Dictionary <Mercury.Server.Application.NoteImportance, Client.Core.Entity.EntityNote> entityNotes;

                entityNotes = MercuryApplication.EntityNoteGetMostRecentByAllImportances(Member.EntityId, true);


                Client.Core.Entity.EntityNote entityNote = null;

                //entityNote = MercuryApplication.EntityNoteGetMostRecentByImportance (Member.EntityId, Mercury.Server.Application.NoteImportance.Warning, false);

                if (entityNotes.ContainsKey(Mercury.Server.Application.NoteImportance.Warning))
                {
                    entityNote = entityNotes[Mercury.Server.Application.NoteImportance.Warning];
                }

                if (entityNote != null)
                {
                    if (entityNote.TerminationDate >= DateTime.Today)
                    {
                        EntityNoteWarning.Style.Clear();

                        EntityNoteWarning.Attributes.Add("title", "[" + entityNote.NoteTypeName + "] " + entityNote.Subject);

                        EntityNoteWarning.Visible = true;
                    }
                }

                //entityNote = MercuryApplication.EntityNoteGetMostRecentByImportance (Member.EntityId, Mercury.Server.Application.NoteImportance.Critical, false);

                entityNote = null;

                if (entityNotes.ContainsKey(Mercury.Server.Application.NoteImportance.Critical))
                {
                    entityNote = entityNotes[Mercury.Server.Application.NoteImportance.Critical];
                }

                if (entityNote != null)
                {
                    if (entityNote.TerminationDate >= DateTime.Today)
                    {
                        EntityNoteCritical.Style.Clear();

                        EntityNoteCritical.Attributes.Add("title", "[" + entityNote.NoteTypeName + "] " + entityNote.Subject);

                        EntityNoteCritical.Visible = true;
                    }
                }

                #endregion


                MemberDemographicsControl.InstanceId = SessionCachePrefix + "MemberDemographicsControl";

                MemberDemographicsControl.AllowUserInteraction = true;

                MemberDemographicsControl.InitializeMemberDemographics(Member.Id);


                MemberServicesControl.InstanceId = SessionCachePrefix + "MemberServicesControl";

                MemberMetricsControl.InstanceId = SessionCachePrefix + "MemberMetricsControl";

                MemberAuthorizedServicesControl.InstanceId = SessionCachePrefix + "MemberAuthorizedServicesControl";


                EntityContactHistoryControl.InstanceId = SessionCachePrefix + "EntityContactHistoryControl";

                EntityContactHistoryControl.AllowUserInteraction = true;


                EntityDocumentHistoryControl.InstanceId = SessionCachePrefix + "MemberDocumentHistoryControl";

                EntityDocumentHistoryControl.AllowUserInteraction = true;



                EntityNoteHistoryControl.InstanceId = SessionCachePrefix + "EntityNoteHistoryControl";

                EntityNoteHistoryControl.AllowUserInteraction = true;



                MemberWorkHistoryControl.InstanceId = SessionCachePrefix + "MemberWorkHistoryControl";

                MemberWorkHistoryControl.AllowUserInteraction = true;


                MemberClaimHistoryControl.InstanceId = SessionCachePrefix + "MemberClaimHistoryControl";

                MemberAuthorizationHistoryControl.InstanceId = SessionCachePrefix + "MemberAuthorizationHistoryControl";


                MemberCaseViewControl.InstanceId = SessionCachePrefix + "MemberCaseViewControl";

                MemberCaseViewControl.InitializeMember(Member);


                InitializeToolbar();

                InitializeMemberEnrollment();

                InitializeMemberEnrollmentTplCob();

                InitializePopulationCareManagement();

                #endregion
            } // Initial Page Load

            else   // Postback

            {
                Page.Title = "Member Profile: " + Member.Entity.Name;
            }

            // ApplySecurity ();

            return;
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Int64 forMemberCaseId = 0;


            if (MercuryApplication == null)
            {
                return;
            }


            if (!Page.IsPostBack)
            {
                #region Initial Page Load

                if (Request.QueryString["MemberCaseId"] != null)
                {
                    if (Int64.TryParse((String)Request.QueryString["MemberCaseId"], out forMemberCaseId))
                    {
                        Case = MercuryApplication.MemberCaseGet(forMemberCaseId, false);
                    }
                }


                if (Case == null)
                {
                    Server.Transfer("/PermissionDenied.aspx"); return;
                }

                InitializeAll();


                MemberDemographicsControl.InstanceId = SessionCachePrefix + "MemberDemographicsControl";

                MemberDemographicsControl.AllowUserInteraction = true;

                MemberDemographicsControl.InitializeMemberDemographics(Case.Member.Id);


                MemberCaseViewControl.InstanceId = SessionCachePrefix + "MemberCaseViewControl";

                MemberCaseViewControl.InitializeMember(Case.Member);


                #endregion
            } // Initial Page Load

            else   // Postback

            {
            }

            // ApplySecurity ();

            if (Case.Member != null)
            {
                Page.Title = "Member Case: " + Case.Member.Name + " (" + Case.Member.CurrentAge + " | " + Case.Member.GenderDescription + ((Case.Member.MostRecentEnrollment != null) ? " | " + Case.Member.MostRecentEnrollment.ProgramMemberId : String.Empty) + ")";
            }

            return;
        }