예제 #1
0
    protected void txtFriendSearch_TextChanged(object sender, EventArgs e)
    {
        string fid = HiddenField1.Value;

        if (fid.Length > 20)
        {
            UserBO objFriend = new UserBO();
            objFriend = UserBLL.getUserByUserId(fid);
            UserBO objUser = new UserBO();
            objUser = UserBLL.getUserByUserId(Userid);


            //Response.Write(fid);

            TagsBO objTags = new TagsBO();
            objTags.AtId        = Photoid;
            objTags.Type        = Global.PHOTO;
            objTags.UserId      = Userid;
            objTags.FirstName   = objUser.FirstName;
            objTags.LastName    = objUser.LastName;
            objTags.FriendId    = fid;
            objTags.FriendFName = objFriend.FirstName;
            objTags.FriendLName = objFriend.LastName;

            TagsBLL.insertTags(objTags);
            LoadDataListTags();


            List <string> lst = new List <string>();
            lst = TagsBLL.getTagsFriendId(Global.PHOTO, Photoid);

            LoadDataListComments();
            if (Isfollow == true)
            {
                foreach (string item in lst)
                {
                    UserBO objUserNotify = new UserBO();
                    objUserNotify = UserBLL.getUserByUserId(item);
                    NotificationBO objNotify = new NotificationBO();
                    objNotify.MyNotification = "<a  href=\"ViewProfile.aspx?UserId=" + Userid + "\">" + objUser.FirstName + " " + objUser.LastName + "</a> tags 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;
                    msgtext = "Dear Pyramid Plus user," + objUser.FirstName + " " + objUser.LastName + " tags you photo ";

                    // ThreadPool.QueueUserWorkItem(new WaitCallback(sendEmail), (object)objUserNotify.Email);


                    NotificationBLL.insertNotification(objNotify);
                }
            }
        }
    }
예제 #2
0
    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);
            }
        }
    }
예제 #3
0
    protected void txtFriendSearch_TextChanged(object sender, EventArgs e)
    {
        string fid = HiddenField1.Value;

        if (fid.Length > 20)
        {
            UserBO objFriend = new UserBO();
            objFriend = UserBLL.getUserByUserId(fid);
            UserBO objUser = new UserBO();
            objUser = UserBLL.getUserByUserId(Userid);


            //Response.Write(fid);

            TagsBO objTags = new TagsBO();
            objTags.AtId        = Albumid;
            objTags.Type        = Global.PHOTO_ALBUM;
            objTags.UserId      = Userid;
            objTags.FirstName   = objUser.FirstName;
            objTags.LastName    = objUser.LastName;
            objTags.FriendId    = fid;
            objTags.FriendFName = objFriend.FirstName;
            objTags.FriendLName = objFriend.LastName;

            TagsBLL.insertTags(objTags);
            LoadDataListTags();


            List <string> lst = new List <string>();
            lst = TagsBLL.getTagsFriendId(Global.PHOTO_ALBUM, Albumid);

            LoadDataListComments();

            foreach (string item in lst)
            {
                UserBO objUserNotify = new UserBO();
                objUserNotify = UserBLL.getUserByUserId(item);
                NotificationBO objNotify = new NotificationBO();
                objNotify.MyNotification = "<a  href=\"ViewProfile.aspx?UserId=" + Userid + "\">" + objUser.FirstName + " " + objUser.LastName + "</a> tags on  <a  href=\"ViewPhotoAlbum.aspx?AlbumId=" + Albumid + "\">photo album</a>";
                objNotify.AtId           = Albumid;
                objNotify.Type           = Global.VIDEO;
                objNotify.UserId         = item;
                objNotify.FirstName      = objUserNotify.FirstName;
                objNotify.LastName       = objUserNotify.LastName;
                objNotify.FriendId       = Userid;
                objNotify.FriendFName    = objUser.FirstName;
                objNotify.FriendLName    = objUser.LastName;
                msgtext = "Dear Pyramid Plus user," + objUser.FirstName + " " + objUser.LastName + " tags you video ";

                NotificationBLL.insertNotification(objNotify);
            }
        }
    }
예제 #4
0
    void notif(string uid, string atid)
    {
        UserBO objUser = new UserBO();

        objUser = UserBLL.getUserByUserId(userid);
        UserBO objUserNotify = new UserBO();

        objUserNotify = UserBLL.getUserByUserId(uid);
        NotificationBO objNotify = new NotificationBO();

        objNotify.MyNotification = "<a  href=\"ViewProfile.aspx?UserId=" + userid + "\">" + objUser.FirstName + " " + objUser.LastName + "</a> Share  a <a  href='UserData.aspx'>post</a>";
        objNotify.AtId           = atid;
        objNotify.Type           = Global.SHARE;
        objNotify.UserId         = uid;
        objNotify.FirstName      = objUserNotify.FirstName;
        objNotify.LastName       = objUserNotify.LastName;
        objNotify.FriendId       = userid;
        objNotify.FriendFName    = objUser.FirstName;
        objNotify.FriendLName    = objUser.LastName;

        NotificationBLL.insertNotification(objNotify);
    }