Exemple #1
0
 private void addbutt_Click(object sender, EventArgs e)
 {
     textBox2.Hide();
     dateTimePicker1.Hide();
     addbutt.Hide();
     Upbut.Hide();
     if (Ind < 0)
     {
         date_ergo.ergonaz.Add(new DeyEvent(textBox2.Text, dateTimePicker1.Value));
         // date_ergo.marcer(monthCalendar1, dateTimePicker1.Value);
         monthCalendar1.AddAnnuallyBoldedDate(dateTimePicker1.Value);
         monthCalendar1.UpdateBoldedDates();
         // MessageBox.Show(dateTimePicker1.Value.ToShortDateString());
         // monthCalendar1.BoldedDates=(new DateTime(2015,11,11));
         // date_ergo.marcer(monthCalendar1);
         // MessageBox.Show(dateTimePicker1.Value.ToShortDateString());
     }
     else
     {
         date_ergo.ergonaz[Ind].dey_ev_list.Add(new UnoEvent(textBox2.Text, dateTimePicker1.Value));
         date_ergo.marcer(monthCalendar1);
         //MessageBox.Show(dateTimePicker1.Value.ToShortDateString());
     }
     monthCalendar1.SetDate(dateTimePicker1.Value);
     textBox2.Hide();
     dateTimePicker1.Hide();
     addbutt.Hide();
     Upbut.Hide();
     date_ergo.Dzin(notifyIcon1);
 }
Exemple #2
0
        private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
        {
            textBox2.Hide();
            dateTimePicker1.Hide();
            addbutt.Hide();
            Upbut.Hide();
            listBox1.Items.Clear();
            int index = date_ergo.search(e.Start);

            // MessageBox.Show(index.ToString());
            if (index >= 0)
            {
                button2.Enabled = true;
                button3.Enabled = true;
                Ind             = index;

                foreach (UnoEvent item in date_ergo.ergonaz[index].dey_ev_list)
                {
                    listBox1.Items.Add(item.Print());
                }
                listBox1.SelectedIndex = 0;
            }
            else
            {
                date_picker     = e.Start;
                button2.Enabled = false;
                button3.Enabled = false;
                Ind             = index;
            }
        }
Exemple #3
0
        public Form1()
        {
            InitializeComponent();
            date_ergo.ergonaz.Add(new DeyEvent(new DateTime(2015, 11, 20)));
            date_ergo.ergonaz.Add(new DeyEvent(new DateTime(2015, 12, 1)));
            date_ergo.ergonaz.Add(new DeyEvent(new DateTime(2015, 11, 30)));
            date_ergo.ergonaz.Add(new DeyEvent(new DateTime(2015, 11, 27)));
            date_ergo.ergonaz.Add(new DeyEvent(new DateTime(2015, 11, 28)));
            date_ergo.ergonaz.Add(new DeyEvent(new DateTime(2015, 11, 26)));

            date_ergo.ergonaz[0].dey_ev_list.Add(new UnoEvent(" 1 Надо сделать", new DateTime(2015, 11, 20, 8, 30, 30)));
            date_ergo.ergonaz[0].dey_ev_list.Add(new UnoEvent(" 2 Надо сделать", new DateTime(2015, 11, 20, 12, 36, 30)));
            date_ergo.ergonaz[1].dey_ev_list.Add(new UnoEvent(" 3 Надо сделать", new DateTime(2015, 12, 1, 13, 00, 30)));
            date_ergo.ergonaz[2].dey_ev_list.Add(new UnoEvent(" 4 Надо сделать", new DateTime(2015, 11, 30, 9, 30, 30)));
            date_ergo.ergonaz[2].dey_ev_list.Add(new UnoEvent(" 5 Надо сделать", new DateTime(2015, 11, 30, 14, 40, 30)));
            date_ergo.ergonaz[2].dey_ev_list.Add(new UnoEvent(" 6 Надо cделать", new DateTime(2015, 11, 30, 21, 15, 30)));
            date_ergo.ergonaz[2].dey_ev_list.Add(new UnoEvent(" 7 Надо сделать", new DateTime(2015, 11, 30, 23, 00, 30)));
            date_ergo.ergonaz[3].dey_ev_list.Add(new UnoEvent(" 8 Надо сделать", new DateTime(2015, 11, 27, 10, 30, 30)));
            date_ergo.ergonaz[3].dey_ev_list.Add(new UnoEvent(" 9 Надо сделать", new DateTime(2015, 11, 27, 21, 20, 30)));
            date_ergo.ergonaz[4].dey_ev_list.Add(new UnoEvent(" 10 Надо сделать", new DateTime(2015, 11, 28, 06, 50, 30)));
            date_ergo.ergonaz[5].dey_ev_list.Add(new UnoEvent(" 8 Надо сделать", new DateTime(2015, 11, 26, 12, 40, 30)));
            textBox2.Hide();
            dateTimePicker1.Hide();
            addbutt.Hide();
            Upbut.Hide();
            date_ergo.marcer(monthCalendar1);
            date_ergo.Dzin(notifyIcon1);
            monthCalendar1.SetDate(DateTime.Now);
            monthCalendar1.RemoveAnnuallyBoldedDate(new DateTime(2015, 11, 17));
        }
