public void PostCTHDP(Chitietdatphong ctdp) { using (QLKhachsanEntities entity = new QLKhachsanEntities()) { entity.Chitietdatphongs.Add(ctdp); entity.SaveChanges(); } }
public void PutCTHDP(long sophong, long iddat, Chitietdatphong ctdp) { using (QLKhachsanEntities entity = new QLKhachsanEntities()) { var cth = entity.Chitietdatphongs.FirstOrDefault(e => e.Sophong.Equals(sophong) && e.IDDAT.Equals(iddat)); // cth.Sophong = cthdp.Sophong; // cth.IDHD = cthdp.IDHD; cth.Ngayden = ctdp.Ngayden; cth.Ngaydi = ctdp.Ngaydi; entity.SaveChanges(); } }