public GenralUserInfo(string _UserName,string _Password) { _ObjErrors = new Errors(); _ObjUser = new UserInfo(); _ObjUser.UserName = _UserName; _ObjUser.UserPassword = _Password; }
public void CheckAndSendPasswordPopUpTest() { UserInfoManager target = new UserInfoManager(); // TODO: Initialize to an appropriate value GenralUserInfo _objGenralUserInfo = new GenralUserInfo(); // TODO: Initialize to an appropriate value UserInfo objUserInfo = new UserInfo(); objUserInfo.UserEmail = "*****@*****.**"; _objGenralUserInfo.RecentUsers = objUserInfo; bool _Reset = false; // TODO: Initialize to an appropriate value target.CheckAndSendPassword(_objGenralUserInfo, _Reset); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public void UserSiteAdminLoginTest() { UserInfoManager target = new UserInfoManager(); // TODO: Initialize to an appropriate value //InsertDummyUser("tj_op"); GenralUserInfo objUser = new GenralUserInfo(); UserInfo objUserInfo = new UserInfo(); objUserInfo.UserName = "******"; objUserInfo.UserPassword = "******"; objUserInfo.FacebookUid = null; objUser.RecentUsers = objUserInfo; target.UserSiteAdminLogin(objUser); // Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public void UserLoginTest() { UserInfoManager target = new UserInfoManager(); // TODO: Initialize to an appropriate value GenralUserInfo objUser = new GenralUserInfo(); UserInfo objUserInfo = new UserInfo(); int UserId = InsertDummyUser("tj_op"); objUserInfo.UserName = "******"; objUserInfo.UserPassword = "******"; objUserInfo.FacebookUid = null; objUser.RecentUsers = objUserInfo; //testing UserLogin Function target.UserLogin(objUser); //Testing CheckLogin function inside UserLogin Function object[] objParam ={ objUser.RecentUsers.UserName.ToString(), objUser.RecentUsers.UserPassword.ToString(), objUser.RecentUsers.FacebookUid }; DataSet _objDataSet = GetDataSetWithoutCheckingIOVS("usp_ValidateWebsiteUser", objParam); int count = _objDataSet.Tables[0].Rows.Count; Assert.AreEqual(1, count); if (count > 0) { Assert.AreEqual(UserId, (int)_objDataSet.Tables[0].Rows[0]["UserId"]); Assert.AreEqual("tj_op", _objDataSet.Tables[0].Rows[0]["UserName"].ToString()); } }
public void CheckFacebookAccountAvailabilityTest() { UserInfoManager target = new UserInfoManager(); // TODO: Initialize to an appropriate value GenralUserInfo _objGenralUserInfo = new GenralUserInfo(); UserInfo objUserInfo = new UserInfo(); objUserInfo.UserName = "******"; objUserInfo.UserPassword = "******"; objUserInfo.FacebookUid = null; _objGenralUserInfo.RecentUsers = objUserInfo; //testing CheckFacebookAccountAvailability function target.CheckFacebookAccountAvailability(_objGenralUserInfo); //UserInfo objUserInfo = new UserInfo(); objUserInfo.UserName = "******"; objUserInfo.UserPassword = "******"; objUserInfo.FacebookUid = 1598003497; _objGenralUserInfo.RecentUsers = objUserInfo; //testing CheckFacebookAccountAvailability function inside CheckFacebookAccountAvailability function object[] objParam = { _objGenralUserInfo.RecentUsers.FacebookUid }; DataSet _objDataSet = GetDataSet("usp_GetFacebookUser", objParam); Assert.AreEqual(1, _objDataSet.Tables[0].Rows.Count); if (_objDataSet.Tables[0].Rows.Count > 0) { Assert.AreEqual(21058, (int)_objDataSet.Tables[0].Rows[0]["UserId"]); Assert.AreEqual("debbi_henkel", _objDataSet.Tables[0].Rows[0]["UserName"].ToString()); Assert.AreEqual("Debbi", _objDataSet.Tables[0].Rows[0]["FirstName"].ToString()); Assert.AreEqual("Henkel", _objDataSet.Tables[0].Rows[0]["LastName"].ToString()); } //Assert.Inconclusive("A method that does not return a value cannot be verified."); }
/// <summary> /// Function to get the list of Tribute Administrators for the Tribute id /// </summary> /// <param name="objUserTributeId">Entity containing User Tribute id</param> /// <returns>List of Administrators constaing email ids</returns> public UserInfo GetTributeAdministrators(int TribuetId, string moduleType) { UserInfo objUser = new UserInfo(); object[] objParam = { TribuetId, moduleType }; DataSet dsTributeAdmins = GetDataSet("usp_GetTributeAdministrators", objParam); //to fill records in entity if (dsTributeAdmins.Tables.Count > 0) { if (dsTributeAdmins.Tables[0].Rows.Count > 0) { foreach (DataRow dr in dsTributeAdmins.Tables[0].Rows) { if (dr["Email"].ToString() != "") { if (objUser.UserEmail != null) { objUser.UserEmail += ", "; } objUser.UserEmail += dr["Email"].ToString(); } } } } return objUser; }
/// <summary> /// fetch tribute admin on tributeid /// </summary> /// <param name="objTribute"></param> /// <returns></returns> public List<UserInfo> GetTributeAdmins(Tributes objTribute) { List<UserInfo> objUserInfo = new List<UserInfo>(); if (!Equals(objTribute, null)) { object[] objParam = { objTribute.TributeId }; DataSet dsTributeAdmins = GetDataSet("usp_GetTributeAdmins", objParam); //to fill records in entity if (dsTributeAdmins.Tables.Count > 0) { if (dsTributeAdmins.Tables[0].Rows.Count > 0) { foreach (DataRow dr in dsTributeAdmins.Tables[0].Rows) { UserInfo objUser = new UserInfo(); objUser.UserID = int.Parse(dr["UserId"].ToString()); objUser.FirstName = dr["FirstName"].ToString(); objUser.LastName = dr["LastName"].ToString(); objUser.UserEmail = dr["Email"].ToString(); objUser.IsOwner = bool.Parse(dr["IsOwner"].ToString()); objUserInfo.Add(objUser); objUser = null; } } } } return objUserInfo; }
//New Methods added for Sponsor email functionality. public void SendSponsorMails(String Sponsor, string FromUserEmail, int TributeId, string TributeType, string TributeName, string TributeUrl, string Expiry, int PackageId) { string _EmailBody = string.Empty; EmailMessages objEmail = EmailMessages.Instance; MailBodies objMail = new MailBodies(); StoryResource objStoryRes = new StoryResource(); UserInfo objUser = new UserInfo(); objUser = objStoryRes.GetTributeAdministrators(TributeId, ""); if (PackageId == 2 || PackageId == 5 || PackageId == 7) { _EmailBody = objMail.TributeSponsor1Year(Sponsor, TributeId, TributeType, TributeName, TributeUrl, Expiry); } if (PackageId == 1 || PackageId == 4 || PackageId == 6) _EmailBody = objMail.TributeSponsorLife(Sponsor, TributeId, TributeType, TributeName, TributeUrl, Expiry); if (Sponsor != null && Sponsor != String.Empty) { // For the anonymous email when the sponsor does not want to show who he is to the tribute owner if (Sponsor.Contains("An anonymous person")) { bool val = objEmail.SendMessages(FromUserEmail, objUser.UserEmail, "Someone has sponsored the " + TributeName + " " + TributeType + " " + WebConfig.ApplicationWordForInternalUse + "...", _EmailBody, EmailMessages.TextFormat.Html.ToString()); } else { bool val = objEmail.SendMessages(FromUserEmail, objUser.UserEmail, Sponsor + " sponsored the " + TributeName + " " + TributeType + " " + WebConfig.ApplicationWordForInternalUse + "...", _EmailBody, EmailMessages.TextFormat.Html.ToString()); } } }
/// <summary> /// Method to send email to the list of users /// </summary> /// <param name="TribuetId">Tribute ID to get the list of admin</param> /// <param name="strSubject">Subject of the mail</param> public void SendEmail(int TribuetId, string strSubject, string strBody, string FromUserEmail) { StoryResource objStoryRes = new StoryResource(); UserInfo objUser = new UserInfo(); objUser = objStoryRes.GetTributeAdministrators(TribuetId, ""); EmailMessages objEmail = EmailMessages.Instance; bool val = objEmail.SendMessages(FromUserEmail, objUser.UserEmail, strSubject, strBody, EmailMessages.TextFormat.Html.ToString()); }
private string GetEmailBodyForVideoTribute(UserInfo objUserInfo, Videos objVideo, string type) { StringBuilder sbBody = new StringBuilder(); string strLink = string.Empty; sbBody.Append("<font style='font-size: 12px; font-family:Lucida Sans;'><p>" + objVideo.UserName); if (!string.IsNullOrEmpty(type)) { sbBody.Append(" created a new Video Tribute "); } if (!string.IsNullOrEmpty(type)) { sbBody.Append("<p>To view the video tribute, follow the link below:"); } sbBody.Append("<br/>"); if (objVideo.TributeVideoId == string.Empty || objVideo.TributeVideoId == null) strLink = "http://video." + WebConfig.TopLevelDomain + "/video/videotribute.aspx?tributeId="+objVideo.UserTributeId; //sbBody.Append(objVideo.PathToVisit + "/Video/ManageVideo.aspx" + "?VideoId=" + objVideo.VideoId + "&TributeId=" + objVideo.UserTributeId + "&TributeName=" + objVideo.TributeName + "&TributeType=" + objVideo.TributeType + "&TributeUrl=" + objVideo.TributeUrl + "&mode=link'>" + "Click here to visit the link</a>"); sbBody.Append("<a href='" + strLink + "'>" + strLink + "</a></p>"); if ((objVideo.TributeVideoId != string.Empty || objVideo.TributeVideoId != null) && Equals(type, "VideoTribute")) { sbBody.Append("<p>To add a link to the video tribute on your website, use the code below:<br/>"); sbBody.Append("<a href='http://video." + WebConfig.TopLevelDomain + "/video/videotribute.aspx?tributeId=" + objVideo.UserTributeId + "'>Watch the Video Tribute</a></p>"); //sbBody.Append("">Watch the Video Tribute </a ></p>"); } sbBody.Append("<p>---<br/>"); sbBody.Append("Your Tribute Team</p>"); return sbBody.ToString(); }
/// <summary> /// Method to get the body part of email. /// </summary> /// <param name="objUserInfo">Filled User Info entity</param> /// <returns>HTML string of body part</returns> private string GetEmailBody(UserInfo objUserInfo, Videos objVideo, string type) { StringBuilder sbBody = new StringBuilder(); string strLink = string.Empty; sbBody.Append("<font style='font-size: 12px; font-family:Lucida Sans;'><p>" + objVideo.UserName); if (!string.IsNullOrEmpty(type)) { if (Equals(type, "VideoTribute")) sbBody.Append(" added a new video tribute in the "); else if (Equals(type, "Video")) sbBody.Append(" added a new video in the "); } sbBody.Append(objVideo.TributeName + " " + objVideo.TributeType + " Tribute.</p>"); if (!string.IsNullOrEmpty(type)) { if (Equals(type, "VideoTribute")) sbBody.Append("<p>To view the video tribute, follow the link below:"); else if (Equals(type, "Video")) sbBody.Append("<p>To view the video, follow the link below:"); } sbBody.Append("<br/>"); if (objVideo.TributeVideoId == string.Empty || objVideo.TributeVideoId == null) strLink = "http://" + objVideo.TributeType.Replace("New Baby", "newbaby").ToLower() + "." + WebConfig.TopLevelDomain + "/" + objVideo.TributeUrl + "/video.aspx?mode=view&VideoId=" + objVideo.VideoId; else strLink = "http://" + objVideo.TributeType.Replace("New Baby", "newbaby").ToLower() + "." + WebConfig.TopLevelDomain + "/" + objVideo.TributeUrl + "/video.aspx?VideoId=" + objVideo.VideoId + "&videoType=videotribute&mode=view&"; //sbBody.Append(objVideo.PathToVisit + "/Video/ManageVideo.aspx" + "?VideoId=" + objVideo.VideoId + "&TributeId=" + objVideo.UserTributeId + "&TributeName=" + objVideo.TributeName + "&TributeType=" + objVideo.TributeType + "&TributeUrl=" + objVideo.TributeUrl + "&mode=link'>" + "Click here to visit the link</a>"); sbBody.Append("<a href='" + strLink + "'>" + strLink + "</a></p>"); if ((objVideo.TributeVideoId != string.Empty || objVideo.TributeVideoId != null) && Equals(type, "VideoTribute")) { sbBody.Append("<p>To add a link to the video tribute on your website, use the code below:<br/>"); sbBody.Append("<a href=" <a href=\"http://" + objVideo.TributeType.Replace("New Baby", "newbaby").ToLower() + "." + WebConfig.TopLevelDomain + "/" + objVideo.TributeUrl + "/video.aspx?VideoId=" + objVideo.VideoId + "&videoType=videotribute&mode=view\">http://" + objVideo.TributeType.Replace("New Baby", "newbaby").ToLower() + "." + WebConfig.TopLevelDomain + "/" + objVideo.TributeUrl + "/video.aspx?VideoId=" + objVideo.VideoId + "&videoType=videotribute&mode=view"</a>"); sbBody.Append("">Watch the Video Tribute </a ></p>"); } sbBody.Append("<p>---<br/>"); sbBody.Append("Your Tribute Team</p>"); return sbBody.ToString(); }
/// <summary> /// Method to get subject for email. /// </summary> /// <param name="objUserInfo"></param> /// <param name="objNotes"></param> /// <returns>Subject of email in string format.</returns> private string GetEmailSubject(UserInfo objUserInfo, Note objNotes) { return objNotes.UserName + " added a new note on Your Tribute..."; }
/// <summary> /// Method to get the body part of email. /// </summary> /// <param name="objUserInfo">Filled User Info entity</param> /// <returns>HTML string of body part</returns> private string GetEmailBody(UserInfo objUserInfo, Note objNotes) { StringBuilder sbBody = new StringBuilder(); sbBody.Append("<font style='font-size: 12px; font-family:Lucida Sans;'><p>"); sbBody.Append(objNotes.UserName); sbBody.Append(" added a new note in the "); sbBody.Append(objNotes.TributeName + " " + objNotes.TributeType + " Tribute.</p>"); sbBody.Append("<p>"); sbBody.Append("To read the note, follow the link below:"); sbBody.Append("<br/>"); //sbBody.Append(objNotes.PathToVisit + "/Notes/NoteFullView.aspx" + "?TributeId=" + objNotes.UserTributeId + "&TributeName=" + objNotes.TributeName + "&TributeType=" + objNotes.TributeType + "&TributeUrl=" + objNotes.TributeUrl + "¬eId=" + objNotes.NotesId + "&mode=link'>" + "Click here to visit the link</a>"); string strLink = "http://" + objNotes.TributeType.Replace("New Baby", "newbaby").ToLower() + "." + WebConfig.TopLevelDomain + "/" + objNotes.TributeUrl + "/note.aspx" + "?noteId=" + objNotes.NotesId; sbBody.Append("<a href='" + strLink + "'>" + strLink + "</a><p>"); sbBody.Append("<p>---<br/>"); sbBody.Append("Your Tribute Team</p></font>"); return sbBody.ToString(); }
/// <summary> /// Function to get the email address of tribute owner /// </summary> /// <param name="objUserTributeId">Entity containing User Tribute id</param> /// <returns>Owner email address</returns> public UserInfo GetTributeOwner(object[] objUserTributeId) { Tributes objTribute = (Tributes)objUserTributeId[0]; //Videos objTribute = (Videos)objUserTributeId[0]; UserInfo objUserInfo = new UserInfo(); if (!Equals(objTribute, null)) { object[] objParam = { objTribute.TributeId }; DataSet dsTributeAdmins = GetDataSet("usp_GetTributeOwner", objParam); //to fill records in entity if (dsTributeAdmins.Tables[0].Rows.Count > 0) { foreach (DataRow dr in dsTributeAdmins.Tables[0].Rows) { objUserInfo.FirstName = dr["FirstName"].ToString(); objUserInfo.UserEmail = dr["Email"].ToString(); } } } return objUserInfo; }
/// <summary> /// Method to get the body part of email on adding photos only. /// </summary> /// <param name="objUserInfo">Filled User Info entity</param> /// <returns>HTML string of body part</returns> private string GetEmailBody(UserInfo objUserInfo, string strAdded, PhotoAlbum objAlbum) { StringBuilder sbBody = new StringBuilder(); sbBody.Append("<font style='font-size: 12px; font-family:Lucida Sans;'><p>" + objAlbum.UserName); sbBody.Append(" added a new photo album in the "); sbBody.Append(objAlbum.TributeName + " " + objAlbum.TributeType + " Tribute.</p>"); sbBody.Append("<p>To view the photo album, follow the link below:"); sbBody.Append("<br/>"); string strLink = "http://" + objAlbum.TributeType.Replace("New Baby", "newbaby").ToLower() + "." + WebConfig.TopLevelDomain + "/" + objAlbum.TributeUrl + "/photoalbum.aspx" + "?PhotoAlbumId=" + objAlbum.PhotoAlbumId; //sbBody.Append("<a href='http://" + objAlbum.PathToVisit + "/Photo/PhotoAlbum.aspx" + "?PhotoAlbumId=" + objAlbum.PhotoAlbumId + "&TributeId=" + objAlbum.UserTributeId + "&TributeName=" + objAlbum.TributeName + "&TributeType=" + objAlbum.TributeType + "&TributeUrl=" + objAlbum.TributeUrl + "&mode=link'>" + "Click here to visit the link</a>"); //sbBody.Append("<a href='http://" + objAlbum.TributeType + "." + WebConfig.TopLevelDomain + "/" + objAlbum.TributeUrl + "/photoalbum.aspx" + "?PhotoAlbumId=" + objAlbum.PhotoAlbumId + "'>" + "Click here to visit the link</a>"); sbBody.Append("<a href='" + strLink + "'>" + strLink + "</a></p>"); sbBody.Append("<p>---<br/>"); sbBody.Append("Your Tribute Team</p></font>"); return sbBody.ToString(); }
private string GetEmailBody(UserInfo objUserInfo) { TributesPortal.Utilities.StateManager stateManager = TributesPortal.Utilities.StateManager.Instance; string Servername = (string)stateManager.Get("SERVERNAME", TributesPortal.Utilities.StateManager.State.Session); string _Emailbody = string.Empty; try { _Emailbody += "User Name : " + objUserInfo.UserName + "<br/>"; _Emailbody += "Pssword : " + TributePortalSecurity.Security.DecryptSymmetric(objUserInfo.UserPassword) + "<br/>"; _Emailbody += "First Name : " + objUserInfo.FirstName + "<br/>"; _Emailbody += "Last Name : " + objUserInfo.LastName + "<br/>"; _Emailbody += "User Type : " + objUserInfo.UserTypeDescription + "<br/>"; //_Emailbody += " <a href='http://" + Servername + "/log_in.aspx'>Click here to go for Login Page</a>"; _Emailbody += " <a href='http://" + WebConfig.TopLevelDomain + "/log_in.aspx'>Click here to go for Login Page</a>"; } catch (Exception e1) { } return _Emailbody; }
/// <summary> /// Method to get the body part of email. /// </summary> /// <param name="objUserInfo">Filled User Info entity</param> /// <returns>HTML string of body part</returns> private string GetEmailBody(UserInfo objUserInfo, string strAdded) { StringBuilder sbBody = new StringBuilder(); sbBody.Append(" added a new photo in the tribute "); sbBody.Append("<br/>"); sbBody.Append("<br/>"); sbBody.Append("<br/>"); sbBody.Append("---"); sbBody.Append("<br/>"); sbBody.Append("Your Tribute Team"); return sbBody.ToString(); }
private string GetEmailBodyOnEmailAndPasswordChanged(UserInfo objUserInfo) { TributesPortal.Utilities.StateManager stateManager = TributesPortal.Utilities.StateManager.Instance; string Servername = (string)stateManager.Get("SERVERNAME", TributesPortal.Utilities.StateManager.State.Session); string _Emailbody = string.Empty; try { _Emailbody += "Your Email and Password updated Successfuly<Br/>"; _Emailbody += "New Password:"******"<br/>"; //_Emailbody += " <a href='http://" + Servername + "/log_in.aspx'>Click here to go for Login Page</a>"; _Emailbody += " <a href='http://" + WebConfig.TopLevelDomain + "/log_in.aspx'>Click here to go for Login Page</a>"; } catch (Exception e1) { //throw e1.Message; } return _Emailbody; }
public void SendSponsorMailsWithMessage(String Sponsor, String Message, int TributeId, string TributeType, string TributeName, string TributeUrl, string Expiry, int PackageId) { string _EmailBody = string.Empty; EmailMessages objEmail = EmailMessages.Instance; MailBodies objMail = new MailBodies(); StoryResource objStoryRes = new StoryResource(); UserInfo objUser = new UserInfo(); objUser = objStoryRes.GetTributeAdministrators(TributeId, ""); if (PackageId == 2 || PackageId == 5 || PackageId == 7) { _EmailBody = objMail.TributeSponsor1YearWithMessage(Sponsor, Message, TributeType, TributeName, TributeUrl, Expiry); } if (PackageId == 1 || PackageId == 4 || PackageId == 6) _EmailBody = objMail.TributeSponsorLifeWithMessage(Sponsor, Message, TributeType, TributeName, TributeUrl, Expiry); bool val = objEmail.SendMessages("Your " + WebConfig.ApplicationWord + "<" + WebConfig.NoreplyEmail + ">", objUser.UserEmail, Sponsor + " has sponsored the " + TributeName + " " + TributeType + " " + WebConfig.ApplicationWordForInternalUse + "...", _EmailBody, EmailMessages.TextFormat.Html.ToString()); }
/// <summary> /// Function to get the list of users who have added the Tribute in their list of favourites /// </summary> /// <param name="objUserTributeId"></param> /// <returns></returns> public List<UserInfo> GetFavouriteTributeUsers(object[] objUserTributeId) { Tributes objTribute = (Tributes)objUserTributeId[0]; List<UserInfo> objUserInfo = new List<UserInfo>(); if (!Equals(objTribute, null)) { object[] objParam = { objTribute.TributeId, objTribute.TypeDescription }; DataSet dsTributeFav = GetDataSet("usp_GetFavouriteTributes", objParam); //to fill records in entity if (dsTributeFav.Tables.Count > 0) { if (dsTributeFav.Tables[0].Rows.Count > 0) { foreach (DataRow dr in dsTributeFav.Tables[0].Rows) { UserInfo objUser = new UserInfo(); objUser.UserID = int.Parse(dr["UserId"].ToString()); objUser.FirstName = dr["FirstName"].ToString(); objUser.LastName = dr["LastName"].ToString(); objUser.UserEmail = dr["Email"].ToString(); objUser.UserName = dr["Username"].ToString(); //objUser.IsOwner = bool.Parse(dr["IsOwner"].ToString()); objUserInfo.Add(objUser); objUser = null; } } } } return objUserInfo; }