public bool Xoa(string MaPhieu) { try { PHIEUDATPHONG ph = db.PHIEUDATPHONGs.Where(t => t.MAPHIEUDH == MaPhieu).ToList().First(); db.PHIEUDATPHONGs.DeleteOnSubmit(ph); db.SubmitChanges(); return(true); } catch { return(false); } }
public void ThemPD(string MPD, string MKH, string MNV, string MP, string NgayLap, string NgayBD) { QLKhachSanEntities chung = new QLKhachSanEntities(); PHIEUDATPHONG td = new PHIEUDATPHONG(); td.MAPHIEUDAT = MPD; td.MAKH = MKH; td.MANV = MNV; td.MAPHONG = MP; td.NGAYLAP = DateTime.Parse(NgayLap); td.NGAYBD = DateTime.Parse(NgayBD); chung.PHIEUDATPHONG.Add(td); chung.SaveChanges(); }
public bool Them(string madat, string makh, string manv, DateTime dtNgayDat, DateTime dtNgayVao, DateTime dtGioVao) { PHIEUDATPHONG pdp = new PHIEUDATPHONG(); pdp.MAPHIEUDH = madat; pdp.MAKH = makh; pdp.MANV = manv; pdp.NGAYDATPH = dtNgayDat; pdp.NGAYVAO = dtNgayVao; pdp.GIOVAO = dtGioVao; db.PHIEUDATPHONGs.InsertOnSubmit(pdp); db.SubmitChanges(); return(true); }