public void CreateChuongBai(string idMonHoc, int soChuong, string tenChuong, string maChuong, int soBai) { ChuongBai cb = new ChuongBai(); cb.ID = Guid.NewGuid().ToString(); cb.ID_MonHoc = idMonHoc; cb.SoChuong = soChuong; cb.TenChuong = tenChuong; cb.MaChuong = maChuong; cb.SoBai = soBai; cb.InUsed = true; cb.IsDeleted = false; db.ChuongBais.InsertOnSubmit(cb); db.SubmitChanges(); }
public ChuongBai getChuongBaiByID(string idChuongBai) { ChuongBai cb = db.ChuongBais.SingleOrDefault(p => p.ID == idChuongBai); return(cb); }