Example #1
0
    protected void WallPost(string post)
    {
        UserBO objUser = new UserBO();

        objUser = UserBLL.getUserByUserId(Userid);

        WallBO objWall = new WallBO();

        objWall.PostedByUserId  = Userid;
        objWall.WallOwnerUserId = Userid;
        objWall.FirstName       = objUser.FirstName;
        objWall.LastName        = objUser.LastName;
        objWall.Post            = post;
        objWall.AddedDate       = DateTime.Now;
        objWall.Type            = Global.PROFILE_CHANGE;
        string wid = WallBLL.insertWall(objWall);


        ////////////////////////////////////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    = objWall.PostedByUserId;
            objTicker.TickerOwnerUserId = Useritem.FriendUserId;
            objTicker.FirstName         = objWall.FirstName;
            objTicker.LastName          = objWall.LastName;
            objTicker.Post      = objWall.Post;
            objTicker.Title     = objWall.Post;
            objTicker.AddedDate = DateTime.UtcNow;
            objTicker.Type      = objWall.Type;
            objTicker.EmbedPost = objWall.EmbedPost;
            objTicker.WallId    = wid;
            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      = objWall.Post;
        objTickerUserTag.Title     = objWall.Post;
        objTickerUserTag.AddedDate = DateTime.UtcNow;
        objTickerUserTag.Type      = objWall.Type;
        objTickerUserTag.EmbedPost = objWall.EmbedPost;
        objTickerUserTag.WallId    = wid;
        TickerBLL.insertTicker(objTickerUserTag);

        ////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////
    }
Example #2
0
        public void update(string publisherId, string subscriberId, WallBO obj, string tagstatus, string twid)
        {
            TickerBO objTicker = new TickerBO();

            objTicker.PostedByUserId    = publisherId;
            objTicker.TickerOwnerUserId = subscriberId;
            objTicker.FirstName         = obj.FirstName;
            objTicker.LastName          = obj.LastName;
            objTicker.Post      = obj.Post;
            objTicker.Title     = tagstatus;
            objTicker.AddedDate = DateTime.UtcNow;
            objTicker.Type      = obj.Type;
            objTicker.EmbedPost = obj.EmbedPost;
            objTicker.WallId    = twid;
            TickerBLL.insertTicker(objTicker);
        }
Example #3
0
        public static void updateTicker(TickerBO objClass)
        {
            MongoCollection <Ticker> objCollection = db.GetCollection <Ticker>("c_Ticker");

            var query  = Query.EQ("_id", ObjectId.Parse(objClass.Id));
            var sortBy = SortBy.Descending("_id");
            var update = Update.Set("PostedByUserId", ObjectId.Parse(objClass.PostedByUserId))
                         .Set("TickerOwnerUserId", ObjectId.Parse(objClass.TickerOwnerUserId))
                         .Set("FirstName", objClass.FirstName)
                         .Set("LastName", objClass.LastName)
                         .Set("Post", objClass.Post)
                         .Set("Type", objClass.Type)
                         .Set("AddedDate", objClass.AddedDate)
            ;
            var result = objCollection.FindAndModify(query, sortBy, update, true);
        }
Example #4
0
    public static void post(PostProperties post)
    {
        UserBO objUser = UserBLL.getUserByUserId(SessionClass.getUserId());
        WallBO objWall = new WallBO();

        objWall.WallOwnerUserId = post.WallOwnerUserId;
        objWall.PostedByUserId  = post.PostedByUserId;
        objWall.FirstName       = objUser.FirstName;
        objWall.LastName        = objUser.LastName;
        objWall.Post            = post.PostText;
        objWall.EmbedPost       = post.EmbedPost;
        objWall.AddedDate       = DateTime.Now;
        objWall.Type            = post.PostType;
        string wid = WallBLL.insertWall(objWall);

        List <UserFriendsBO> listtag = FriendsBLL.getAllFriendsListName(SessionClass.getUserId(), Global.CONFIRMED);

        //get the education,hometown and employer of people in list
        foreach (UserFriendsBO Useritem in listtag)
        {
            TickerBO objTicker = new TickerBO();
            objTicker.PostedByUserId    = objWall.PostedByUserId;
            objTicker.TickerOwnerUserId = Useritem.FriendUserId;
            objTicker.FirstName         = objWall.FirstName;
            objTicker.LastName          = objWall.LastName;
            objTicker.Post      = objWall.Post;
            objTicker.Title     = Global.SHARE_A_POST;
            objTicker.AddedDate = DateTime.UtcNow;
            objTicker.Type      = objWall.Type;
            objTicker.EmbedPost = objWall.EmbedPost;
            objTicker.WallId    = wid;
            TickerBLL.insertTicker(objTicker);
        }
        TickerBO objTickerUserTag = new TickerBO();

        objTickerUserTag.PostedByUserId    = SessionClass.getUserId();
        objTickerUserTag.TickerOwnerUserId = SessionClass.getUserId();
        objTickerUserTag.FirstName         = objUser.FirstName;
        objTickerUserTag.LastName          = objUser.LastName;
        objTickerUserTag.Post      = objWall.Post;
        objTickerUserTag.Title     = Global.SHARE_A_POST;
        objTickerUserTag.AddedDate = DateTime.UtcNow;
        objTickerUserTag.Type      = objWall.Type;
        objTickerUserTag.EmbedPost = objWall.EmbedPost;
        objTickerUserTag.WallId    = wid;
        TickerBLL.insertTicker(objTickerUserTag);
    }
