protected void Button1_Click(object sender, EventArgs e)
    {
        Notification not = new Notification();

        GridViewNotification.DataSource = not.GetNotifications(CalendarNotificationDate.SelectedDate.ToString("yyyy-MM-dd")).Tables["Notification"];
        GridViewNotification.DataBind();
    }
Beispiel #2
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);
    }