//Sửa nhân viên public int updatePhieuThuePhong(PhieuThuePhongDTO ptpDTO) { try { var querry = (from ptp in htDataContext.phieuthuephongs where ptp.maphieuthue == ptpDTO.Maphieuthue select ptp).FirstOrDefault <phieuthuephong>(); querry.maphieudat = ptpDTO.Maphieudat; querry.username = ptpDTO.Username; htDataContext.SubmitChanges(); return(1); } catch { return(0); } }
//Thêm nhân viên public int insertPhieuThuePhong(PhieuThuePhongDTO ptpDTO) { try { phieuthuephong ptp = new phieuthuephong(); ptp.maphieuthue = ptpDTO.Maphieuthue; ptp.maphieudat = ptpDTO.Maphieudat; ptp.username = ptpDTO.Username; htDataContext.phieuthuephongs.InsertOnSubmit(ptp); htDataContext.SubmitChanges(); return(1); } catch { return(0); } }