public static List<cTinhNangDO> GetFunctionList() { List<cTinhNangDO> list = new List<cTinhNangDO>(); using (DB_HMS_Entities lst = new DB_HMS_Entities()) { var query = (from u in lst.tbTINHNANGs select u); foreach (var row in query) { cTinhNangDO ds = new cTinhNangDO(); ds.MATINHNANG = row.MATINHNANG; ds.TENTINHNANG = row.TENTINHNANG; list.Add(ds); } } return list; }
private void SaveFunction() { using (DB_HMS_Entities lst = new DB_HMS_Entities()) { for (int i = 0; i < chklstTinhnang.CheckedItems.Count; i++) { cCheckedListBoxItem item = (cCheckedListBoxItem) chklstTinhnang.CheckedItems[i]; if (item != null) { objTinhnang = (cTinhNangDO)item.Tag; objTinhnangNhomnhanvien = new cTinhNangNhomNhanVienDO(); objTinhnangNhomnhanvien.MANHOMNHANVIEN = txtMaNhom.Text.Trim(); objTinhnangNhomnhanvien.MATINHNANG = objTinhnang.MATINHNANG; BUS.cTinhNangNhomNhanVienBUS.InsertFunctionofGroup(objTinhnangNhomnhanvien.MANHOMNHANVIEN, objTinhnangNhomnhanvien.MATINHNANG); } } } }