protected void txtComments_TextChanged(object sender, EventArgs e) { GridViewRow row = ((GridViewRow)((TextBox)sender).NamingContainer); TextBox txtcomments = (TextBox)row.FindControl("txtComments"); HiddenField hfId = (HiddenField)row.FindControl("HiddenFieldId"); UserBO objUser = new UserBO(); objUser = UserBLL.getUserByUserId(Session["UserId"].ToString()); CommentsBO objClass = new CommentsBO(); objClass.MyComments = txtcomments.Text; objClass.AtId = hfId.Value; objClass.Type = Global.WALL; objClass.UserId = Session["UserId"].ToString(); objClass.FirstName = objUser.FirstName; objClass.LastName = objUser.LastName; if (!objClass.MyComments.Equals("")) { CommentsDAL.insertComments(objClass); } ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "myScript", "document.getElementById('" + txtcomments.ClientID + "').value = '';", true); GridView gridviewComments = (GridView)row.FindControl("GridViewComments"); gridviewComments.DataSource = CommentsDAL.getCommentsTop(Global.WALL, hfId.Value, 2); gridviewComments.DataBind(); LoadWall(50); }
protected void InsertComments() { UserBO objUser = new UserBO(); objUser = UserBLL.getUserByUserId(Userid); CommentsBO objClass = new CommentsBO(); objClass.MyComments = txtComments.Text; objClass.AtId = Photoid; objClass.Type = Global.PHOTO; objClass.UserId = Userid; objClass.FirstName = objUser.FirstName; objClass.LastName = objUser.LastName; if (!objClass.MyComments.Equals("")) { CommentsDAL.insertComments(objClass); } ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "myScript", "document.getElementById('" + txtComments.ClientID + "').value = '';", true); List <string> lst = new List <string>(); lst = CommentsDAL.getCommentsUserIdbyAtId(Global.PHOTO, Photoid); LoadDataListComments(); if (Isfollow == true) { foreach (string item in lst) { UserBO objUserNotify = new UserBO(); objUserNotify = UserBLL.getUserByUserId(item); msgtext = "Dear Pyramid Plus user, Comments on your photos. "; NotificationBO objNotify = new NotificationBO(); objNotify.MyNotification = "<a href=\"ViewProfile.aspx?UserId=" + Userid + "\">" + objUser.FirstName + " " + objUser.LastName + "</a> comments on <a href=\"ViewPhoto.aspx?PhotoId=" + Photoid + "\">photo</a>"; objNotify.AtId = Photoid; objNotify.Type = Global.PHOTO; objNotify.UserId = item; objNotify.FirstName = objUserNotify.FirstName; objNotify.LastName = objUserNotify.LastName; objNotify.FriendId = Userid; objNotify.FriendFName = objUser.FirstName; objNotify.FriendLName = objUser.LastName; objNotify.Status = false; // ThreadPool.QueueUserWorkItem(new WaitCallback(sendEmail), (object)objUserNotify.Email); //sendEmail(objUserNotify.Email); NotificationBLL.insertNotification(objNotify); } } }
protected void txtComments_TextChanged(object sender, EventArgs e) { GridViewRow row = ((GridViewRow)((TextBox)sender).NamingContainer); TextBox txtcomments = (TextBox)row.FindControl("txtComments"); HiddenField hfId = (HiddenField)row.FindControl("HiddenFieldWallId"); UserBO objUser = new UserBO(); objUser = UserBLL.getUserByUserId(Session["UserId"].ToString()); CommentsBO objClass = new CommentsBO(); objClass.MyComments = ConvertUrlsToLinks(txtcomments.Text); objClass.AtId = hfId.Value; objClass.Type = Global.WALL; objClass.UserId = Session["UserId"].ToString(); objClass.FirstName = objUser.FirstName; objClass.LastName = objUser.LastName; if (!objClass.MyComments.Equals("")) { CommentsDAL.insertComments(objClass); } ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "myScript", "document.getElementById('" + txtcomments.ClientID + "').value = '';", true); GridView gridviewComments = (GridView)row.FindControl("GridViewComments"); gridviewComments.DataSource = CommentsDAL.getCommentsTop(Global.WALL, hfId.Value, 2); gridviewComments.DataBind(); /////////////////////////////////////Friends recent activities if (!userid.Equals(Session["UserId"].ToString())) { UserBO objFUser = new UserBO(); objFUser = UserBLL.getUserByUserId(userid); WallBO objWall = new WallBO(); objWall.PostedByUserId = Session["UserId"].ToString(); objWall.WallOwnerUserId = Session["UserId"].ToString(); objWall.FirstName = objUser.FirstName; objWall.LastName = objUser.LastName; objWall.Post = " Comments on <a href=\"ViewProfile.aspx?UserId=" + userid + "\">" + objFUser.FirstName + " " + objFUser.LastName + "</a> Wall Post"; objWall.AddedDate = DateTime.Now; objWall.Type = Global.PROFILE_CHANGE; WallBLL.insertWall(objWall); } //////////////////////////////////////// }