예제 #1
0
    protected void txtComments_TextChanged(object sender, EventArgs e)
    {
        GridViewRow row = ((GridViewRow)((TextBox)sender).NamingContainer);

        TextBox     txtcomments = (TextBox)row.FindControl("txtComments");
        HiddenField hfId        = (HiddenField)row.FindControl("HiddenFieldId");

        UserBO objUser = new UserBO();

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

        CommentsBO objClass = new CommentsBO();

        objClass.MyComments = txtcomments.Text;
        objClass.AtId       = hfId.Value;
        objClass.Type       = Global.WALL;
        objClass.UserId     = Session["UserId"].ToString();
        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);

        GridView gridviewComments = (GridView)row.FindControl("GridViewComments");

        gridviewComments.DataSource = CommentsDAL.getCommentsTop(Global.WALL, hfId.Value, 2);
        gridviewComments.DataBind();

        LoadWall(50);
    }
예제 #2
0
    // @@@@@@@@@@@@@@@@@@@@ by Nabeel
    protected void lbtnViewComments_Click(object sender, EventArgs e)
    {
        GridViewRow row  = ((GridViewRow)((LinkButton)sender).NamingContainer);
        HiddenField hfId = (HiddenField)row.FindControl("HiddenFieldId");

        GridView gridviewComments = (GridView)row.FindControl("GridViewComments");

        gridviewComments.DataSource = CommentsDAL.getCommentsTop(Global.WALL, hfId.Value, 100);
        gridviewComments.DataBind();
    }
예제 #3
0
    protected void txtComments_TextChanged(object sender, EventArgs e)
    {
        GridViewRow row = ((GridViewRow)((TextBox)sender).NamingContainer);

        TextBox     txtcomments = (TextBox)row.FindControl("txtComments");
        HiddenField hfId        = (HiddenField)row.FindControl("HiddenFieldWallId");

        UserBO objUser = new UserBO();

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

        CommentsBO objClass = new CommentsBO();

        objClass.MyComments = ConvertUrlsToLinks(txtcomments.Text);
        objClass.AtId       = hfId.Value;
        objClass.Type       = Global.WALL;
        objClass.UserId     = Session["UserId"].ToString();
        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);

        GridView gridviewComments = (GridView)row.FindControl("GridViewComments");

        gridviewComments.DataSource = CommentsDAL.getCommentsTop(Global.WALL, hfId.Value, 2);
        gridviewComments.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            = " 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);
        }
        ////////////////////////////////////////
    }
예제 #4
0
    protected void LoadComments()
    {
        foreach (GridViewRow gvr in GridViewWall.Rows)
        {
            if (gvr.RowType == DataControlRowType.DataRow)
            {
                ImageButton imgbutton        = ((ImageButton)gvr.FindControl("imgCommentsUser"));
                string      sValue           = ((HiddenField)gvr.FindControl("HiddenFieldId")).Value;
                GridView    gridviewComments = (GridView)gvr.FindControl("GridViewComments");

                gridviewComments.DataSource = CommentsDAL.getCommentsTop(Global.WALL, sValue, 2);
                gridviewComments.DataBind();
                imgbutton.ImageUrl    = Global.PROFILE_PICTURE + Session["UserId"].ToString() + ".jpg";
                imgbutton.PostBackUrl = "ViewProfile.aspx?UserId=" + Session["UserId"].ToString();
            }
        }
    }
예제 #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();
    }