public RentalViewModel.RentalListResult RentalGetAll() { var result = new RentalViewModel.RentalListResult(); result.RentalList = (from o in _dbRepository.GetAll <ExhibitionOrder>() join c in _dbRepository.GetAll <ExhibitionCustomer>() on o.ExCustomerId equals c.ExCustomerId join e in _dbRepository.GetAll <Exhibition>() on o.ExCustomerId equals e.ExCustomerId select new RentalViewModel.RentalSingleResult() { ExOrderId = o.ExOrderId, StartDate = o.StartDate, EndDate = o.EndDate, Price = o.Price, PaymentState = o.PaymentState, ExCustomerName = c.ExCustomerName, ExCustomerPhone = c.ExCustomerPhone, ExCustomerEmail = c.ExCustomerEmail, ExhibitonData = new RentalViewModel.ExhibitonDataModel { ExName = e.ExName, ExhibitionStartTime = e.ExhibitionStartTime.ToString("yyyy/MM/dd"), ExhibitionEndTime = e.ExhibitionEndTime.ToString("yyyy/MM/dd") } }).ToList(); return(result); }
public RentalViewModel.RentalListResult GetRentalDate(int exhibitionId) { var result = new RentalViewModel.RentalListResult(); result.GetRentalDate = (from o in _dbRepository.GetAll <ExhibitionOrder>() join c in _dbRepository.GetAll <ExhibitionCustomer>() on o.ExCustomerId equals c.ExCustomerId join e in _dbRepository.GetAll <Exhibition>() on o.ExCustomerId equals e.ExCustomerId where e.ExhibitionId == exhibitionId select new RentalViewModel.GetRentalDate { StartDate = o.StartDate.ToString("yyyy/MM/dd"), EndDate = o.EndDate.ToString("yyyy/MM/dd") }).ToList(); return(result); }