コード例 #1
0
        public int GetAllCompleteTaskCountByDate(string date)
        {
            string sql = "SELECT Count(*) as Sajib from Tasks where Task_Date = '" + date + "' and Complete = " + 1;

            using (SqlDataReader reader = dataAccess.GetData(sql))
            {
                reader.Read();
                return((int)reader["Sajib"]);
            }
        }
コード例 #2
0
        public List <NotificationPopUp> GetAllTodayNotificationTime()
        {
            string sql = "SELECT t.Task_ID,t.Notify_Via,Task_Tittle,Task_Description,Notify_Time FROM NotifiyTime n,Tasks t where Notify_Date = '" + DateTime.Now.ToShortDateString() + "' and t.Task_ID = n.Task_ID  and t.Task_Repeat_Date = n.Repeat_Task_ID";
            List <NotificationPopUp> timeList = new List <NotificationPopUp>();

            using (SqlDataReader reader = dataAccess.GetData(sql))
            {
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        NotificationPopUp npu = new NotificationPopUp();
                        npu.Time        = reader["Notify_Time"].ToString();
                        npu.Name        = reader["Task_Tittle"].ToString();
                        npu.Description = reader["Task_Description"].ToString();
                        npu.Task_ID     = (int)reader["Task_ID"];
                        npu.Notify_Via  = (int)reader["Notify_Via"];
                        timeList.Add(npu);
                    }
                }


                return(timeList);
            }
        }