private void button5_Click(object sender, EventArgs e)
        {
            if (!button5.Text.Equals("Show Uncompleted Task"))
            {
                button5.Text = "Show Uncompleted Task";
                flowLayoutPanel1Today.Controls.Clear();

                TaskSer      cs = new TaskSer();
                List <Tasks> tk = cs.GetAllCompleteOrNotTask(1, cat_ID);

                for (int i = 0; i < tk.Count; i++)
                {
                    AddTaskInfo ad = new AddTaskInfo();
                    ad.Tittle  = tk[i].Tittle;
                    ad.Date    = Convert.ToDateTime(tk[i].Date).ToLongDateString();
                    ad.Task_ID = tk[i].Task_ID;
                    Bitmap img = new Bitmap("C:\\Users\\sajib\\source\\repos\\Task Manager\\image\\checkmark.png");
                    ad.Icon = img;
                    flowLayoutPanel1Today.Controls.Add(ad);
                }
            }
            else
            {
                button5.Text = "Show Completed Task";


                TaskSer      cs = new TaskSer();
                List <Tasks> tk = cs.GetAll(cat_ID);

                LoadTaskList(tk);
            }
        }
 public void LoadTaskList(List <Tasks> taskList)
 {
     flowLayoutPanel1Today.Controls.Clear();
     for (int i = 0; i < taskList.Count; i++)
     {
         AddTaskInfo pUC = new AddTaskInfo();
         pUC.Tittle  = taskList[i].Tittle;
         pUC.Date    = Convert.ToDateTime(taskList[i].Date).ToLongDateString();
         pUC.Task_ID = taskList[i].Task_ID;
         flowLayoutPanel1Today.Controls.Add(pUC);
     }
 }
Esempio n. 3
0
        private void TaskListShow(FlowLayoutPanel flow, int catID)
        {
            TaskSer      taskS    = new TaskSer();
            List <Tasks> taskList = taskS.GetAll(catID);

            for (int i = 0; i < taskList.Count; i++)
            {
                AddTaskInfo pUC = new AddTaskInfo();
                pUC.Tittle  = taskList[i].Tittle;
                pUC.Date    = Convert.ToDateTime(taskList[i].Date).ToLongDateString();
                pUC.Task_ID = taskList[i].Task_ID;
                flow.Controls.Add(pUC);
            }
        }
Esempio n. 4
0
        private void button5_Click(object sender, EventArgs e)
        {
            if (!button5.Text.Equals("Show Uncompleted Task"))
            {
                button5.Text = "Show Uncompleted Task";
                flowLayoutPanel1Today.Controls.Clear();
                List <Tasks> tk;
                TaskSer      cs = new TaskSer();

                CategorySer cg     = new CategorySer();
                int         cat_Id = cg.GetCategoryID(ProjectName, LogIn.user_ID);
                //tk = cs.GetAll(cat_Id);
                cg = new CategorySer();
                tk = cs.GetAllCompleteOrNotTask(1, cat_Id);

                for (int i = 0; i < tk.Count; i++)
                {
                    AddTaskInfo ad = new AddTaskInfo();
                    ad.Tittle = tk[i].Tittle;
                    //DateTime dt = DateTime.Parse(tk[i].Date, "dddd, dd MMMM yyyy");
                    ad.Date    = Convert.ToDateTime(tk[i].Date).ToLongDateString();
                    ad.Task_ID = tk[i].Task_ID;
                    Bitmap img = new Bitmap("C:\\Users\\sajib\\source\\repos\\Task Manager\\image\\checkmark.png");
                    ad.Icon = img;
                    flowLayoutPanel1Today.Controls.Add(ad);
                }
            }
            else
            {
                button5.Text = "Show Completed Task";
                flowLayoutPanel1Today.Controls.Clear();
                List <Tasks> tk;
                TaskSer      cs     = new TaskSer();
                CategorySer  cg     = new CategorySer();
                int          cat_Id = cg.GetCategoryID(ProjectName, LogIn.user_ID);
                cg = new CategorySer();
                tk = cs.GetAll(cat_Id);

                for (int i = 0; i < tk.Count; i++)
                {
                    AddTaskInfo ad = new AddTaskInfo();
                    ad.Tittle  = tk[i].Tittle;
                    ad.Date    = Convert.ToDateTime(tk[i].Date).ToLongTimeString();
                    ad.Task_ID = tk[i].Task_ID;
                    flowLayoutPanel1Today.Controls.Add(ad);
                }
            }
        }
        public void LoadTaskList()
        {
            cat_ID = GetCategoryID();
            TaskSer      ts       = new TaskSer();
            List <Tasks> taskList = ts.GetAll(cat_ID);

            flowLayoutPanel1Today.Controls.Clear();
            for (int i = 0; i < taskList.Count; i++)
            {
                AddTaskInfo pUC = new AddTaskInfo();
                pUC.Tittle  = taskList[i].Tittle;
                pUC.Date    = Convert.ToDateTime(taskList[i].Date).ToLongDateString();
                pUC.Task_ID = taskList[i].Task_ID;
                flowLayoutPanel1Today.Controls.Add(pUC);
            }
        }
Esempio n. 6
0
        public void RefreshContent()
        {
            flowLayoutPanel1Today.Controls.Clear();
            List <Tasks> tk;
            TaskSer      cs     = new TaskSer();
            CategorySer  cg     = new CategorySer();
            int          cat_Id = cg.GetCategoryID(ProjectName, LogIn.user_ID);

            //MessageBox.Show(ProjectName);
            //MessageBox.Show(cat_Id.ToString());
            cg = new CategorySer();
            tk = cs.GetAllSortByDate(cat_Id);

            for (int i = 0; i < tk.Count; i++)
            {
                AddTaskInfo ad = new AddTaskInfo();
                ad.Tittle  = tk[i].Tittle;
                ad.Date    = Convert.ToDateTime(tk[i].Date).ToLongDateString();
                ad.Task_ID = tk[i].Task_ID;
                flowLayoutPanel1Today.Controls.Add(ad);
            }
        }