Exemplo n.º 1
0
    protected void LoadDataListMedia()
    {
        GridViewNotification.DataSource = NotificationBLL.getNotificationByUserId(Userid);
        GridViewNotification.DataBind();

        foreach (GridViewRow gvr in GridViewNotification.Rows)
        {
            if (gvr.RowType == DataControlRowType.DataRow)
            {
                HiddenField hfdate    = (HiddenField)gvr.FindControl("HiddenFieldAddedDate");
                Label       labeldate = (Label)gvr.FindControl("lblAddedDate");


                DateTime date = Convert.ToDateTime(hfdate.Value);
                labeldate.Text = TimeAgo(date);
                HiddenField hfStatus = (HiddenField)gvr.FindControl("HiddenFieldStatus");
                if (Convert.ToBoolean(hfStatus.Value) == false)
                {
                    gvr.BackColor = System.Drawing.Color.FromName("#EFD2D8");
                }
                // gvr.BackColor = System.Drawing.Color.FromName("#D0122B");
            }
        }
        NotificationBLL.updateNotificationStatus(Userid);
    }