예제 #1
0
    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();
        }
    }
예제 #2
0
        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)
            {
            }
        }
예제 #3
0
    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();
        }
    }
예제 #4
0
 public static void updateFriends(FriendsBO objFriends)
 {
     FriendsDAL.updateFriends(objFriends);
 }
예제 #5
0
 public static void delayRequest(FriendsBO objClass)
 {
     FriendsDAL.delayRequest(objClass);
 }
예제 #6
0
 public static string insertFriends(FriendsBO objFriends)
 {
     return(FriendsDAL.insertFriends(objFriends));
 }