protected void btnSave_Click(object sender, EventArgs e) { BasicInfoBO objBasicInfo = new BasicInfoBO(); objBasicInfo.UserId = Userid; objBasicInfo.CityTown = txtTownCity.Text; objBasicInfo.Address = txtAddress.Text; objBasicInfo.ZipCode = txtZipCode.Text; objBasicInfo.Neighbourhood = txtNeighbourhood.Text; BasicInfoBLL.updateContactInfoPage(objBasicInfo); UpdateEmail(); LoadContactInfo(); PostProperties postProp = new PostProperties(); postProp.PostText = Global.POST_CHANGED_CONTACT_INFO; postProp.WallOwnerUserId = Userid; postProp.PostedByUserId = Userid; postProp.PostType = Global.PROFILE_CHANGE; postProp.EmbedPost = null; PostOnWall.post(postProp); imgSave.Visible = true; lblSave.Visible = true; }
protected void WallPost() { PostProperties postProp = new PostProperties(); postProp.PostText = Global.POST_PROFILE_PICTIRE_CHANGE; postProp.WallOwnerUserId = Userid; postProp.PostedByUserId = Userid; postProp.PostType = Global.PROFILE_CHANGE; postProp.EmbedPost = null; PostOnWall.post(postProp); }
protected void btnSave_Click(object sender, EventArgs e) { saveRelationshipStatus(); imgSave.Visible = true; lblSave.Visible = true; PostProperties postProp = new PostProperties(); postProp.PostText = Global.POST_CHANGED_ENTERTAINMENT; postProp.WallOwnerUserId = Userid; postProp.PostedByUserId = Userid; postProp.PostType = Global.PROFILE_CHANGE; postProp.EmbedPost = null; PostOnWall.post(postProp); }
protected void btnSave_Click(object sender, EventArgs e) { SaveSports(); SaveTeam(); SaveAthelete(); imgSave.Visible = true; lblSave.Visible = true; PostProperties postProp = new PostProperties(); postProp.PostText = Global.POST_USER_CHNAGED_SPORTS; postProp.WallOwnerUserId = Userid; postProp.PostedByUserId = Userid; postProp.PostType = Global.PROFILE_CHANGE; postProp.EmbedPost = null; PostOnWall.post(postProp); }
public static void post(PostProperties post) { UserBO objUser = UserBLL.getUserByUserId(SessionClass.getUserId()); WallBO objWall = new WallBO(); objWall.WallOwnerUserId = post.WallOwnerUserId; objWall.PostedByUserId = post.PostedByUserId; objWall.FirstName = objUser.FirstName; objWall.LastName = objUser.LastName; objWall.Post = post.PostText; objWall.EmbedPost = post.EmbedPost; objWall.AddedDate = DateTime.Now; objWall.Type = post.PostType; string wid = WallBLL.insertWall(objWall); List <UserFriendsBO> listtag = FriendsBLL.getAllFriendsListName(SessionClass.getUserId(), Global.CONFIRMED); //get the education,hometown and employer of people in list foreach (UserFriendsBO Useritem in listtag) { TickerBO objTicker = new TickerBO(); objTicker.PostedByUserId = objWall.PostedByUserId; objTicker.TickerOwnerUserId = Useritem.FriendUserId; objTicker.FirstName = objWall.FirstName; objTicker.LastName = objWall.LastName; objTicker.Post = objWall.Post; objTicker.Title = Global.SHARE_A_POST; objTicker.AddedDate = DateTime.UtcNow; objTicker.Type = objWall.Type; objTicker.EmbedPost = objWall.EmbedPost; objTicker.WallId = wid; TickerBLL.insertTicker(objTicker); } TickerBO objTickerUserTag = new TickerBO(); objTickerUserTag.PostedByUserId = SessionClass.getUserId(); objTickerUserTag.TickerOwnerUserId = SessionClass.getUserId(); objTickerUserTag.FirstName = objUser.FirstName; objTickerUserTag.LastName = objUser.LastName; objTickerUserTag.Post = objWall.Post; objTickerUserTag.Title = Global.SHARE_A_POST; objTickerUserTag.AddedDate = DateTime.UtcNow; objTickerUserTag.Type = objWall.Type; objTickerUserTag.EmbedPost = objWall.EmbedPost; objTickerUserTag.WallId = wid; TickerBLL.insertTicker(objTickerUserTag); }
protected void btnSave_Click(object sender, EventArgs e) { SaveBooks(); SaveMusic(); SaveMovie(); SaveTelevision(); SaveGame(); imgSave.Visible = true; lblSave.Visible = true; PostProperties postProp = new PostProperties(); postProp.PostText = Global.POST_CHANGED_RELATIONSHIP_STATUS; postProp.WallOwnerUserId = Userid; postProp.PostedByUserId = Userid; postProp.PostType = Global.PROFILE_CHANGE; postProp.EmbedPost = null; PostOnWall.post(postProp); }
protected void btnSave_Click(object sender, EventArgs e) { SaveActivities(); SaveInterests(); PostProperties postProp = new PostProperties(); postProp.PostText = Global.POST_ACTIVITY_TEXT; postProp.WallOwnerUserId = Userid; postProp.PostedByUserId = Userid; postProp.PostType = Global.PROFILE_CHANGE; postProp.EmbedPost = null; PostOnWall.post(postProp); LoadDataListActivities(); LoadDataListInterests(); imgSave.Visible = true; lblSave.Visible = true; }
protected void btnSave_Click(object sender, EventArgs e) { int year = Convert.ToInt32(lstYear.SelectedValue); int month = Convert.ToInt32(lstMonth.SelectedValue); int day = Convert.ToInt32(lstDay.SelectedValue); DateTime birthDate = new DateTime(year, month, day); DateTime now = DateTime.Today; int age = now.Year - Convert.ToInt32(lstYear.SelectedValue); if (now < birthDate.AddYears(age)) { age--; } if (age < 13) { CustomValidator1.IsValid = false; } if (Page.IsValid) { BasicInfoBO objBasicInfo = new BasicInfoBO(); objBasicInfo.UserId = Userid; objBasicInfo.CurrentCity = txtCurrentCity.Text; objBasicInfo.HomeTown = txtHometown.Text; BasicInfoBLL.updateBasicInfoPage(objBasicInfo); // BasicInfoBLL.updateTownCity(txtCurrentCity.Text, txtHometown.Text, 1); UpdateUserInfo(); LoadUserInfo(); LoadBasicInfo(); imgSave.Visible = true; lblSave.Visible = true; PostProperties postProp = new PostProperties(); postProp.PostText = Global.POST_CHANGED_BASIC_INFO; postProp.WallOwnerUserId = Userid; postProp.PostedByUserId = Userid; postProp.PostType = Global.PROFILE_CHANGE; postProp.EmbedPost = null; PostOnWall.post(postProp); } }
public void UpdatePost(Guid oldPostId, Post @new, PostProperties propertiesToChange) { ValidatePost(@new, propertiesToChange); using (var ctx = new DB.CodingIdeasEntities()) { var p = ctx.Posts.Where(x => x.Id == oldPostId).FirstOrDefault(); if (p == null) { throw new PostNotFoundException(); } if (propertiesToChange.HasFlag(PostProperties.Content)) { p.Content = @new.Content; } if (propertiesToChange.HasFlag(PostProperties.Title)) { p.Title = @new.Title; } ctx.SaveChanges(); } }
protected void btnSave_Click(object sender, EventArgs e) { SaveEmployer(); SaveProject(); SaveUniversity(); SaveSchool(); LoadDataListEmployer(); LoadDataListProject(); LoadDataListUniversity(); LoadDataListSchool(); imgSave.Visible = true; lblSave.Visible = true; PostProperties postProp = new PostProperties(); postProp.PostText = Global.POST_CHANGED_EDUCATION_WORK; postProp.WallOwnerUserId = Userid; postProp.PostedByUserId = Userid; postProp.PostType = Global.PROFILE_CHANGE; postProp.EmbedPost = null; PostOnWall.post(postProp); }
private void ValidatePost(Post post, PostProperties props) { if (post.Content == null || props.HasFlag(PostProperties.Content) && string.IsNullOrWhiteSpace(post.Content)) { throw new InvalidContentException(); } if (post.Title == null || props.HasFlag(PostProperties.Title) && string.IsNullOrWhiteSpace(post.Title)) { throw new InvalidTitleException(); } if (props.HasFlag(PostProperties.PublishDate) && post.PublishDate > DateTime.Now) { throw new InvalidPublishDateException("The publish date cannot be in the future."); } using (var ctx = new DB.CodingIdeasEntities()) { if (props.HasFlag(PostProperties.AuthorId) && post.AuthorId != null && ctx.Users.Where(x => x.Id == post.AuthorId).FirstOrDefault() == null) { throw new UserNotFoundException(); } } }
protected void ShareStatus(string post) { string status = post; if (lblFriendsWith.Text != "") { status += " with " + lblFriendsWith.Text.Remove(lblFriendsWith.Text.LastIndexOf(",")); } if (lblLocation.Text != "") { status += lblLocation.Text; } UserBO objUser = new UserBO(); objUser = UserBLL.getUserByUserId(SessionClass.getUserId()); WallBO objWall = new WallBO(); string PostedByUserId = SessionClass.getUserId(); string WallOwnerUserId = string.Empty; if (SessionClass.getShareWithID() != null) { PostedByUserId = Session["UserId"].ToString(); if (SessionClass.getShareWithID() != "") { WallOwnerUserId = SessionClass.getShareWithID(); UserBO objFriendObj = new UserBO(); objFriendObj = UserBLL.getUserByUserId(SessionClass.getShareWithID()); if (!CheckBox1.Checked) { ThreadPool.QueueUserWorkItem(new WaitCallback(sendEmail), (object)objFriendObj.Email); notif(SessionClass.getShareWithID(), SessionClass.getPostID()); } List <string> temp = (List <string>)SessionClass.getTaggedFriends(); if (temp != null) { foreach (string str in temp) { UserBO objFriendObj1 = new UserBO(); objFriendObj1 = UserBLL.getUserByUserId(str); //sendEmail(objFriendObj1.Email); if (!CheckBox1.Checked) { ThreadPool.QueueUserWorkItem(new WaitCallback(sendEmail), (object)objFriendObj1.Email); notif(str, SessionClass.getPostID()); } //Inserting follow post record for each tagged user FollowPostBO fp = new FollowPostBO(); fp.AtId = SessionClass.getPostID(); fp.UserId = objFriendObj1.Id; fp.FirstName = objFriendObj1.FirstName; fp.LastName = objFriendObj1.LastName; fp.Type = Global.WALL; FollowPostBLL.insertFollowPost(fp); } } } else { WallOwnerUserId = SessionClass.getUserId(); UserBO objUserEmail = new UserBO(); objUserEmail = UserBLL.getUserByUserId(SessionClass.getUserId()); // Sending notification with which the post is beind shared if (!CheckBox1.Checked) { ThreadPool.QueueUserWorkItem(new WaitCallback(sendEmail), (object)objUserEmail.Email); notif(SessionClass.getShareWithID(), SessionClass.getPostID()); } //Sending notification to all tagged friends List <string> temp = (List <string>)SessionClass.getTaggedFriends(); if (temp != null) { foreach (string str in temp) { UserBO objFriendObj1 = new UserBO(); objFriendObj1 = UserBLL.getUserByUserId(str); if (!CheckBox1.Checked) { ThreadPool.QueueUserWorkItem(new WaitCallback(sendEmail), (object)objFriendObj1.Email); } notif(str, SessionClass.getPostID()); //Inserting follow post record for each tagged user FollowPostBO fp = new FollowPostBO(); fp.AtId = SessionClass.getPostID(); fp.UserId = objFriendObj1.Id; fp.FirstName = objFriendObj1.FirstName; fp.LastName = objFriendObj1.LastName; fp.Type = Global.WALL; FollowPostBLL.insertFollowPost(fp); } } } } else { WallOwnerUserId = SessionClass.getUserId(); UserBO objUserEmail = new UserBO(); objUserEmail = UserBLL.getUserByUserId(SessionClass.getUserId()); if (!CheckBox1.Checked) { ThreadPool.QueueUserWorkItem(new WaitCallback(sendEmail), (object)objUserEmail.Email); } //Sending notification to all tagged friends List <string> temp = (List <string>)SessionClass.getTaggedFriends(); if (temp != null) { foreach (string str in temp) { UserBO objFriendObj1 = new UserBO(); objFriendObj1 = UserBLL.getUserByUserId(str); // sendEmail(objFriendObj1.Email); if (!CheckBox1.Checked) { ThreadPool.QueueUserWorkItem(new WaitCallback(sendEmail), (object)objFriendObj1.Email); notif(str, SessionClass.getPostID()); } //Inserting follow post record for each tagged user FollowPostBO fp = new FollowPostBO(); fp.AtId = SessionClass.getPostID(); fp.UserId = objFriendObj1.Id; fp.FirstName = objFriendObj1.FirstName; fp.LastName = objFriendObj1.LastName; fp.Type = Global.WALL; FollowPostBLL.insertFollowPost(fp); } } } PostProperties postProp = new PostProperties(); postProp.PostText = "Share a post " + status; postProp.WallOwnerUserId = WallOwnerUserId; postProp.PostedByUserId = PostedByUserId; postProp.PostType = SessionClass.getPostType(); postProp.EmbedPost = SessionClass.getEmbedPost(); PostOnWall.post(postProp); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "myScript", "document.getElementById('" + txtUpdatePost.ClientID + "').value = '';", true); lblLocation.Text = ""; lblFriendsWith.Text = ""; LoadWall(100); Session["ShareWithID"] = ""; Session["TaggedFriends"] = null; }