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

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

            form.ShowDialog();
            models = WorkWithText.GetAllTeleprograms();
            MainGrid.DataSource = models;
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
 private void DeletePrograms_Click(object sender, EventArgs e)
 {
     helper.DeleteProgram(models);
     models = WorkWithText.GetAllTeleprograms();
     MainGrid.DataSource = models;
 }