private void SetMatchp(int OtherUserID) { try { string _Overallp = string.Empty; string _Criteriap = string.Empty; string _Questionsp = string.Empty; int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); string SitePath = ConfigurationManager.AppSettings["SitePath"].ToString(); _Questionsp = new QuestionsMatchPercentage().GetMatchPercentage(_UserID, OtherUserID).ToString(); _Criteriap = new CriteriaMatchPercentage().GetMatchPercentage(_UserID, OtherUserID).ToString(); _Overallp = new QuestionsMatch().GetOverallMatchPercentage(_UserID, OtherUserID).ToString(); if (_Overallp != "-1") { liOverallPercentText.InnerText = _Overallp + "%"; OverallPercentWidth.Attributes.Add("style", "width:" + _Overallp + "%"); } else { liOverallPercentText.InnerText = "?"; OverallPercentWidth.Attributes.Add("style", "width:0%"); } if (_Criteriap != "-1") { liCriteriaPercentText.InnerText = _Criteriap + "%"; CriteriaPercentWidth.Attributes.Add("style", "width:" + _Criteriap + "%"); } else { liCriteriaPercentText.InnerText = "?"; CriteriaPercentWidth.Attributes.Add("style", "width:0%"); } if (_Questionsp != "-1") { liQuestionsPercentText.InnerText = _Questionsp + "%"; QuestionsPercentWidth.Attributes.Add("style", "width:" + _Questionsp + "%"); } else { liQuestionsPercentText.InnerText = "?"; QuestionsPercentWidth.Attributes.Add("style", "width:0%"); } // User Info TempUser OtherUserDetails = new TempUser().GetUserDetails(OtherUserID); divUserName.InnerText = OtherUserDetails.LoginName; //get user last online time DateTime?_UserLastOnlineTime = new LoginDetails().GetUserLastLoginTime(OtherUserID); spnLastOnlineTime.InnerText = _UserLastOnlineTime.ToString(); if (OtherUserDetails.ProfilePhoto != null) { ImgProfilePicture.Src = new Utils().GetPhotoPCTPath(OtherUserDetails.ProfilePhoto.PhotoID, Page.Request); } else { if (OtherUserDetails.Gender == 1) { ImgProfilePicture.Src = SitePath + "web/images/M.png"; } else { ImgProfilePicture.Src = SitePath + "web/images/F.png"; } } } catch (Exception ex) { } }
private void SetMatchp() { try { string _Overallp = string.Empty; string _Criteriap = string.Empty; string _Questionsp = string.Empty; int OtherUserID = 0; if (Request.QueryString["OtherUserID"] != null) { OtherUserID = Convert.ToInt32(Request.QueryString["OtherUserID"]); int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); string SitePath = ConfigurationManager.AppSettings["SitePath"].ToString(); _Questionsp = new QuestionsMatchPercentage().GetMatchPercentage(_UserID, OtherUserID).ToString(); _Criteriap = new CriteriaMatchPercentage().GetMatchPercentage(_UserID, OtherUserID).ToString(); _Overallp = new QuestionsMatch().GetOverallMatchPercentage(_UserID, OtherUserID).ToString(); if (_Overallp != "-1") { lblOverallp.InnerText = _Overallp + "%"; lblOverall.Attributes.Add("style", "width:" + _Overallp + "%"); } else { lblOverallp.InnerText = "?"; lblOverall.Attributes.Add("style", "width:0%"); } if (_Criteriap != "-1") { lblCriteriap.InnerText = _Criteriap + "%"; lblCriteria.Attributes.Add("style", "width:" + _Criteriap + "%"); } else { lblCriteriap.InnerText = "?"; lblCriteria.Attributes.Add("style", "width:0%"); } if (_Questionsp != "-1") { lblQuestionsp.InnerText = _Questionsp + "%"; lblQuestions.Attributes.Add("style", "width:" + _Questionsp + "%"); } else { lblQuestionsp.InnerText = "?"; lblQuestions.Attributes.Add("style", "width:0%"); } // User Info User OtherUserDetails = new User().GetUserDetails(OtherUserID); divUserName.InnerText = "You rematched " + OtherUserDetails.LoginName; imgOtherProfilePic.Alt = OtherUserDetails.LoginName; if (OtherUserDetails.ProfilePhoto != null) { imgOtherProfilePic.Src = new Utils().GetPhotoPCTPath(OtherUserDetails.ProfilePhoto.PhotoID, Page.Request); } else { if (OtherUserDetails.Gender == 1) { imgOtherProfilePic.Src = SitePath + "web/images/M.png"; } else { imgOtherProfilePic.Src = SitePath + "web/images/F.png"; } } } } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { try { Response.ContentType = "image/png"; string SitePath = ConfigurationManager.AppSettings["SitePath"].ToString(); if (Request.QueryString["OtherUserID"] != null && Request.QueryString["Type"] != null) { if (HttpContext.Current.User.Identity.Name != "") { int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); int OtherUserID = Convert.ToInt32(Request.QueryString["OtherUserID"]); decimal _CriteriaMatch = new CriteriaMatchPercentage().GetMatchPercentage(_UserID, OtherUserID); imgCriteriaTotal.Src = SitePath + "web/service/OverallMatchImage?p=" + _CriteriaMatch.ToString(); decimal _CriteriaTheyMatchYou = new CriteriaMatch()._GetCriteriaSinglePercentage(OtherUserID, _UserID); imgCriteriaTheyMatchYou.Src = SitePath + "web/service/OverallMatchImage?p=" + _CriteriaTheyMatchYou.ToString(); decimal _CriteriaYouMatchThem = new CriteriaMatch()._GetCriteriaSinglePercentage(_UserID, OtherUserID); imgCriteriaYouMatchThem.Src = SitePath + "web/service/OverallMatchImage?p=" + _CriteriaYouMatchThem.ToString(); decimal _PhilosophyMatch = new QuestionsMatchPercentage().GetMatchPercentage(_UserID, OtherUserID); imgPhilosophyTotal.Src = SitePath + "web/service/OverallMatchImage?p=" + _PhilosophyMatch.ToString(); decimal _PhilosophyTheyMatchYou = new QuestionsMatch()._GetQuestionsSinglePercentage(OtherUserID, _UserID); imgPhilosophyTheyMatchYou.Src = SitePath + "web/service/OverallMatchImage?p=" + _PhilosophyTheyMatchYou.ToString(); decimal _PhilosophyYouMatchThem = new QuestionsMatch()._GetQuestionsSinglePercentage(_UserID, OtherUserID); imgPhilosophyYouMatchThem.Src = SitePath + "web/service/OverallMatchImage?p=" + _PhilosophyYouMatchThem.ToString(); //bind userpics User _GetUser = new User().GetUserDetails(_UserID); User _GetOtherUser = new User().GetUserDetails(OtherUserID); DivThisUserName.InnerHtml = _GetUser.LoginName; DivOtherUserNane.InnerHtml = _GetOtherUser.LoginName; if (_GetUser != null && _GetOtherUser != null) { if (_GetUser.ProfilePhoto != null) { UserPic.Src = new Utils().GetPhotoPCTPath(_GetUser.ProfilePhoto.PhotoID, Page.Request); } else { if (_GetUser.Gender == 1) { UserPic.Src = SitePath + "web/images/M.png"; } else { UserPic.Src = SitePath + "web/images/F.png"; } } if (_GetOtherUser.ProfilePhoto != null) { OtherUserPic.Src = new Utils().GetPhotoPCTPath(_GetOtherUser.ProfilePhoto.PhotoID, Page.Request); } else { if (_GetOtherUser.Gender == 1) { OtherUserPic.Src = SitePath + "web/images/M.png"; } else { OtherUserPic.Src = SitePath + "web/images/F.png"; } } } //show and Hide criteria or questions string _Type = Request.QueryString["Type"].ToString(); if (_Type == "c") { divCriteria.Visible = true; } else { divQuestions.Visible = true; } } } } catch (Exception ex) { } }