//delete all private void button3_Click(object sender, EventArgs e) { button3.Enabled = false; Cursor.Current = Cursors.WaitCursor; ATINChamCongEntities context = new ATINChamCongEntities(); switch (WorkCalendarShowType) { case "week": context.spDeleteAllLichTrinhTuanByLichTrinh(lichTrinh.MaLichTrinh); break; case "month": context.spDeleteAllLichTrinhThangByLichTrinh(lichTrinh.MaLichTrinh); break; case "year": context.spDeleteAllLichTrinhNamByLichTrinh_Month(lichTrinh.MaLichTrinh, comboBox1.SelectedIndex + 1); break; } TreeView1Config(listView2); Cursor.Current = Cursors.Default; button3.Enabled = true; }