Exemple #4
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            textBox2.Hide();
            dateTimePicker1.Hide();
            addbutt.Hide();
            Upbut.Hide();
            int i = listBox1.SelectedIndex;

            textBox1.Text = date_ergo.ergonaz[Ind].dey_ev_list[i].ev_text;
            Ind_ev        = i;
        }
Exemple #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            textBox2.Hide();
            dateTimePicker1.Hide();
            addbutt.Hide();
            Upbut.Hide();


            dateTimePicker1.Value = date_ergo.ergonaz[Ind].dey_ev_list[Ind_ev].ev_time;

            textBox2.Show();
            textBox2.Text = date_ergo.ergonaz[Ind].dey_ev_list[Ind_ev].ev_text;
            dateTimePicker1.Show();
            Upbut.Show();
        }
Exemple #6
0
        private void Upbut_Click(object sender, EventArgs e)
        {
            textBox2.Hide();
            dateTimePicker1.Hide();
            addbutt.Hide();
            Upbut.Hide();
            //textBox2.Text, dateTimePicker1.Value;
            int i = Ind_ev;

            date_ergo.ergonaz[Ind].dey_ev_list[Ind_ev].ev_text = textBox2.Text;
            date_ergo.ergonaz[Ind].dey_ev_list[Ind_ev].ev_time = dateTimePicker1.Value;

            monthCalendar1.SetDate(dateTimePicker1.Value);

            textBox2.Hide();
            dateTimePicker1.Hide();
            Upbut.Hide();
            date_ergo.Dzin(notifyIcon1);
            listBox1.SelectedIndex = i;
        }
Exemple #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            textBox2.Hide();
            dateTimePicker1.Hide();
            addbutt.Hide();
            Upbut.Hide();
            if (Ind < 0)
            {
                dateTimePicker1.Value = date_picker;
                // MessageBox.Show(date_picker.ToShortDateString());
            }
            else
            {
                dateTimePicker1.Value = date_ergo.ergonaz[Ind].ev_dey;
            }

            textBox2.Show();
            textBox2.Text = "Текст";
            dateTimePicker1.Show();
            addbutt.Show();
        }
Exemple #8
0
        private void button3_Click(object sender, EventArgs e)
        {
            date_ergo.ergonaz[Ind].dey_ev_list.RemoveAt(Ind_ev);
            //  monthCalendar1.SetDate(date_ergo.ergonaz[Ind].ev_dey);
            DateTime temp = date_ergo.ergonaz[Ind].ev_dey;

            //  MessageBox.Show(date_ergo.ergonaz[Ind].dey_ev_list.Count.ToString());
            if (date_ergo.ergonaz[Ind].dey_ev_list.Count <= 0)
            {
                monthCalendar1.RemoveAnnuallyBoldedDate(date_ergo.ergonaz[Ind].ev_dey.Date);

                date_ergo.ergonaz.RemoveAt(Ind);
                // MessageBox.Show(Ind.ToString());

                monthCalendar1.RemoveAllBoldedDates();
                monthCalendar1.UpdateBoldedDates();
                //date_ergo.marcer(monthCalendar1);
            }
            monthCalendar1.SetDate(temp);
            textBox2.Hide();
            dateTimePicker1.Hide();
            Upbut.Hide();
            date_ergo.Dzin(notifyIcon1);
        }