Пример #1
0
        public void ProcessRequest(HttpContext Context)
        {
            if (Context.Session["profileFriendID"] != null)
            {

                string memberId = Context.Request.QueryString["id"]; //get the querystring value that was pass on the ImageURL (see GridView MarkUp in Page1.aspx)
                memberId = SSTCryptographer.Encrypt(memberId);

                Member aMember = new Member(memberId);

                if (memberId != null)
                {
                    MemberInfoDAL dal = new MemberInfoDAL();
                    aMember = dal.GetAllMemberInfo(aMember);

                    MemoryStream ms = new MemoryStream();
                    aMember.ProfilePicture.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);

                    byte[] file = ms.ToArray();
                    ms.Write(file, 0, file.Length);
                    Context.Response.Buffer = true;
                    Context.Response.BinaryWrite(file);
                    ms.Dispose();
                }
                Context.Session["profileFriendID"] = Context.Session["memberID"].ToString();

            }
            else
            {
                string memberId = Context.Request.QueryString["id"]; //get the querystring value that was pass on the ImageURL (see GridView MarkUp in Page1.aspx)
                memberId = SSTCryptographer.Encrypt(memberId);

                Member aMember = new Member(memberId);

                if (memberId != null)
                {
                    MemberInfoDAL dal = new MemberInfoDAL();
                    aMember = dal.GetAllMemberInfo(aMember);

                    MemoryStream ms = new MemoryStream();
                    aMember.ProfilePicture.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);

                    byte[] file = ms.ToArray();
                    ms.Write(file, 0, file.Length);
                    Context.Response.Buffer = true;
                    Context.Response.BinaryWrite(file);
                    ms.Dispose();
                }

            }
        }
Пример #2
0
        public void ProcessRequest(HttpContext Context)
        {
            if (Context.Session["profileFriendID"] != null)
            {
                string memberId = Context.Request.QueryString["id"]; //get the querystring value that was pass on the ImageURL (see GridView MarkUp in Page1.aspx)
                memberId = SSTCryptographer.Encrypt(memberId);


                Member aMember = new Member(memberId);

                if (memberId != null)
                {
                    MemberInfoDAL dal = new MemberInfoDAL();
                    aMember = dal.GetAllMemberInfo(aMember);

                    MemoryStream ms = new MemoryStream();
                    aMember.ProfilePicture.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);

                    byte[] file = ms.ToArray();
                    ms.Write(file, 0, file.Length);
                    Context.Response.Buffer = true;
                    Context.Response.BinaryWrite(file);
                    ms.Dispose();
                }
                Context.Session["profileFriendID"] = Context.Session["memberID"].ToString();
            }
            else
            {
                string memberId = Context.Request.QueryString["id"]; //get the querystring value that was pass on the ImageURL (see GridView MarkUp in Page1.aspx)
                memberId = SSTCryptographer.Encrypt(memberId);


                Member aMember = new Member(memberId);

                if (memberId != null)
                {
                    MemberInfoDAL dal = new MemberInfoDAL();
                    aMember = dal.GetAllMemberInfo(aMember);

                    MemoryStream ms = new MemoryStream();
                    aMember.ProfilePicture.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);

                    byte[] file = ms.ToArray();
                    ms.Write(file, 0, file.Length);
                    Context.Response.Buffer = true;
                    Context.Response.BinaryWrite(file);
                    ms.Dispose();
                }
            }
        }
Пример #3
0
        private void GenerateProfile(Member aMember)
        {
            #region RIGHT COLUMN GET ALL JOINED GROUPS

            //JOINED GROUPS==============================================================================

            Reusable_Methods reusable_Methods = new Reusable_Methods(aMember);

            allgroups = reusable_Methods.RightColumnGetAllJoinedGroups();
            //============================================================================================
            #endregion

            #region RIGHT COLUMN MEMBER INFORMATION
            //MEMBER INFORMATION ON RIGHT COLUMN==========================================================================

            //MEMBER INFO AND PROFILE



            MemberInfoDAL dal = new MemberInfoDAL();


            //  Member member = new Member();
            aMember = dal.GetAllMemberInfo(aMember);

            profilesMemnerID.Value = aMember.MemberId;



            //Set the ImageUrl to the path of the handler with the querystring value
            ProfileImage.ImageUrl = "ProfilePicHandler.ashx?id=" + SSTCryptographer.Decrypt(aMember.MemberId);
            //call the method to get the image information and display it in Label Control


            //=======================================================================================================
            #endregion

            #region MAIN COLUMN MEMBER INFORMATION
            //MEMBER INFORMATION ON MAIN DISPLAY==========================================================================
            StringBuilder memberData = new StringBuilder();

            memberData.Append("<tr><td style='font-weight: bold;' > ");
            memberData.Append("First Name:</td><td>");
            memberData.Append(aMember.FirstName);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;'>");

            memberData.Append("Last Name:</td><td>");
            memberData.Append(aMember.LastName);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Display Name:</td><td>");
            memberData.Append(aMember.DisplayName);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Email:</td><td>");
            memberData.Append(aMember.Email);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Description:</td><td>");
            memberData.Append(aMember.Description);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Campus:</td><td>");
            memberData.Append(aMember.Campus);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Account Type:</td><td>");
            memberData.Append(aMember.MemberType);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");


            if (aMember.IsOnline == false)
            {
                memberData.Append("Online Status:</td><td style='color:red;'>");
                memberData.Append("Offline");
                memberData.Append("</td></tr>");
            }
            else
            {
                memberData.Append("Online Status:</td><td style='color:green;'>");
                memberData.Append("Online");
                memberData.Append("</td></tr>");
            }

            memberDataMain = memberData.ToString();


            #endregion

            #region MAIN COLUMN MOST RECENT POST DATE
            //MOST RECENT POST DATE ON MAIN DISPLAY==========================================================================
            NotificationDAL notificationDAL = new NotificationDAL();

            StringBuilder recentPostDate = new StringBuilder();
            Post          aPost          = new Post();
            aPost = notificationDAL.GetMostRecentPostDate(aMember);


            if (aPost.CreateDate == DateTime.Parse("1/1/0001 12:00:00 AM"))
            {
                reusable_Methods = new Reusable_Methods();
                string date = reusable_Methods.FormatDateTime(aPost.CreateDate);



                recentPostDate.Append("<p style='font-size: 1.2em; color: #A3ADB5;'>Most recent post date<span style='color: #0e93be;'> - ");
                recentPostDate.Append("No posts");
                recentPostDate.Append("</span></p>");

                mostRecentPostDate = recentPostDate.ToString();
            }
            else
            {
                reusable_Methods = new Reusable_Methods();
                string date = reusable_Methods.FormatDateTime(aPost.CreateDate);



                recentPostDate.Append("<p style='font-size: 1.2em; color: #A3ADB5;'>Most recent post date<span style='color: #0e93be;'> - ");
                recentPostDate.Append(date);
                recentPostDate.Append("</span></p>");

                mostRecentPostDate = recentPostDate.ToString();
            }
            #endregion

            #region MAIN ACTUAL DISPLAY NAME
            MemberInfoDAL memberInfoDAL = new MemberInfoDAL();
            Member        actualMember  = new Member(Context.Session["memberID"].ToString());
            aMember = memberInfoDAL.GetActualDisplayName(actualMember);

            actualMemberDisplayName = aMember.DisplayName;
            #endregion
        }
