Beispiel #1
0
    protected void lbtnCommentLike_Click(object sender, EventArgs e)
    {
        GridViewRow row             = ((GridViewRow)((LinkButton)sender).NamingContainer);
        HiddenField hfId            = (HiddenField)row.FindControl("HiddenFieldId");
        LinkButton  lbtnCommentLike = (LinkButton)row.FindControl("lbtnCommentLike");

        if (lbtnCommentLike.Text == "Like")
        {
            UserBO objUser = new UserBO();
            objUser = UserBLL.getUserByUserId(Session["UserId"].ToString());
            LikesBO objClass = new LikesBO();
            objClass.AtId      = hfId.Value;
            objClass.Type      = Global.WALL_COMMENT;
            objClass.UserId    = Session["UserId"].ToString();
            objClass.FirstName = objUser.FirstName;
            objClass.LastName  = objUser.LastName;
            LikesBLL.insertLikes(objClass);
            lbtnCommentLike.Text = "You Like this";
            lbtnCommentLike.Text = "UnLike";
        }
        else
        {
            LikesBO objClass = new LikesBO();
            objClass.AtId   = hfId.Value;
            objClass.Type   = Global.WALL_COMMENT;
            objClass.UserId = Session["UserId"].ToString();
            LikesBLL.unLikes(objClass);
            lbtnCommentLike.Text = "";
            lbtnCommentLike.Text = "Like";
        }

        LoadWall(50);
    }
Beispiel #2
0
 protected void lbtnLike_Click(object sender, EventArgs e)
 {
     if (lbtnLike.Text == "Like")
     {
         UserBO objUser = new UserBO();
         objUser = UserBLL.getUserByUserId(Userid);
         LikesBO objClass = new LikesBO();
         objClass.AtId      = Photoid;
         objClass.Type      = Global.VIDEO;
         objClass.UserId    = Userid;
         objClass.FirstName = objUser.FirstName;
         objClass.LastName  = objUser.LastName;
         LikesBLL.insertLikes(objClass);
         lblLike.Text  = "You Like this";
         lbtnLike.Text = "UnLike";
     }
     else
     {
         LikesBO objClass = new LikesBO();
         objClass.AtId   = Photoid;
         objClass.Type   = Global.VIDEO;
         objClass.UserId = Userid;
         LikesBLL.unLikes(objClass);
         lblLike.Text  = "";
         lbtnLike.Text = "Like";
     }
 }
Beispiel #3
0
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ///                                      COMMENTS LIKE MODULE                                         ////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // @@@@@@@@@@@@@@@@@@@@ by Nabeel
    protected void lbtnCommentLike_Click(object sender, EventArgs e)
    {
        GridViewRow row             = ((GridViewRow)((LinkButton)sender).NamingContainer);
        HiddenField hfId            = (HiddenField)row.FindControl("HiddenFieldId");
        LinkButton  lbtnCommentLike = (LinkButton)row.FindControl("lbtnCommentLike");
        //GridView gv = (GridView)GridViewWall.Rows[RowIndex].FindControl("GridViewComments");
        UserBO objUser = new UserBO();

        objUser = UserBLL.getUserByUserId(Session["UserId"].ToString());
        if (lbtnCommentLike.Text == "Like")
        {
            LikesBO objClass = new LikesBO();
            objClass.AtId      = hfId.Value;
            objClass.Type      = Global.WALL_COMMENT;
            objClass.UserId    = Session["UserId"].ToString();
            objClass.FirstName = objUser.FirstName;
            objClass.LastName  = objUser.LastName;
            LikesBLL.insertLikes(objClass);
            lbtnCommentLike.Text = "";
            lbtnCommentLike.Text = "UnLike";
        }
        else
        {
            LikesBO objClass = new LikesBO();
            objClass.AtId   = hfId.Value;
            objClass.Type   = Global.WALL_COMMENT;
            objClass.UserId = Session["UserId"].ToString();
            LikesBLL.unLikes(objClass);
            lbtnCommentLike.Text = "";
            lbtnCommentLike.Text = "Like";
        }
        //
        // Comment_YouLikes();
        /////////////////////////////////////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 Comments on <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);
        }
        ////////////////////////////////////////


        // Response.Redirect("main.aspx?c="+hfId.Value);
    }
Beispiel #4
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);
        ////////////////////////////////////////////////////////////////////////////////////
    }