Example #5
0
    //////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////////////////////


    protected void lbtnFeedDetail_Click(object sender, EventArgs e)
    {
        GridViewRow          row = ((GridViewRow)((LinkButton)sender).NamingContainer);
        PopupControlExtender pce = row.FindControl("PopupControlExtenderTicker") as PopupControlExtender;

        ImageButton imbtnPhoto = (ImageButton)row.FindControl("imbtnPhoto");
        ImageButton imbtnVideo = (ImageButton)row.FindControl("imbtnVideo");
        HiddenField hfId       = (HiddenField)row.FindControl("HiddenFieldId");
        HiddenField hfWallId   = (HiddenField)row.FindControl("HiddenFieldWallId");

        TickerBO objClass = new TickerBO();

        objClass = TickerBLL.getTickerByTickerId(hfId.Value);



        string   sValue           = hfWallId.Value;
        GridView gridviewComments = (GridView)row.FindControl("GridViewComments");
        //LinkButton btn = (LinkButton)gvr.FindControl("LinkButton2");
        WallBO objWall = new WallBO();

        objWall = WallBLL.getWallByWallId(sValue);

        if (objWall.Type == Global.PHOTO || objWall.Type == Global.TAG_PHOTO)
        {
            imbtnPhoto.ImageUrl = "../../Resources/ThumbnailPhotos/" + objClass.EmbedPost + ".jpg";
            imbtnPhoto.Visible  = true;
        }
        if (objWall.Type == Global.VIDEO || objWall.Type == Global.TAG_VIDEO || objWall.Type == Global.POST_VIDEOLINK || objWall.Type == Global.TAG_VIDEOLINK)
        {
            imbtnVideo.Visible = true;
        }


        YouLikes(row);
        CountShare(row);
        gridviewComments.DataSource = CommentsDAL.getCommentsTop(Global.WALL, sValue, 2);
        gridviewComments.DataBind();
        Comment_YouLikes(row);

        pce.DataBind();
    }
Example #6
0
        public static string insertTicker(TickerBO objClass)
        {
            MongoCollection <BsonDocument> objCollection = db.GetCollection <BsonDocument>("c_Ticker");


            BsonDocument doc = new BsonDocument {
                { "PostedByUserId", ObjectId.Parse(objClass.PostedByUserId) },
                { "TickerOwnerUserId", ObjectId.Parse(objClass.TickerOwnerUserId) },
                { "WallId", ObjectId.Parse(objClass.WallId) },
                { "FirstName", objClass.FirstName },
                { "LastName", objClass.LastName },
                { "Title", objClass.Title },
                { "Post", objClass.Post },
                { "Type", objClass.Type },
                { "AddedDate", objClass.AddedDate },
                { "EmbedPost", objClass.EmbedPost }
            };

            var rt = objCollection.Insert(doc);

            return(doc["_id"].ToString());
        }
Example #7
0
        public static TickerBO getTickerByTickerId(string Id)
        {
            MongoCollection <Ticker> objCollection = db.GetCollection <Ticker>("c_Ticker");

            TickerBO objClass = new TickerBO();

            foreach (Ticker item in objCollection.Find(Query.EQ("_id", ObjectId.Parse(Id))))
            {
                objClass.Id                = item._id.ToString();
                objClass.PostedByUserId    = item.PostedByUserId.ToString();
                objClass.TickerOwnerUserId = item.TickerOwnerUserId.ToString();
                objClass.FirstName         = item.FirstName;
                objClass.LastName          = item.LastName;
                objClass.Title             = item.Title;
                objClass.Type              = item.Type;
                objClass.Post              = item.Post;
                objClass.EmbedPost         = item.EmbedPost;
                objClass.AddedDate         = item.AddedDate;
                objClass.WallId            = item.WallId.ToString();
                break;
            }
            return(objClass);
        }
