Ejemplo n.º 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.VIDEO;
            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.VIDEO, Photoid);

            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=\"ViewVideo.aspx?VideoId=" + Photoid + "\">video</a>";
                objNotify.AtId = Photoid;
                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 photo ";

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

                NotificationBLL.insertNotification(objNotify);
            }
        }
    }
Ejemplo n.º 2
0
    protected void UpdateStatus()
    {
        string status = txtUpdatePost.Text;
        bool isVideoLink = false;
        UserBLL userbll = new UserBLL();

        if(lblFriendsWith.Text!="")
            status += " <font color='#838181'> -- with <font/>" + lblFriendsWith.Text.Remove(lblFriendsWith.Text.LastIndexOf(","));
        if (lblLocation.Text != "")
            status += lblLocation.Text;

        UserBO objUser = new UserBO();
        objUser = UserBLL.getUserByUserId(Session["UserId"].ToString());

        WallBO objWall = new WallBO();
        objWall.PostedByUserId = Session["UserId"].ToString();
        objWall.WallOwnerUserId = userid;
        objWall.FirstName = objUser.FirstName;
        objWall.LastName = objUser.LastName;
        objWall.Post = ConvertUrlsToLinks(status);
        objWall.AddedDate = DateTime.UtcNow;
        objWall.Type = Global.TEXT_POST;

        if (ConvertUrlsToLinks(status).IndexOf("http") > 0)
        {
            objWall.Type = Global.LINK;
            status = "post a link";
        }

        string imagesrc="";

        if (!GetYouTubeURL(txtUpdatePost.Text).Equals(""))
        {
            string url = GetYouTubeURL(txtUpdatePost.Text);
            objWall.Post = "<br/><br/><a href='" + url + "'>" + url + "</a><br/><br/>";

        }
        if (pnlVideoLink.Visible == true)
        {

            string url = GetYouTubeURL(txtUpdatePost.Text);
            string id = GetYouTubeID(txtUpdatePost.Text);
            string embedsrc = "http://www.youtube.com/embed/" + id + "?rel=0";
            objWall.Type = Global.POST_VIDEOLINK;
            objWall.Post = "<br/><br/><a href='" + url + "'>" + url + "</a><br/><br/>";
            if (!chkThumbnail.Checked)
            {
                imagesrc = getCurrentSelectedVideoThumbnail(id);
                vidthumbdisp = true;
                objWall.EmbedPost = imagesrc;
            }
            objWall.Type = Global.POST_VIDEOLINK;
            txtUpdatePost.Text = "";
            isVideoLink = true;
            status = " added a new video";
        }
        if (videofileuploaded)
        {
            objWall.Type = Global.VIDEO;
            string wallpost = objWall.Post;
            objWall.EmbedPost = Global.PATH_COMPRESSED_USER_VIDEO + "Thumb/" + uploadedvideothumbname;
            uploadedvideoembedliteral = Video.getUploadedVideoEmbedLiteral(wallpost, uploadedvideoname);
            LiteralUploadVideo.Text = "";
            status = " added a new video";
        }
        if (photofileuploaded)
        {
            objWall.Type = Global.PHOTO;
            LiteralUploadPhoto .Text= "";
            uploadedPhotoliteral = "";
            objWall.EmbedPost = photoid;
            status = " added a new photo";
        }

        if (Session["WebCamPhotoId"] != null)
        {

            objWall.Type = Global.PHOTO;
            objWall.EmbedPost = Session["WebCamPhotoId"].ToString();
            status = " added a new photo";
        }
        if (isphotoalbum)
        {
            MediaAlbumBO objAClass = new MediaAlbumBO();
            objAClass.UserId = userid;
            objAClass.Name = txtName.Text;
            objAClass.Description = txtDescription.Text;
            objAClass.CoverPictureId = "0000000000000b0000000900";
            objAClass.Type = Global.PHOTO;
            objAClass.isFollow = true;
            string aid=MediaAlbumBLL.insertMediaAlbum(objAClass);
            objWall.Post = objWall.Post + " add new <a  href=\"ViewPhotoAlbum.aspx?AlbumId=" + aid + "\">photo album</a>.";
            objWall.Type = Global.PHOTO_ALBUM;
            status = " added a new photo album";
        }
        //////////////////////////////////////////////////////////////////////
        foreach (string item in lstTag)
        {
            string tagstatus;
            if (photofileuploaded || videofileuploaded || Session["WebCamPhotoId"] != null || isVideoLink || isphotoalbum)
            {
            WallBO objWall2 = new WallBO();
            string tagpost = objWall.Post + "<br/> <font color='#838181'> was tagged by <font/><a  href=\"ViewProfile.aspx?UserId=" + Session["UserId"].ToString() + "\">" + objUser.FirstName + " " + objUser.LastName + "</a>.";
            UserBO objUser2 = new UserBO();
            objUser2 = UserBLL.getUserByUserId(item);
            objWall2.PostedByUserId = item;
            objWall2.WallOwnerUserId = item;
            objWall2.FirstName = objUser2.FirstName;
            objWall2.LastName = objUser2.LastName;
            objWall2.Post = tagpost;
            tagstatus = "tagged a post";
            objWall2.AddedDate = DateTime.Now;

            if (isphotoalbum)
            {
                objWall2.Type = Global.TAG_PHOTO_ALBUM;
                objWall2.Post = objWall.Post + " <font color='#838181'> was tagged by <font/><a  href=\"ViewProfile.aspx?UserId=" + Session["UserId"].ToString() + "\">" + objUser.FirstName + " " + objUser.LastName + "</a>.";
                notify_Tag(item, userid);
                tagstatus = "tagged a photo album";
            }

            if (videofileuploaded)
            {
                objWall2.Type = Global.TAG_VIDEO;
                objWall2.EmbedPost = Global.PATH_COMPRESSED_USER_VIDEO + "Thumb/" + uploadedvideothumbname;
                objWall2.Post = objWall.Post + "<font color='#838181'> was tagged by <font/><a  href=\"ViewProfile.aspx?UserId=" + Session["UserId"].ToString() + "\">" + objUser.FirstName + " " + objUser.LastName + "</a>.";
                notify_Tag(item, userid);
                tagstatus = "tagged a video";
            }
           if (isVideoLink)
            {
                objWall2.Type = Global.TAG_VIDEOLINK;
                objWall2.EmbedPost = imagesrc;
                objWall2.Post = objWall.Post + "<font color='#838181'> was tagged by <font/> <a  href=\"ViewProfile.aspx?UserId=" + Session["UserId"].ToString() + "\">" + objUser.FirstName + " " + objUser.LastName + "</a>.";
                notify_Tag(item, userid);
                tagstatus = "tagged a video";

           }
            if (photofileuploaded)
            {
                TagsBO objTags = new TagsBO();
                objTags.AtId = photoid;
                objTags.Type = Global.PHOTO;
                objTags.UserId = Session["UserId"].ToString();
                objTags.FirstName = objUser.FirstName;
                objTags.LastName = objUser.LastName;
                objTags.FriendId = item;
                objTags.FriendFName = objUser2.FirstName;
                objTags.FriendLName = objUser2.LastName;
                notify_Tag(item, photoid);
                TagsBLL.insertTags(objTags);
                objWall2.Type = Global.TAG_PHOTO;
                objWall2.EmbedPost = photoid;
                tagstatus = "tagged a photo";
            }
            if (Session["WebCamPhotoId"] != null)
            {
                TagsBO objTags = new TagsBO();
                objTags.AtId = Session["WebCamPhotoId"].ToString();
                objTags.Type = Global.PHOTO;
                objTags.UserId = Session["UserId"].ToString();
                objTags.FirstName = objUser.FirstName;
                objTags.LastName = objUser.LastName;
                objTags.FriendId = item;
                objTags.FriendFName = objUser2.FirstName;
                objTags.FriendLName = objUser2.LastName;
                TagsBLL.insertTags(objTags);
                objWall2.Type = Global.TAG_PHOTO;
                objWall2.EmbedPost = Session["WebCamPhotoId"].ToString();
                notify_Tag(item, Session["WebCamPhotoId"].ToString());
                tagstatus = "tagged a photo";
            }

            RWallPost(" tag post to <a  href=\"ViewProfile.aspx?UserId=" + item + "\">" + objUser2.FirstName + " " + objUser2.LastName + "</a>");
            string twid= WallBLL.insertWall(objWall2);

            userbll.notify_subscribers(Session["UserId"].ToString(), objWall2, ConvertUrlsToLinks(tagstatus), twid);
        }
        }
        string wid= WallBLL.insertWall(objWall);
        ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "myScript", "document.getElementById('" + txtUpdatePost.ClientID + "').value = '';", true);
        lblLocation.Text = "";
        lblFriendsWith.Text = "";
        lblFriendsTag.Text = "";
        LiteralUploadPhoto.Text = "";
        LiteralUploadVideo.Text = "";
        uploadedPhotoliteral = "";
        Session["WebCamPhotoId"] = null;
        videofileuploaded = false;
        photofileuploaded = false;
        isVideoLink = false;
        isphotoalbum = false;
        lstTag.Clear();
        userbll.notify_subscribers(Session["UserId"].ToString(), objWall, ConvertUrlsToLinks(ConvertUrlsToLinks(status)), wid);
        LoadWall(100);
    }
