コード例 #1
0
        private void thêmCôngViệcTrongNgàyToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            ToDoNote ToDo = new ToDoNote();

            ToDo.FromDtpk.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0);
            ToDo.ToDtpk.Value   = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0);
            ToDo.ShowDialog();
        }
コード例 #2
0
ファイル: GeneralNoteForm.cs プロジェクト: 11012001/tam
 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();
 }
コード例 #3
0
ファイル: GeneralNoteForm.cs プロジェクト: 11012001/tam
        //Thêm chức năng nút chi tiết cho lập lịch
        void Td_Details(object sender, EventArgs e)
        {
            ToDoControl TDC = sender as ToDoControl;
            var         Td  = new ToDoNote();
            string      sql = $"select * from NoteByDate where IdNote = {TDC.Tag}";

            Td.IdNote = Convert.ToInt32(TDC.Tag);
            DataTable dt = NoteData.QueryAsDatatable(sql);

            foreach (DataRow row in dt.Rows)
            {
                Td.MainNote.Text            = row["NoteText"].ToString();
                Td.FHoursCB.SelectedIndex   = Convert.ToInt32(row["FromH"]);
                Td.FMinutesCB.SelectedIndex = Convert.ToInt32(row["FromM"]);
                Td.THoursCB.SelectedIndex   = Convert.ToInt32(row["ToH"]);
                Td.TMinutesCB.SelectedIndex = Convert.ToInt32(row["ToM"]);
                Td.DescriptionTB.Text       = row["Description"].ToString();
                Td.FromDtpk.Value           = Convert.ToDateTime(row["AppDate"]);
                Td.TitleLabel.Text          = "Cập nhật ghi chú";
                if (Convert.ToInt32(row["Important"]) == 1)
                {
                    Td.ImportantCheck.Checked = true;
                }
                else
                {
                    Td.ImportantCheck.Checked = false;
                }
            }
            Td.MainNote.Enabled       = false;
            Td.FHoursCB.Enabled       = false;
            Td.FMinutesCB.Enabled     = false;
            Td.THoursCB.Enabled       = false;
            Td.TMinutesCB.Enabled     = false;
            Td.DescriptionTB.Enabled  = false;
            Td.FromDtpk.Enabled       = false;
            Td.RepeatCB.Enabled       = false;
            Td.ToDtpk.Enabled         = false;
            Td.ImportantCheck.Enabled = false;
            Td.SaveBtn.Visible        = false;
            Td.ShowDialog();
        }
コード例 #4
0
ファイル: GeneralNoteForm.cs プロジェクト: 11012001/tam
        //Thêm chức năng nút edit cho lập lịch
        void Td_Edited(object sender, EventArgs e)
        {
            ToDoControl TDC = sender as ToDoControl;
            var         Td  = new ToDoNote();
            string      sql = $"select * from NoteByDate where IdNote = {TDC.Tag}";

            Td.IdNote = Convert.ToInt32(TDC.Tag);
            DataTable dt = NoteData.QueryAsDatatable(sql);

            foreach (DataRow row in dt.Rows)
            {
                Td.MainNote.Text            = row["NoteText"].ToString();
                Td.FHoursCB.SelectedIndex   = Convert.ToInt32(row["FromH"]);
                Td.FMinutesCB.SelectedIndex = Convert.ToInt32(row["FromM"]);
                Td.THoursCB.SelectedIndex   = Convert.ToInt32(row["ToH"]);
                Td.TMinutesCB.SelectedIndex = Convert.ToInt32(row["ToM"]);
                Td.DescriptionTB.Text       = row["Description"].ToString();
                Td.FromDtpk.Value           = Convert.ToDateTime(row["AppDate"]);
                Td.TitleLabel.Text          = "Cập nhật ghi chú";
                Td.DescriptionTB.ForeColor  = Color.Black;
                if (Convert.ToInt32(row["Important"]) == 1)
                {
                    Td.ImportantCheck.Checked = true;
                }
                else
                {
                    Td.ImportantCheck.Checked = false;
                }
            }
            Td.MainNote.ForeColor = Color.Black;
            if (Td.ShowDialog() == DialogResult.OK)
            {
                ControlPanel.Controls.Clear();
                AddNoteToDay();
            }
        }