private void LoadProfile()
        {
            uiPanelHideProfile.Visible = false;
            uipanelProfile.Visible = true;
            if (userId != 0)
            {
                Member member = new Member();
                member.LoadByPrimaryKey(userId);

                // load settings
                MemberSetting setting = new MemberSetting();
                setting.GetMemberSettingsByMemberID(member.MemberID);
                if ((setting.RowCount > 0))
                {
                    if (!setting.IsColumnNull("HideProfile"))
                    {
                        if (setting.HideProfile)
                        {
                            uiPanelHideProfile.Visible = true;
                            uipanelProfile.Visible = false;
                        }
                    }
                    if (!setting.IsColumnNull("HidePics"))
                        uiPanelPics.Visible = !setting.HidePics;
                }

                uiLabelName.Text = member.Name;

                if (!member.IsColumnNull("ReligionID"))
                {
                    Religion religion = new Religion();
                    religion.LoadByPrimaryKey(member.ReligionID);
                    uiLabelReligion.Text = religion.Name;
                }
                uiLabelJob.Text = member.JobTitle;
                if (!member.IsColumnNull("BirthDate"))
                {
                    uiLabelDOP.Text = member.BirthDate.ToString("yyyy/MM/dd");
                }
                if (!member.IsColumnNull("CountryID"))
                {
                    Country country = new Country();
                    if (member.CountryID != 0)
                    {
                        country.LoadByPrimaryKey(member.CountryID);
                        uiLabelCountry.Text = country.Name;
                    }
                }
                uiLabelBestFood.Text = member.BestFood;
                uiLabelBestCar.Text = member.BestCar;
                uiLabelBestTeam.Text = member.BestTeam;
                uiLabelBestCountry.Text = member.BestCounrty;
                uiHyperLinkFb.NavigateUrl = member.FbURL;
                uiHyperLinktwitter.NavigateUrl = member.TURL;
                uiHyperLinkyt.NavigateUrl = member.YtURL;

                uiLabelCreatedDate.Text = Membership.GetUser().CreationDate.ToString("yyyy/MM/dd");
                if (member.MemberType.MemberTypeSpecDurationID != Helper.Defaults.MemberTypeSpecDurationID)
                {
                    uiLabelAccountType.Text = member.MemberType.MemberTypeSpecDuration.MemberTypeSpec.Name;
                    uiLabelAccountType.Attributes.Add("style", "background-color:" + member.MemberType.MemberTypeSpecDuration.MemberTypeSpec.Color + ";color:#fff;");

                    if (!member.MemberType.IsColumnNull("EndDate"))
                        uiLabelTypeExpiry.Text = member.MemberType.EndDate.ToString("yyyy/MM/dd");
                }
                if (!member.IsColumnNull("ProfilePic"))
                {
                    uiImageMain.ImageUrl = "images.aspx?Image=" + member.ProfilePic;
                }
                ///////////////////////////////
                uiLabelInterests.Text = member.Interests;

                ProfileLike likes = new ProfileLike();
                likes.GetLikeCount(member.MemberID);
                uiLabelLikeCount.Text = likes.RowCount.ToString();

                likes.LoadByPrimaryKey(Member.CurrentMemberID, member.MemberID);
                uiLinkButtonLike.OnClientClick = "return ToggleProfileLike(" + Member.CurrentMemberID.ToString() + ", " + member.MemberID + ")";
                uiLinkButtonUnLike.OnClientClick = "return ToggleProfileLike(" + Member.CurrentMemberID.ToString() + ", " + member.MemberID + ")";
                if (likes.RowCount > 0)
                {
                    uiLinkButtonUnLike.Attributes.Add("style","display:inline;padding:0px;");
                    uiLinkButtonLike.Attributes.Add("style", "display:none;padding:0px;");

                }
                else
                {
                    uiLinkButtonUnLike.Attributes.Add("style", "display:none;padding:0px;");
                    uiLinkButtonLike.Attributes.Add("style", "display:inline;padding:0px;");
                }

                MemberPic pics = new MemberPic();
                pics.GetMemberPicsByMemberID(member.MemberID);
                uiRepeaterPhotos.DataSource = pics.DefaultView;
                uiRepeaterPhotos.DataBind();
            }
            else
            {
                Response.Redirect("home.aspx");
            }
        }
