public TMEditForm(TMDatabase DB) { InitializeComponent(); this.ID = 0; this.DB = DB; this.Text = "Создание задачи"; }
private void MainForm_Shown(object sender, EventArgs e) { DB = new TMDatabase(); if (DB.Open()) { ReRead(0); } else { MessageBox.Show("Не удалось открыть файл базы данных: " + DB.GetErrorString(), "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); Close(); } TM = new System.Timers.Timer(); TM.Elapsed += Timer_Timeout; TM.Interval = 1000; TM.Start(); }
public TMEditForm(TMDatabase DB, int ID) { InitializeComponent(); this.ID = ID; this.DB = DB; TMCommandItem Item = DB.GetRowFromID(ID); EditName.Text = Item.Name; EditCommand.Text = Item.Command; EditActive.Checked = Item.Active; EditTime.Value = Item.Time.ToDateTime(); EditMonday.Checked = Item.Monday; EditTuesday.Checked = Item.Tuesday; EditWednesday.Checked = Item.Wednesday; EditThursday.Checked = Item.Thursday; EditFriday.Checked = Item.Friday; EditSaturday.Checked = Item.Saturday; EditSunday.Checked = Item.Sunday; this.Text = "Изменение задачи: " + Item.Name; }