// POST api/<controller> public bool Post([FromBody] GenderClass Gender) { try { int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); bool _Return = new IntellidateR1.User().ChangeUserGender(_UserID, Gender.GenderSelected); return(true); } catch (Exception) { return(false); } }
// POST api/<controller> public bool Post([FromBody] EmailAddressClass EmailAddress) { try { int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); bool _Return = new IntellidateR1.User().ChangeEmailAddress(_UserID, EmailAddress.EmailAddressSelected); return(true); } catch (Exception) { return(false); } }
// POST api/<controller> public bool Post([FromBody] PasswordClass Password) { try { int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); bool _Return = new IntellidateR1.User().ChangePassword(_UserID, Password.PasswordSelected); return(true); } catch (Exception) { return(false); } }
public bool Post([FromBody] ForgotPassword _ForgotPassword) { IntellidateR1.User _UserDetails = new IntellidateR1.User().GetUserDetails(_ForgotPassword.EmailAddress, true); if (_UserDetails == null) { return(false); } else { if (_UserDetails.Status == "A") { //send only 3 times for a day int _PasswordSendCount = new PasswordEmailAttempts().GetPasswordSentCount(_UserDetails.EmailAddress); if (_PasswordSendCount <= 3) { //send password to email address. string _Subject = ConfigurationManager.AppSettings["ForgotPwdEmailSubject"].ToString(); string _BodyPath = File.ReadAllText(ConfigurationManager.AppSettings["ForgotPwdEmailTemplatePath"].ToString()); int _Priority = Convert.ToInt32(ConfigurationManager.AppSettings["ForgotPwdEmailPriority"].ToString()); string _Body = string.Empty; string EmailAddress = _UserDetails.EmailAddress; string _password = _UserDetails.Password; int _UserID = _UserDetails.UserID; _Body = new Utils().ConvertEmailBody(_BodyPath); _Body = _Body.Replace("[EMAIL_ID]", EmailAddress); _Body = _Body.Replace("[PRIORITY]", _Priority.ToString()); _Body = _Body.Replace("[USER_PASSWORD]", _password); if (_Body != "" && EmailAddress != "") { new EmailQueue().EnqueEmail(_UserID, EmailAddress, _Subject, _Body, _Priority); new PasswordEmailAttempts().AddSendPasswordAttempt(EmailAddress); } return(true); } else { return(true); } } else { return(false); } } }
// GET api/<controller> public string Get() { try { int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); IntellidateR1.User UserDetails = new IntellidateR1.User().GetUserDetails(_UserID); return(UserDetails.EmailAddress); } catch (Exception) { return(""); } }
public bool Post([FromBody] EmailVerify _Obj) { try { int UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); IntellidateR1.User GetUser = new IntellidateR1.User().GetUserDetails(UserID); bool _status = new SecurityCode().VerifyEmailStatus(UserID, _Obj.SCode, GetUser.EmailAddress); return(_status); } catch (Exception) { return(false); } }
// GET api/<controller> public string Get() { try { int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); IntellidateR1.User UserDetails = new IntellidateR1.User().GetUserDetails(_UserID); return(UserDetails.DateOfBirth.ToString("MM-dd-yyyy")); } catch (Exception) { return(""); } }
// POST api/<controller> public bool Post([FromBody] PasswordConfirm PasswordConfirm) { int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); IntellidateR1.User m_UserObject = new IntellidateR1.User().GetUserDetails(_UserID); if (m_UserObject != null) { if (m_UserObject.Password == PasswordConfirm.Password) { return(true); } } return(false); }
// GET api/<controller> public int Get() { try { int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); IntellidateR1.User UserDetails = new IntellidateR1.User().GetUserDetails(_UserID); return(UserDetails.Gender); } catch (Exception) { return(1); } }
// POST api/<controller> public string Post([FromBody] UserDisplayPicClass UserDisplayPic) { try { IntellidateR1.User UserDetails = new IntellidateR1.User().GetUserDetails(UserDisplayPic.UserID); string SitePath = System.Configuration.ConfigurationManager.AppSettings["SitePath"].ToString(); string _profilePhoto = string.Empty; if (UserDetails.ProfilePhoto != null) { string _UserPhoto = new Utils().GetSmallPPCTPath(UserDetails.ProfilePhoto.PhotoID); if (_UserPhoto != "") { _profilePhoto = _UserPhoto; } else { if (UserDetails.Gender == 1) { _profilePhoto = SitePath + "web/images/M.png"; } else { _profilePhoto = SitePath + "web/images/F.png"; } } } else { if (UserDetails.Gender == 1) { _profilePhoto = SitePath + "web/images/M.png"; } else { _profilePhoto = SitePath + "web/images/F.png"; } } return(_profilePhoto); } catch (Exception) { return(""); } }
public bool Post([FromBody] SetFemaleConversation _SetObj) { try { int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); IntellidateR1.User m_UserDetails = new IntellidateR1.User().GetUserDetails(_UserID); bool m_Res = false; if (m_UserDetails.Gender == 2) { // m_Res = new SetFemaleConversationLimit().UpdateFemaleConversationLimit(_UserID, _SetObj.OneTimeLimit); } return(m_Res); } catch (Exception) { return(false); } }
// POST api/<controller> public void Post([FromBody] DefaultPhoto m_DefaultPhoto) { try { int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); string _RootFolder = ConfigurationManager.AppSettings["PhotosFolder"].ToString(); Photo m_PhotoDetails = new Photo().GetPhotoDetails(m_DefaultPhoto.PhotoID); string _PhotoPath = _RootFolder + m_PhotoDetails.PhotoPath; if (m_PhotoDetails.UserID != _UserID) { return; } string _CurrentDefaultPhoto = ""; IntellidateR1.User m_UserDetails = new IntellidateR1.User().GetUserDetails(_UserID); if (m_UserDetails.ProfilePhoto != null) { _CurrentDefaultPhoto = _RootFolder + m_UserDetails.ProfilePhoto.PhotoPath; _CurrentDefaultPhoto = MakeCroppedFileName(_CurrentDefaultPhoto); if (File.Exists(_CurrentDefaultPhoto)) { try { File.Delete(_CurrentDefaultPhoto); } catch (Exception) { } } } CropPhoto(_PhotoPath, (int)Convert.ToDecimal(m_DefaultPhoto.X1), (int)Convert.ToDecimal(m_DefaultPhoto.Y1), (int)Convert.ToDecimal(m_DefaultPhoto.X2), (int)Convert.ToDecimal(m_DefaultPhoto.Y2)); new Photo().UpdateDefaultPhoto(_UserID, m_DefaultPhoto.PhotoID); } catch (Exception) { return; } }
public List <ViewedProfileClass> GetProfileViewes(ProfileView [] _ObjProfiles) { try { List <ViewedProfileClass> _lstUserProfiles = new List <ViewedProfileClass>(); int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); ViewedProfileClass _ObjViewedProfile; ProfileView[] _ProfileViews = _ObjProfiles.GroupBy(x => x.UserRefID).Select(y => y.First()).ToArray(); string SitePath = ConfigurationManager.AppSettings["SitePath"].ToString(); foreach (var item in _ProfileViews) { _ObjViewedProfile = new ViewedProfileClass(); _ObjViewedProfile.TotalViews = _ObjProfiles.Count().ToString(); var _OtherUserDetails = new IntellidateR1.User().GetUserDetails(item.UserRefID); _ObjViewedProfile.LoginName = _OtherUserDetails.LoginName; string _MutualPercentage = new PhilosophyMatch().GetOverallMatchPercentage(_UserID, item.UserRefID).ToString(); if (_OtherUserDetails.IsUserOnline) { _ObjViewedProfile.OnlinePhoto = SitePath + "web/images/glassy_button_green.png"; } else { //imgOtherUser_Online.Src = SitePath + "web/images/glassy_button_grey.png"; } if (_OtherUserDetails.ProfilePhoto != null) { string PhotoPath = ConfigurationManager.AppSettings["PhotosFolder"].ToString() + _OtherUserDetails.ProfilePhoto.PhotoPath; string EncriptData = new IntellidateR1.EncryptDecrypt().Encrypt(PhotoPath + "&120&120"); _ObjViewedProfile.UserPhoto = SitePath + "web/PhotoView?ImagePath=" + EncriptData; } _ObjViewedProfile.Matchp = _MutualPercentage; _ObjViewedProfile.MatchpPhoto = SitePath + "web/Percentage?v=" + _MutualPercentage; int _EachViewCount = _ObjProfiles.Where(x => x.UserRefID == item.UserRefID).Count(); if (_EachViewCount == 1) { _ObjViewedProfile.EachViewCountText = "1 time"; } else if (_EachViewCount == 2) { _ObjViewedProfile.EachViewCountText = "2 times"; } else { _ObjViewedProfile.EachViewCountText = "3 or more times"; } _ObjViewedProfile.LastOnline = ""; if (_OtherUserDetails.IsUserOnline) { _ObjViewedProfile.OnlinePhoto = SitePath + "web/images/glassy_button_green.png"; } else { _ObjViewedProfile.OnlinePhoto = ""; } _lstUserProfiles.Add(_ObjViewedProfile); } return(_lstUserProfiles); } catch (Exception) { return(null); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["em"] != null && Request.QueryString["dt"] != null) { //make user log out here string SitePath = ConfigurationManager.AppSettings["SitePath"].ToString(); try { try { int UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); new OnlineUsers().RemoveOnlineUser(UserID); Session.Abandon(); } catch (Exception) { } HttpRequest currentRequest = HttpContext.Current.Request; HttpCookie authenticationCookie = currentRequest.Cookies[FormsAuthentication.FormsCookieName]; if (authenticationCookie != null) { // Crack the Cookie open var formsAuthenticationTicket = FormsAuthentication.Decrypt(authenticationCookie.Value); HttpCookie intellidateCookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(formsAuthenticationTicket)); intellidateCookie.Expires = DateTime.Now.AddYears(-1); Response.Cookies.Add(intellidateCookie); } } catch (Exception) { } string EmailAddress = Request.QueryString["em"].ToString(); DateTime _SendDate = Convert.ToDateTime(Request.QueryString["dt"].ToString()); DateTime _ExpiredDate = _SendDate.AddHours(24); DateTime _TodayDate = DateTime.Now; //email verification only done with in one day if (_TodayDate <= _ExpiredDate) { IntellidateR1.User _User = new IntellidateR1.User().GetUserDetails(EmailAddress, true); bool m_UpdateEmailVerification = new UserAccountSettings().SetUserEmailVerification(_User.UserID, EmailAddress); if (m_UpdateEmailVerification) { divMessage.InnerText = "Your email verification successfully completed."; } else { divMessage.InnerText = "Your email verification link is expired."; } } else { divMessage.InnerText = "Your email verification link is expired."; } } string _Scripts = ""; List <string> _LoadCss = new List <string>(); _LoadCss.Add("css\\default"); _LoadCss.Add("css\\intelliwindow"); _Scripts = _Scripts + "\n" + Helper.LoadCSS(_LoadCss.ToArray()); ltScripts.Text = _Scripts; } }