private void button_add_Click(object sender, EventArgs e)
        {
            if (textBox_name.Text.Equals("") || textBox_assaignedto.Text.Equals(""))
            {
                MessageBox.Show("Please Insert To DO Name or Assaigned Person!!!");
            }

            else
            {
                To_Do_List td = new To_Do_List();
                td.addAssaignedWork(username, name, textBox_name.Text, dateTimePicker_date.Text, info[0]);
            }
        }
Пример #2
0
        private void button_edit_Click(object sender, EventArgs e)
        {
            To_Do_List td = new To_Do_List();

            if (checkBox_complete.Checked)
            {
                status = "true";
            }
            else
            {
                status = "false";
            }
            //MessageBox.Show(username+" "+name+" "+status);
            td.editToDo(username, name, textBox_name.Text, dateTimePicker_date.Value.ToString(), status, info[0], work);
        }
        private void Project_Name_Load(object sender, EventArgs e)
        {
            Project pj = new Project();

            info = pj.showProjectInfo(projectname);
            label_projectname.Text    = info[0];
            label_projectdescrip.Text = info[1];
            if (!info[3].Equals(""))
            {
                label_collab1.Text = info[3];
            }
            if (!info[5].Equals(""))
            {
                label_collab2.Text = info[5];
            }
            if (!info[7].Equals(""))
            {
                label_collab3.Text = info[7];
            }

            //To Do List
            To_Do_List td = new To_Do_List();

            information = td.showList(label_projectname.Text);

            if (information != null && information.MyINT > 0)
            {
                int n = 0, j = 20;
                for (int i = 0; i < information.MyINT; i++)
                {
                    Label check = new Label();
                    check.Text     = information.MyStringArray[i, 2];
                    check.Location = new Point(10, n);
                    check.Font     = new Font(check.Font.FontFamily, 12);
                    check.Size     = new System.Drawing.Size(300, 20);
                    listView_todolist.Controls.Add(check);


                    Label lbl = new Label();
                    lbl.Text     = information.MyStringArray[i, 1] + "-";
                    lbl.Location = new Point(13, j);
                    lbl.Font     = new Font(lbl.Font.FontFamily, 8);
                    lbl.Size     = new System.Drawing.Size(lbl.Right, 12);
                    listView_todolist.Controls.Add(lbl);


                    Label date = new Label();
                    date.Text     = information.MyStringArray[i, 3];
                    date.Location = new Point(lbl.Right, j);
                    date.Font     = new Font(lbl.Font.FontFamily, 8);
                    date.Size     = new System.Drawing.Size(100, 12);
                    listView_todolist.Controls.Add(date);

                    Label status = new Label();
                    if (information.MyStringArray[i, 4].Equals("false"))
                    {
                        status.Text = "Assaigned";
                    }
                    else
                    {
                        status.Text = "Completed";
                    }
                    status.Location = new Point(date.Right, j);
                    status.Font     = new Font(status.Font.FontFamily, 8);
                    status.Size     = new System.Drawing.Size(70, 12);
                    listView_todolist.Controls.Add(status);



                    lbl_edit[i].Text     = "Edit";
                    lbl_edit[i].Location = new Point(status.Right, j);
                    lbl_edit[i].Font     = new Font(lbl_edit[i].Font.FontFamily, 8);
                    lbl_edit[i].Size     = new System.Drawing.Size(lbl_edit[i].Right, 12);
                    listView_todolist.Controls.Add(lbl_edit[i]);

                    n += 40;
                    j += 40;
                }
            }
        }