Пример #1
0
    protected void TodayLB_Click(object sender, EventArgs e)
    {
        TasksBLL task    = new TasksBLL();
        decimal  time    = task.TotalTimeByUserIDByDate((int)Session["userID"], DateTime.Today);;
        decimal  prjtime = task.WeeklyProjectTimeByUserID((int)Session["userID"]);

        TasksDataSource.SelectParameters.Clear();
        TasksDataSource.SelectMethod = "GetTasksByUserIDByDate";
        TasksDataSource.SelectParameters.Add(new Parameter("userID", TypeCode.String, Session["userID"].ToString()));
        TasksDataSource.SelectParameters.Add(new Parameter("date", TypeCode.DateTime, DateTime.Now.ToShortDateString()));

        if (prjtime > 0)
        {
            StatsLabel.Text = "You have worked for " + time + " hours today and " + prjtime.ToString() + " project hours this week.";
        }
        else
        {
            StatsLabel.Text = "You have worked for " + time + " hours today.";
        }

        ViewHelper("Today");
    }