private void btnCancle_Click(object sender, EventArgs e) { //直接根据选中的项的数量来还原 string result = null; int n = clbHistory.CheckedItems.Count; for (int i = 0; i < n; i++) { result = StaticSQLiteHelper.Recovery(); } //string result=StaticSQLiteHelper.Recovery(); if (result == null) { MessageBox.Show("已经没有可以撤销的操作!"); } else { //MessageBox.Show(result); schedule = new Schedule(StaticSQLiteHelper.GetSchedule()); nightSchedule = new Schedule(StaticSQLiteHelper.GetNightSchedule()); loadClassSchedule(currentClassID); loadHistory(); } }
public void Initialize() { styleForeColorRed = new DataGridViewCellStyle(); styleForeColorRed.ForeColor = Color.Red; schedule = new Schedule(StaticSQLiteHelper.GetSchedule()); nightSchedule = new Schedule(StaticSQLiteHelper.GetNightSchedule()); morningSchedule = new Schedule(StaticSQLiteHelper.GetMorningSchedule()); dgv.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; TestConflict(); lockedStyle = new DataGridViewCellStyle(); lockedStyle.BackColor = dgv.DefaultCellStyle.SelectionBackColor; lockedStyle.ForeColor = dgv.DefaultCellStyle.SelectionForeColor; LoadClassList(); adjustDataGridViewStyle(); loadClassSchedule(0); rbExchange.Checked = true; loadHistory(); }
public void Initialize(bool enabled) { dtSubject = StaticSQLiteHelper.GetSubjectList(); subjects = new List <string>(); schedule = new Schedule(StaticSQLiteHelper.GetSchedule()); nightSchedule = new Schedule(StaticSQLiteHelper.GetNightSchedule()); AdjustDataGridView(); UpdateDataGridView(); if (enabled) { foreach (DataRow r in dtSubject.Rows) { subjects.Add(r[0].ToString()); } cbSubject.DataSource = subjects; } }
public void loadSchedule() { //DataTable dt = StaticSQLiteHelper.GetSchedule(); _schedule = new Schedule(StaticSQLiteHelper.GetSchedule()); _nightSchedule = new Schedule(StaticSQLiteHelper.GetNightSchedule()); }