@@ -35,6 +35,7 @@
|
||||
</div>
|
||||
<button type="submit" class="btn btn-outline-primary m-2">搜索</button>
|
||||
<input type="submit" value="Cleanup" class="btn btn-primary" asp-page-handler="Finalize" />
|
||||
<input type="submit" value="Reset Timeselect" class="btn btn-primary" asp-page-handler="ReselectAll" />
|
||||
</form>
|
||||
<table class="table">
|
||||
<thead>
|
||||
|
||||
@@ -101,10 +101,20 @@ namespace _2021_backend.Pages.Students
|
||||
foreach(var s in Context.Students)
|
||||
{
|
||||
if (s.RegisterTime.CompareTo(new DateTime(2021, 11, 11)) > 0) s.Status = status.不通过;
|
||||
else if (s.Timelist.Count == 0) s.Status = status.需调整时间;
|
||||
else if (s.Timelist.Count == 0 && s.Status != status.不通过) s.Status = status.需调整时间;
|
||||
}
|
||||
Context.SaveChanges();
|
||||
return Construct((int)pageId, errInfo);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostReselectAllAsync(int? pageId,string errInfo)
|
||||
{
|
||||
foreach (var s in Context.Students)
|
||||
{
|
||||
if (s.Status != status.不通过) s.Status = status.需调整时间;
|
||||
}
|
||||
Context.SaveChanges();
|
||||
return Construct((int)pageId,errInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user