Ejemplo n.º 3
0
    // @@@@@@@@@@@@@@@@@@@@ by Nabeel
    protected void txtFriendWallTag_TextChanged(object sender, EventArgs e)
    {
        string tagstatus="tagged a post";
        GridViewRow row = ((GridViewRow)((TextBox)sender).NamingContainer);
        HiddenField hfId = (HiddenField)row.FindControl("HiddenFieldId");
        HiddenField hfType = (HiddenField)row.FindControl("HiddenFieldType");
        HiddenField hfEmbedPost = (HiddenField)row.FindControl("HiddenFieldEmbedPost");
        Literal post = (Literal)row.FindControl("LiteralPost");
        TextBox TagExsitingFreindsPost = (TextBox)row.FindControl("txtFriendWallTag");
        WallBO objWall2 = new WallBO();
        UserBO objUser = new UserBO();
        objUser = UserBLL.getUserByUserId(Session["UserId"].ToString());
        string tagpost = post.Text + "<br/><font color='#838181'> was Tagged by <font/> <a  href=\"ViewProfile.aspx?UserId=" + Session["UserId"].ToString() + "\">" + objUser.FirstName + " " + objUser.LastName + "</a>.";
        UserBO objUser2 = new UserBO();
        objUser2 = UserBLL.getUserByUserId(HiddenFieldWallTagId.Value);
        objWall2.PostedByUserId = HiddenFieldWallTagId.Value;
        objWall2.WallOwnerUserId = HiddenFieldWallTagId.Value;
        objWall2.FirstName = objUser2.FirstName;
        objWall2.LastName = objUser2.LastName;
        objWall2.Post = tagpost;
        objWall2.AddedDate = DateTime.Now;
        objWall2.Type = Global.TAG_POST;

        if (hfType.Value.Equals(Global.VIDEO.ToString()))
        {
            objWall2.Type = Global.TAG_VIDEO;
            objWall2.EmbedPost = Global.PATH_COMPRESSED_USER_VIDEO + "Thumb/" + uploadedvideothumbname;
            notify_Tag(HiddenFieldWallTagId.Value, userid);
            tagstatus = "tagged a video";
        }
        if (hfType.Value.Equals(Global.POST_VIDEOLINK.ToString()))
        {
            objWall2.Type = Global.TAG_VIDEOLINK;
            objWall2.EmbedPost = hfEmbedPost.Value;
            notify_Tag(HiddenFieldWallTagId.Value, userid);
            tagstatus = "tagged a video";
        }

        if (hfType.Value.Equals(Global.PHOTO.ToString()))
        {
            TagsBO objTags = new TagsBO();
            objTags.AtId = hfEmbedPost.Value;
            objTags.Type = Global.PHOTO;
            objTags.UserId = Session["UserId"].ToString();
            objTags.FirstName = objUser.FirstName;
            objTags.LastName = objUser.LastName;
            objTags.FriendId = HiddenFieldWallTagId.Value;
            objTags.FriendFName = objUser2.FirstName;
            objTags.FriendLName = objUser2.LastName;
            notify_Tag(HiddenFieldWallTagId.Value, hfEmbedPost.Value);
            TagsBLL.insertTags(objTags);
            objWall2.Type = Global.TAG_PHOTO;
            objWall2.EmbedPost = hfEmbedPost.Value;
            tagstatus = "tagged a photo";
        }
        RWallPost(" Tag post to <a  href=\"ViewProfile.aspx?UserId=" + HiddenFieldWallTagId.Value + "\">" + objUser2.FirstName + " " + objUser2.LastName + "</a>");

        string twid=WallBLL.insertWall(objWall2);
        TagExsitingFreindsPost.Visible = false;
        //Response.Redirect("~main.aspx?a=" + HiddenFieldWallTagId.Value + "b=" + aa);

        //if (txtFriendTag.Text != "" && HiddenFieldTagId.Value.Length > 20)
        //{
        //    lblFriendsTag.Text += "<a  href=\"ViewProfile.aspx?UserId=" + HiddenFieldTagId.Value + "\">" + txtFriendTag.Text + "</a>,";
        //    lstTag.Add(HiddenFieldTagId.Value);
        //    txtFriendTag.Text = "";
        //    HiddenFieldTagId.Value = "";
        //}

        ////////////////////////////////////TICKER CODE //////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////
        List<UserFriendsBO> listtag = FriendsBLL.getAllFriendsListName(Session["UserId"].ToString(), Global.CONFIRMED);
        //get the education,hometown and employer of people in list
        foreach (UserFriendsBO Useritem in listtag)
        {
            TickerBO objTicker = new TickerBO();
            objTicker.PostedByUserId = objWall2.PostedByUserId;
            objTicker.TickerOwnerUserId = Useritem.FriendUserId;
            objTicker.FirstName = objWall2.FirstName;
            objTicker.LastName = objWall2.LastName;
            objTicker.Post = objWall2.Post;
            objTicker.Title = ConvertUrlsToLinks(tagstatus);
            objTicker.AddedDate = DateTime.UtcNow;
            objTicker.Type = objWall2.Type;
            objTicker.EmbedPost = objWall2.EmbedPost;
            objTicker.WallId = twid;
            TickerBLL.insertTicker(objTicker);

        }
        TickerBO objTickerUserTag = new TickerBO();

        objTickerUserTag.PostedByUserId = Session["UserId"].ToString();
        objTickerUserTag.TickerOwnerUserId = Session["UserId"].ToString();
        objTickerUserTag.FirstName = objUser.FirstName;
        objTickerUserTag.LastName = objUser.LastName;
        objTickerUserTag.Post = objWall2.Post;
        objTickerUserTag.Title = "you tag a post";
        objTickerUserTag.AddedDate = DateTime.UtcNow;
        objTickerUserTag.Type = objWall2.Type;
        objTickerUserTag.EmbedPost = objWall2.EmbedPost;
        objTickerUserTag.WallId = twid;
        TickerBLL.insertTicker(objTickerUserTag);

        ////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////
    }
Ejemplo n.º 4
0
 public static void updateTags(TagsBO objTags)
 {
     TagsDAL.updateTags(objTags);
 }
Ejemplo n.º 5
0
 public static string insertTags(TagsBO objTags)
 {
     return TagsDAL.insertTags(objTags);
 }
Ejemplo n.º 6
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);
            }
        }
    }