Пример #1
0
        private void Addrevresh_Click(object sender, EventArgs e)
        {
            Temp.data = DataEvents[0, Position[0]].Value.ToString();
            Temp.time = DataEvents[1, Position[0]].Value.ToString();
            Temp.text = DataEvents[2, Position[0]].Value.ToString();
            Temp.type = DataEvents[3, Position[0]].Value.ToString();
            Add_event_window window = new Add_event_window("Change");

            window.ShowDialog();
            if (Temp.temp == true)
            {
                DataEvents.Rows.RemoveAt(Position[0]);
                DataEvents.Rows.Add();
                if (Temp.type == "Памятка")
                {
                    DataEvents[0, DataEvents.Rows.Count - 1].Value = new Bitmap("ok.png");
                }
                if (Temp.type == "Встреча")
                {
                    DataEvents[0, DataEvents.Rows.Count - 1].Value = new Bitmap("clea.png");
                }
                if (Temp.type == "Задание")
                {
                    DataEvents[0, DataEvents.Rows.Count - 1].Value = new Bitmap("voskl.png");
                }
                DataEvents[1, DataEvents.Rows.Count - 1].Value = Temp.data;
                DataEvents[2, DataEvents.Rows.Count - 1].Value = Temp.time;
                DataEvents[3, DataEvents.Rows.Count - 1].Value = Temp.text;
                DataEvents[4, DataEvents.Rows.Count - 1].Value = Temp.type;
                TypeMode.Text = Temp.type;
                Temp.temp     = false;
            }
        }
Пример #2
0
        private void Add_Click(object sender, EventArgs e)
        {
            Add_event_window window = new Add_event_window();

            window.ShowDialog();
            if (Temp.temp == true)
            {
                DataEvents.Rows.Add();
                if (Temp.type == "Памятка")
                {
                    DataEvents[0, DataEvents.Rows.Count - 1].Value = new Bitmap("ok.png");
                }
                if (Temp.type == "Встреча")
                {
                    DataEvents[0, DataEvents.Rows.Count - 1].Value = new Bitmap("clea.png");
                }
                if (Temp.type == "Задание")
                {
                    DataEvents[0, DataEvents.Rows.Count - 1].Value = new Bitmap("voskl.png");
                }
                DataEvents[1, DataEvents.Rows.Count - 1].Value = Temp.data;
                DataEvents[2, DataEvents.Rows.Count - 1].Value = Temp.time;
                DataEvents[3, DataEvents.Rows.Count - 1].Value = Temp.text;
                DataEvents[4, DataEvents.Rows.Count - 1].Value = Temp.type;
                TypeMode.Text = Temp.type;
                Temp.temp     = false;
            }
        }