Пример #4
0
        private void GenerateProfile(Member aMember)
        {
            #region RIGHT COLUMN GET ALL JOINED GROUPS

            //JOINED GROUPS==============================================================================

            Reusable_Methods reusable_Methods = new Reusable_Methods(aMember);

            allgroups = reusable_Methods.RightColumnGetAllJoinedGroups();
            //============================================================================================
            #endregion

            #region RIGHT COLUMN MEMBER INFORMATION
            //MEMBER INFORMATION ON RIGHT COLUMN==========================================================================

            //MEMBER INFO AND PROFILE

            MemberInfoDAL dal = new MemberInfoDAL();

            //  Member member = new Member();
            aMember = dal.GetAllMemberInfo(aMember);

            profilesMemnerID.Value = aMember.MemberId;

            //Set the ImageUrl to the path of the handler with the querystring value
            ProfileImage.ImageUrl = "ProfilePicHandler.ashx?id=" + SSTCryptographer.Decrypt(aMember.MemberId);
            //call the method to get the image information and display it in Label Control

            //=======================================================================================================
            #endregion

            #region MAIN COLUMN MEMBER INFORMATION
            //MEMBER INFORMATION ON MAIN DISPLAY==========================================================================
            StringBuilder memberData = new StringBuilder();

            memberData.Append("<tr><td style='font-weight: bold;' > ");
            memberData.Append("First Name:</td><td>");
            memberData.Append(aMember.FirstName);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;'>");

            memberData.Append("Last Name:</td><td>");
            memberData.Append(aMember.LastName);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Display Name:</td><td>");
            memberData.Append(aMember.DisplayName);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Email:</td><td>");
            memberData.Append(aMember.Email);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Description:</td><td>");
            memberData.Append(aMember.Description);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Campus:</td><td>");
            memberData.Append(aMember.Campus);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Account Type:</td><td>");
            memberData.Append(aMember.MemberType);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            if (aMember.IsOnline == false)
            {
                memberData.Append("Online Status:</td><td style='color:red;'>");
                memberData.Append("Offline");
                memberData.Append("</td></tr>");

            }
            else
            {
                memberData.Append("Online Status:</td><td style='color:green;'>");
                memberData.Append("Online");
                memberData.Append("</td></tr>");

            }

            memberDataMain = memberData.ToString();

            #endregion

            #region MAIN COLUMN MOST RECENT POST DATE
            //MOST RECENT POST DATE ON MAIN DISPLAY==========================================================================
            NotificationDAL notificationDAL = new NotificationDAL();

            StringBuilder recentPostDate = new StringBuilder();
            Post aPost = new Post();
            aPost = notificationDAL.GetMostRecentPostDate(aMember);

            if (aPost.CreateDate == DateTime.Parse("1/1/0001 12:00:00 AM"))
            {
                reusable_Methods = new Reusable_Methods();
                string date = reusable_Methods.FormatDateTime(aPost.CreateDate);

                recentPostDate.Append("<p style='font-size: 1.2em; color: #A3ADB5;'>Most recent post date<span style='color: #0e93be;'> - ");
                recentPostDate.Append("No posts");
                recentPostDate.Append("</span></p>");

                mostRecentPostDate = recentPostDate.ToString();
            }
            else
            {
                reusable_Methods = new Reusable_Methods();
                string date = reusable_Methods.FormatDateTime(aPost.CreateDate);

                recentPostDate.Append("<p style='font-size: 1.2em; color: #A3ADB5;'>Most recent post date<span style='color: #0e93be;'> - ");
                recentPostDate.Append(date);
                recentPostDate.Append("</span></p>");

                mostRecentPostDate = recentPostDate.ToString();
            }
            #endregion

            #region MAIN ACTUAL DISPLAY NAME
            MemberInfoDAL memberInfoDAL = new MemberInfoDAL();
            Member actualMember = new Member(Context.Session["memberID"].ToString());
            aMember = memberInfoDAL.GetActualDisplayName(actualMember);

            actualMemberDisplayName = aMember.DisplayName;
            #endregion
        }