Example #8
0
    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;



        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);

        ////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////
    }
Example #9
0
    protected void lbtnLike_Click(object sender, EventArgs e)
    {
        string               statuslike  = "like a post";
        GridViewRow          row         = ((GridViewRow)((LinkButton)sender).NamingContainer);
        LinkButton           linkLike    = (LinkButton)row.FindControl("lbtnLike");
        Label                labelLike   = (Label)row.FindControl("lblLike");
        Literal              literalpost = (Literal)row.FindControl("Literal1");
        HiddenField          hfId        = (HiddenField)row.FindControl("HiddenFieldWallId");
        HiddenField          hfType      = (HiddenField)row.FindControl("HiddenFieldType");
        HiddenField          hfEmbedPost = (HiddenField)row.FindControl("HiddenFieldEmbedTickerPost");
        PopupControlExtender pce         = row.FindControl("PopupControlExtenderTicker") as PopupControlExtender;
        UserBO               objUser     = new UserBO();

        objUser = UserBLL.getUserByUserId(Session["UserId"].ToString());
        if (linkLike.Text == "Like")
        {
            LikesBO objClass = new LikesBO();
            objClass.AtId      = hfId.Value;
            objClass.Type      = Global.WALL;
            objClass.UserId    = Session["UserId"].ToString();
            objClass.FirstName = objUser.FirstName;
            objClass.LastName  = objUser.LastName;
            LikesBLL.insertLikes(objClass);
            labelLike.Text = "";
            linkLike.Text  = "UnLike";
            statuslike     = "like a post";
        }
        else
        {
            LikesBO objClass = new LikesBO();
            objClass.AtId   = hfId.Value;
            objClass.Type   = Global.WALL;
            objClass.UserId = Session["UserId"].ToString();
            LikesBLL.unLikes(objClass);
            labelLike.Text = "";
            linkLike.Text  = "Like";
            statuslike     = "unlike a post";
        }

        pce.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            = "Like a <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);
        }
        ////////////////////////////////////////
        ////////////////////////////////////TICKER CODE //////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////

        List <UserFriendsBO> list = FriendsBLL.getAllFriendsListName(Session["UserId"].ToString(), Global.CONFIRMED);

        //get the education,hometown and employer of people in list
        foreach (UserFriendsBO Useritem in list)
        {
            TickerBO objTicker = new TickerBO();


            objTicker.PostedByUserId    = Session["UserId"].ToString();
            objTicker.TickerOwnerUserId = Useritem.FriendUserId;
            objTicker.FirstName         = objUser.FirstName;
            objTicker.LastName          = objUser.LastName;
            objTicker.Post      = literalpost.Text;
            objTicker.Title     = statuslike;
            objTicker.AddedDate = DateTime.UtcNow;
            objTicker.Type      = Convert.ToInt32(hfType.Value);
            objTicker.EmbedPost = hfEmbedPost.Value;
            objTicker.WallId    = hfId.Value;
            TickerBLL.insertTicker(objTicker);
        }
        TickerBO objTickerUser = new TickerBO();


        objTickerUser.PostedByUserId    = Session["UserId"].ToString();
        objTickerUser.TickerOwnerUserId = Session["UserId"].ToString();
        objTickerUser.FirstName         = objUser.FirstName;
        objTickerUser.LastName          = objUser.LastName;
        objTickerUser.Post      = literalpost.Text;
        objTickerUser.Title     = statuslike;
        objTickerUser.AddedDate = DateTime.UtcNow;
        objTickerUser.Type      = Convert.ToInt32(hfType.Value);
        objTickerUser.EmbedPost = hfEmbedPost.Value;
        objTickerUser.WallId    = hfId.Value;

        TickerBLL.insertTicker(objTickerUser);
        ////////////////////////////////////////////////////////////////////////////////////
    }
Example #10
0
 ///////////////////////////////////////////////////////////////
 //                       UPDATE FUNCTION
 //////////////////////////////////////////////////////////////
 public static void updateTicker(TickerBO objTicker)
 {
     TickerDAL.updateTicker(objTicker);
 }
Example #11
0
 ///////////////////////////////////////////////////////////////
 //                       INSERT FUNCTION
 //////////////////////////////////////////////////////////////
 public static string insertTicker(TickerBO objTicker)
 {
     return(TickerDAL.insertTicker(objTicker));
 }