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);
            }
        }
示例#2
0
        private void btnToday_Click(object sender, EventArgs e)
        {
            //Before


            //flowLayoutPanel1Today.Controls.Clear();
            //CategorySer cs = new CategorySer();
            //pnlContentChangeToday.BringToFront();
            //int catID = cs.GetCategoryID("Today");
            //TaskListShow(flowLayoutPanel1Today, catID);


            //if (!(flowLayoutPanel2.VerticalScroll.Value == 0 && scrollPos != 0))
            //    scrollPos = flowLayoutPanel2.VerticalScroll.Value;

            //only THis Open

            //HomePage2.home2.Close();
            //HomePage2.home2 = new HomePage2("Today");
            //HomePage2.home2.Show();

            //only THis Open

            //HomePage2.home2.ContentFormLoad("Today");


            //HomePage2.home2.flowLayoutPanel2.VerticalScroll.Value = scrollPos;



            //AFter

            try
            {
                //CategoryListShow();
                CategorySer s     = new CategorySer();
                int         catID = s.GetCategoryID("Today", LogIn.user_ID);

                TaskSer      taskS    = new TaskSer();
                List <Tasks> taskList = taskS.GetAll(catID);
                UserControlForOnlyTestPurpose.uC.Project_Name = "Today";
                UserControlForOnlyTestPurpose.uC.LoadTaskList(taskList);
            }


            catch (Exception ep)
            {
                MessageBox.Show(ep.Message);
            }
        }
示例#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);
            }
        }
示例#4
0
        private void button6_Click(object sender, EventArgs e)
        {
            CategorySer  cg       = new CategorySer();
            int          cat_Id   = cg.GetCategoryID(ProjectName, LogIn.user_ID);
            TaskSer      tk       = new TaskSer();
            List <Tasks> taskList = tk.GetAll(cat_Id);


            string spreadSheetPath = "E:\\SQL SERVER\\sajib.xlsx";

            File.Delete(spreadSheetPath);
            FileInfo spreadSheetInfo = new FileInfo(spreadSheetPath);

            ExcelPackage pck = new ExcelPackage(spreadSheetInfo);

            var workSheet = pck.Workbook.Worksheets.Add("My First");

            workSheet.Cells["A1"].Value = "Task_ID";
            workSheet.Cells["B1"].Value = "Task_Title";
            workSheet.Cells["C1"].Value = "Task_Date";
            workSheet.Cells["D1"].Value = "Task_Time";
            workSheet.Cells["E1"].Value = "Task_Repeat_Date_ID";
            workSheet.Cells["F1"].Value = "Task_Description";
            workSheet.Cells["G1"].Value = "Task_Priority";
            workSheet.Cells["H1"].Value = "Category_ID";
            workSheet.Cells["I1"].Value = "Task_Complete";

            int currentRow = 2;

            foreach (var tasklist in taskList)
            {
                workSheet.Cells["A" + currentRow.ToString()].Value = tasklist.Task_ID;
                workSheet.Cells["B" + currentRow.ToString()].Value = tasklist.Tittle;
                workSheet.Cells["C" + currentRow.ToString()].Value = Convert.ToDateTime(tasklist.Date).ToShortDateString();
                workSheet.Cells["D" + currentRow.ToString()].Value = tasklist.Time.ToString();
                workSheet.Cells["E" + currentRow.ToString()].Value = tasklist.RepeatDateTask_ID;

                workSheet.Cells["F" + currentRow.ToString()].Value = tasklist.Description;
                workSheet.Cells["G" + currentRow.ToString()].Value = tasklist.Priority;
                workSheet.Cells["H" + currentRow.ToString()].Value = tasklist.Category_ID;
                workSheet.Cells["I" + currentRow.ToString()].Value = tasklist.Task_Complete;

                currentRow++;
            }

            pck.Save();
            pck.Dispose();
            MessageBox.Show("File Is Exported");
        }
示例#5
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);
            }
        }
示例#7
0
        private void HomePage2_Load(object sender, EventArgs e)
        {
            //Before

            //CategoryListShow();

            //ContentUserControl cuc = new ContentUserControl();
            //CategorySer s = new CategorySer();


            //if(category_ID != 0)
            //    cuc.ProjectName = s.GetCategoryName(category_ID, LogIn.user_ID);
            //else if(CategoryName != "")
            //{
            //    category_ID = s.GetCategoryID(CategoryName, LogIn.user_ID);
            //    cuc.ProjectName = CategoryName;
            //}


            ////int cat_ID = s.GetCategoryID("Inbox");
            //TaskListShow(cuc.Flow, category_ID);
            //panel4.Controls.Add(cuc);


            //After

            try
            {
                if (checkFormLoadFirstTime == false)
                {
                    CategoryListShow();
                    CategorySer s     = new CategorySer();
                    int         catID = s.GetCategoryID("Inbox", LogIn.user_ID);

                    TaskSer      taskS    = new TaskSer();
                    List <Tasks> taskList = taskS.GetAll(catID);
                    UserControlForOnlyTestPurpose.uC.Project_Name = "Inbox";
                    UserControlForOnlyTestPurpose.uC.LoadTaskList(taskList);

                    checkFormLoadFirstTime = true;
                }
            }
            catch (Exception ep)
            {
                MessageBox.Show(ep.Message);
            }
        }
示例#8
0
        //After



        public void ForProjectUserControl(string projectName)
        {
            try
            {
                CategorySer s     = new CategorySer();
                int         catID = s.GetCategoryID(projectName, LogIn.user_ID);

                TaskSer      taskS    = new TaskSer();
                List <Tasks> taskList = taskS.GetAll(catID);
                userControlForOnlyTestPurpose2.Project_Name = projectName;

                userControlForOnlyTestPurpose2.LoadTaskList(taskList);
            }
            catch (Exception ep)
            {
                MessageBox.Show(ep.Message);
            }
        }
示例#9
0
        private void btnInbox_Click(object sender, EventArgs e)
        {
            //After

            try
            {
                //CategoryListShow();
                CategorySer s     = new CategorySer();
                int         catID = s.GetCategoryID("Inbox", LogIn.user_ID);

                TaskSer      taskS    = new TaskSer();
                List <Tasks> taskList = taskS.GetAll(catID);
                UserControlForOnlyTestPurpose.uC.Project_Name = "Inbox";
                UserControlForOnlyTestPurpose.uC.LoadTaskList(taskList);
            }
            catch (Exception ep)
            {
                MessageBox.Show(ep.Message);
            }
        }