Esempio n. 2
0
        private void LoadProfile()
        {
            if (Request.IsAuthenticated)
            {
                Member member = new Member();
                member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString()));
                uiLabelName.Text = uiTextBoxName.Text = member.Name;
                uiHiddenFieldCID_profile.Value = member.MemberID.ToString();
                if (!member.IsColumnNull("ReligionID"))
                {
                    Religion religion = new Religion();
                    uiDropDownListReligion.SelectedValue = member.ReligionID.ToString();
                    religion.LoadByPrimaryKey(member.ReligionID);
                    uiLabelReligion.Text = religion.Name;
                }
                uiLabelJob.Text = uiTextBoxJob.Text = member.JobTitle;
                if (!member.IsColumnNull("BirthDate"))
                {
                    uiLabelDOP.Text = uiTextBoxDOP.Text = member.BirthDate.ToString("yyyy/MM/dd");
                }
                if (!member.IsColumnNull("CountryID"))
                {
                    Country country = new Country();
                    if (member.CountryID != 0)
                        uiDropDownListCountry.SelectedValue = member.CountryID.ToString();
                    country.LoadByPrimaryKey(member.CountryID);
                    uiLabelCountry.Text = country.Name;
                }
                uiLabelBestFood.Text = uiTextBoxBestFood.Text = member.BestFood;
                uiLabelBestCar.Text = uiTextBoxBestCar.Text = member.BestCar;
                uiLabelBestTeam.Text = uiTextBoxBestTeam.Text = member.BestTeam;
                uiLabelBestCountry.Text = uiTextBoxBestCountry.Text = member.BestCounrty;
                uiLabelMail.Text = Membership.GetUser().Email;
                uiHyperLinkFb.NavigateUrl = uiTextBoxfb.Text = member.FbURL;
                uiHyperLinktwitter.NavigateUrl = uiTextBoxTwitter.Text = member.TURL;
                uiHyperLinkyt.NavigateUrl = uiTextBoxyt.Text = member.YtURL;

                uiLabelCreatedDate.Text = Membership.GetUser().CreationDate.ToString("yyyy/MM/dd");
                if (member.MemberType.MemberTypeSpecDurationID != Helper.Defaults.MemberTypeSpecDurationID)
                {
                    uiLabelAccountType.Text = member.MemberType.MemberTypeSpecDuration.MemberTypeSpec.Name;
                    if (!member.MemberType.IsColumnNull("EndDate"))
                        uiLabelTypeExpiry.Text = member.MemberType.EndDate.ToString("yyyy/MM/dd");
                }
                if (!member.IsColumnNull("ProfilePic"))
                {
                    uiImageMain.ImageUrl = "Thumb.aspx?w=100&h=100&Image=" + member.ProfilePic;
                }
                ///////////////////////////////
                uiLabelInterests.Text = uiTextBoxInterests.Text = member.Interests;

                ProfileLike likes = new ProfileLike();
                likes.GetLikeCount(member.MemberID);
                uiLabelLikeCount.Text = likes.RowCount.ToString();

                // load settings
                MemberSetting setting = new MemberSetting();
                setting.GetMemberSettingsByMemberID(member.MemberID);
                if (!(setting.RowCount > 0))
                {
                    return;
                }
                uiCheckBoxHidePics.Checked = setting.HidePics;
                uiCheckBoxHideRoomPics.Checked = setting.HideRoomPics;
                uiCheckBoxHideProfile.Checked = setting.HideProfile;
                uiCheckBoxNotifyOnPrivateChat.Checked = setting.NotifyOnPrivateChat;
                uiCheckBoxNotifyOnFriendsOnOff.Checked = setting.NotifyOnFriendsOnOff;
                uiCheckBoxNotifyOnFriendChangeStatus.Checked = setting.NotifyOnFriendChangeStatus;
                uiCheckBoxNotifyOnGetMsg.Checked = setting.NotifyOnGetMsg;
                uiCheckBoxNotifyOnVoiceMail.Checked = setting.NotifyOnVoiceMail;
                uiCheckBoxSearchMeByMail.Checked = setting.SearchMeByMail;
                uiCheckBoxVoiceNotfication.Checked = setting.VoiceNotfication;
                uiCheckBoxChangeMyStatus.Checked = setting.ChangeMyStatus;

                if (!setting.IsColumnNull("ChangeMyStatusMin"))
                    uiTextBoxChangeMyStatusMin.Text = setting.ChangeMyStatusMin.ToString();

                if (!setting.IsColumnNull("AcceptPM"))
                    uiRadioButtonListAcceptPM.SelectedValue = setting.AcceptPM ? "0" : "1";
                if (!setting.IsColumnNull("AcceptSMS"))
                    uiRadioButtonListAcceptSMS.SelectedValue = setting.AcceptSMS ? "0" : "1";
                if (!setting.IsColumnNull("AcceptMSG"))
                    uiRadioButtonListAcceptMsg.SelectedValue = setting.AcceptMSG ? "0" : "1";
                if (!setting.IsColumnNull("AcceptVoiceMail"))
                    uiRadioButtonListAcceptVoiceMail.SelectedValue = setting.AcceptVoiceMail ? "0" : "1";
                if (!setting.IsColumnNull("AcceptFiles"))
                    uiRadioButtonListAcceptFiles.SelectedValue = setting.AcceptFiles ? "0" : "1";
                if (!setting.IsColumnNull("AcceptInvitations"))
                    uiRadioButtonListAcceptInvitations.SelectedValue = setting.AcceptInvitations ? "0" : "1";

            }
            else
            {
                Response.Redirect("default.aspx");
            }
        }
Esempio n. 3
0
        public int ToggleProfileLike(int mid, int pid)
        {
            ProfileLike like = new ProfileLike();
            like.LoadByPrimaryKey(mid, pid);
            if (like.RowCount > 0)
            {
                like.MarkAsDeleted();
                like.Save();
                return 2;
            }
            else
            {
                like.AddNew();
                like.MemberID = mid;
                like.ProfileMemberID = pid;
                like.Save();
                return 1;
            }

            return 0;
        }