private void thêmDeadlineToolStripMenuItem_Click_1(object sender, EventArgs e) { DeadLineNote Deadline = new DeadLineNote(); Deadline.Dtpk.Value = DateTime.Now; Deadline.ShowDialog(); }
//Thêm chức năng nút chi tiết cho deadline void DL_Details(object sender, EventArgs e) { DeadLineControl DLC = sender as DeadLineControl; var DL = new DeadLineNote(); string sql = $"select * from Deadline where IdDeadline = {DLC.Tag}"; DL.IDDeadLine = Convert.ToInt32(DLC.Tag); DataTable dt = NoteData.QueryAsDatatable(sql); foreach (DataRow row in dt.Rows) { if (Convert.ToInt32(row["UrgentCount"]) == 1) { DL.UrgentCB.SelectedIndex = 0; } else if (Convert.ToInt32(row["UrgentCount"]) == 3) { DL.UrgentCB.SelectedIndex = 1; } else if (Convert.ToInt32(row["UrgentCount"]) == 7) { DL.UrgentCB.SelectedIndex = 2; } else { DL.UrgentCB.SelectedIndex = 3; } DL.HoursCB.SelectedIndex = Convert.ToInt32(row["TimeHEnd"]); DL.MinutesCB.SelectedIndex = Convert.ToInt32(row["TimeMEnd"]); DL.Dtpk.Value = Convert.ToDateTime(row["DateEnd"]); DL.DescriptionTB.Text = row["DescriptionText"].ToString(); DL.MainNote.Text = row["DeadlineText"].ToString(); if (Convert.ToInt32(row["Importance"]) == 1) { DL.ImportantCheck.Checked = true; } else { DL.ImportantCheck.Checked = false; } } DL.HoursCB.Enabled = false; DL.MinutesCB.Enabled = false; DL.Dtpk.Enabled = false; DL.DescriptionTB.Enabled = false; DL.MainNote.Enabled = false; DL.UrgentCB.Enabled = false; DL.ImportantCheck.Enabled = false; DL.SaveBtn.Visible = false; DL.ShowDialog(); }
//Thêm chức năng nút edit cho lập lịch void DL_Edited(object sender, EventArgs e) { DeadLineControl DLC = sender as DeadLineControl; var DL = new DeadLineNote(); DL.MainNote.ForeColor = Color.Black; DL.DescriptionTB.ForeColor = Color.Black; string sql = $"select * from Deadline where IdDeadline = {DLC.Tag}"; DL.IDDeadLine = Convert.ToInt32(DLC.Tag); DataTable dt = NoteData.QueryAsDatatable(sql); foreach (DataRow row in dt.Rows) { if (Convert.ToInt32(row["UrgentCount"]) == 1) { DL.UrgentCB.SelectedIndex = 0; } else if (Convert.ToInt32(row["UrgentCount"]) == 3) { DL.UrgentCB.SelectedIndex = 1; } else if (Convert.ToInt32(row["UrgentCount"]) == 7) { DL.UrgentCB.SelectedIndex = 2; } else { DL.UrgentCB.SelectedIndex = 3; } DL.MainNote.ForeColor = Color.Black; DL.DescriptionTB.ForeColor = Color.Black; DL.HoursCB.SelectedIndex = Convert.ToInt32(row["TimeHEnd"]); DL.MinutesCB.SelectedIndex = Convert.ToInt32(row["TimeMEnd"]); DL.Dtpk.Value = Convert.ToDateTime(row["DateEnd"]); DL.DescriptionTB.Text = row["DescriptionText"].ToString(); DL.MainNote.Text = row["DeadlineText"].ToString(); if (Convert.ToInt32(row["Importance"]) == 1) { DL.ImportantCheck.Checked = true; } else { DL.ImportantCheck.Checked = false; } } if (DL.ShowDialog() == DialogResult.OK) { ControlPanel.Controls.Clear(); AddNoteToDay(); } }
private void AddJobBtn_Click_1(object sender, EventArgs e) { if (Button == 1) { var TDN = new ToDoNote(); TDN.FromDtpk.Value = Dtpk.Value; TDN.ToDtpk.Value = Dtpk.Value; TDN.ShowDialog(); } else { var DL = new DeadLineNote(); DL.Dtpk.Value = DateTime.Now; DL.ShowDialog(); } AddNoteToDay(); }