Beispiel #1
0
        private void видалитиToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            try
            {
                var DelTime   = Convert.ToDateTime(DateGridView.SelectedRows[0].Cells[0].Value);
                var DelIdShow = Convert.ToInt32(DateGridView.SelectedRows[0].Cells[3].Value);


                var res = MessageBox.Show($"Видалити {DelTime} ?", "", MessageBoxButtons.YesNo);
                if (res == DialogResult.Yes)
                {
                    for (int i = program.dateList.Count - 1; i >= 0; i--)
                    {
                        if (program.dateList[i].StartTime == DelTime && program.dateList[i].Id == DelIdShow)
                        {
                            program.dateList.RemoveAt(i);
                        }
                    }
                    DateGridView.Rows.Remove(DateGridView.SelectedRows[0]);
                    program.IsDirty = true;
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Нічого не виділено. Виделіть весь рядок для видалення!");
                if (DateGridView.Visible == false)
                {
                    DateGridView.Show();
                    TVshowGridView.Hide();
                }
            }
        }
Beispiel #2
0
 private void viewToolStripMenuItem_Click(object sender, EventArgs e)
 {
     DateGridView.Hide();
     TVshowGridView.Hide();
 }
Beispiel #3
0
 private void TVprogramToolStripMenuItem_Click(object sender, EventArgs e)
 {
     TVshowGridView.Hide();
 }