protected void GridViewFriendsListRequest_RowCommand(object sender, GridViewCommandEventArgs e) { FriendsBO objClass = new FriendsBO(); GridViewRow row = GridViewFriendsListRequest.Rows[Convert.ToInt32(e.CommandArgument)]; objClass.Id = GridViewFriendsListRequest.DataKeys[row.RowIndex].Value.ToString(); if (e.CommandName == "notnow") { objClass.Status = Global.NOTNOW; Response.Write(objClass.FriendUserId); FriendsBLL.delayRequest(objClass); LoadFriendRequests(); } else if (e.CommandName == "confirmnow") { objClass.Status = Global.CONFIRMED; string sValue = ((HiddenField)row.FindControl("HiddenField1")).Value; objClass.FriendUserId = sValue; UserBO objUser = new UserBO(); objUser = UserBLL.getUserByUserId(sValue); FriendsBLL.confirmRequest(objClass); WallPost(" accept friend request of <a href=\"ViewProfile.aspx?UserId=" + Userid + "\">" + objUser.FirstName + " " + objUser.LastName + "</a> "); LoadFriendRequests(); } }
public static void confirmRequest(FriendsBO objClass) { FriendsDAL.confirmRequest(objClass); string emailHost = ConfigurationSettings.AppSettings["EmailHost"]; SmtpClient client = new SmtpClient(emailHost); client.DeliveryMethod = SmtpDeliveryMethod.Network; client.EnableSsl = true; client.Host = emailHost; client.Port = 587; string myEmail = ConfigurationSettings.AppSettings["Email"]; string Password = ConfigurationSettings.AppSettings["Password"]; System.Net.NetworkCredential credentials = new System.Net.NetworkCredential(myEmail, Password); client.UseDefaultCredentials = false; client.Credentials = credentials; MailMessage msg = new MailMessage(); msg.From = new MailAddress(myEmail); UserBO ub = UserDAL.getUserByUserId(objClass.FriendUserId); msg.To.Add(new MailAddress(ub.Email)); msg.Subject = "Pyramid Plus Friend Request"; msg.IsBodyHtml = true; msg.Body = "Dear Pyramid Plus user, Your friend request has been accepted. "; try { client.Send(msg); } catch (Exception ex) { } }
protected void GridViewSuggestions_RowCommand(object sender, GridViewCommandEventArgs e) { FriendsBO objClass = new FriendsBO(); GridViewRow row = GridViewFriendsListRequest.Rows[Convert.ToInt32(e.CommandArgument)]; objClass.Id = GridViewFriendsListRequest.DataKeys[row.RowIndex].Value.ToString(); if (e.CommandName == "notnow") { objClass.Status = Global.NOTNOW; Response.Write(objClass.FriendUserId); FriendsBLL.delayRequest(objClass); LoadFriendRequests(); } else if (e.CommandName == "confirmnow") { objClass.Status = Global.CONFIRMED; string sValue = ((HiddenField)row.FindControl("HiddenField1")).Value; objClass.FriendUserId = sValue; FriendsBLL.confirmRequest(objClass); LoadFriendRequests(); } }
public static void updateFriends(FriendsBO objFriends) { FriendsDAL.updateFriends(objFriends); }
public static void delayRequest(FriendsBO objClass) { FriendsDAL.delayRequest(objClass); }
public static string insertFriends(FriendsBO objFriends) { return(FriendsDAL.insertFriends(objFriends)); }