开发工具与关键技术:VS、MVC
作者:何德润
撰写时间:2019.6.15
下面,我实现的功能是根据指定的时间段查询出数据。
视图页面的部分代码为:
日期选择框
<div class="form-row mb-1">
<div class="col-6">
<div class="d-inline-flex col-12">
<label class="col-form-label">存放日期:</label>
<input type="date" class="form-control col-3" id="storageDate" />
<label class="col-form-label"> 至 </label>
<input type="date" class="form-control col-3" id="storageDate1" />
</div>
</div>
</div>
控制器查询代码:
public ActionResult lugg(LayuiTablePage LayuiTablePage,DateTime? startDateTime, DateTime? endDateTime)
{
try
{
var list = (from tbluggageDeposit in myModel.B_luggageDeposit
join tbpassenger in myModel.S_passenger on