private void SetLichTrinh(LichTrinh lichTrinh) { ATINChamCongEntities context = new ATINChamCongEntities(); var lstMap = context.spGetMapLichTrinhNangCaoByLichTrinh(lichTrinh.MaLichTrinh).ToList(); textEdit1.Text = lichTrinh.MaLichTrinh; textEdit2.Text = lichTrinh.TenLichTrinh; checkBox1.Checked = false; checkBox2.Checked = false; checkBox3.Checked = false; checkBox4.Checked = false; checkBox5.Checked = false; foreach (var map in lstMap) { switch (map.MaLichTrinhNangCao) { case "NC1": checkBox1.Checked = true; break; case "NC2": checkBox2.Checked = true; break; case "NC3": checkBox3.Checked = true; break; case "NC4": checkBox4.Checked = true; break; case "NC5": checkBox5.Checked = true; break; } } switch (lichTrinh.LoaiChuKy) { case "week": radioButton1.Checked = true; WorkCalendarShowType = "week"; break; case "month": radioButton2.Checked = true; WorkCalendarShowType = "monh"; break; case "year": radioButton3.Checked = true; WorkCalendarShowType = "year"; break; } RefreshGrid2(lichTrinh.MaLichTrinh); }