Beispiel #1
0
        private void AddNewProgram_Click(object sender, EventArgs e)
        {
            var models = WorkWithText.GetAllTeleprograms();

            models.Add(ReadFromForm());
            WorkWithText.SaveProgram(models);
            this.Close();
        }
        private void AddNewProgram_Click(object sender, EventArgs e)
        {
            AddNewProgramForm form = new AddNewProgramForm();

            form.ShowDialog();
            models = WorkWithText.GetAllTeleprograms();
            MainGrid.DataSource = models;
        }
        public MainForm()
        {
            InitializeComponent();
            FileManager manager = new FileManager(DbLocation);

            manager.CreateDirectory();
            manager.CreateFile();
            if (WorkWithText.GetAllTeleprograms().Count == 0)
            {
                WorkWithText.AddFakeDb();
            }
            models = WorkWithText.GetAllTeleprograms();
            MainGrid.DataSource = models;
            helper = new DatabaseHelper();
        }
 private void DeletePrograms_Click(object sender, EventArgs e)
 {
     helper.DeleteProgram(models);
     models = WorkWithText.GetAllTeleprograms();
     MainGrid.DataSource = models;
 }