@@ -82,9 +82,35 @@
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
给他打分
|
||||
<input asp-for="score" class="form-control"/>
|
||||
<input type="submit" value="打" class="btn btn-warning" style="margin:5px" asp-page-handler="Rank" />
|
||||
<input asp-for="score" class="form-control" />
|
||||
<input type="submit" value="打分" class="btn btn-warning" style="margin:5px" asp-page-handler="Rank" />
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
|
||||
<div class="mb-2">
|
||||
作品链接:
|
||||
@{
|
||||
if(Model.Student.Uploads == null)
|
||||
{
|
||||
<div>尚未提交作品</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
var fd = Model.Context.FileDesc.Find(Model.Student.Uploads.Last());
|
||||
if (fd == null)
|
||||
{
|
||||
<div>尚未提交作品</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a href="https://@Html.DisplayFor(model => fd.Path)">点我</a>
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<br />
|
||||
|
||||
@@ -161,7 +187,7 @@
|
||||
</h4>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr >
|
||||
<tr>
|
||||
<th>地点</th>
|
||||
<th>日期</th>
|
||||
<th>时间</th>
|
||||
@@ -293,7 +319,7 @@
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.SubmissionSample.Sex)
|
||||
</th>
|
||||
<th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.SubmissionSample.Yard)
|
||||
</th>
|
||||
<th>
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _2021_backend.Utils;
|
||||
using System.Threading.Tasks;
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace _2021_backend.Pages.Students
|
||||
{
|
||||
@@ -96,26 +97,48 @@ namespace _2021_backend.Pages.Students
|
||||
|
||||
public async Task<IActionResult> OnPostFinalizeAsync(int? pageId, string errInfo)
|
||||
{
|
||||
if (pageId == null) pageId = 0;
|
||||
|
||||
foreach(var s in Context.Students)
|
||||
if (HttpContext.User.HasClaim((c) =>
|
||||
{
|
||||
if (s.RegisterTime.CompareTo(new DateTime(2021, 11, 11)) > 0) s.Status = status.不通过;
|
||||
else if (s.Timelist.Count == 0 && s.Status != status.不通过) s.Status = status.需调整时间;
|
||||
return c.Type == ClaimTypes.Role && (
|
||||
c.Value == "admin" || c.Value == "manager");
|
||||
}))
|
||||
{
|
||||
if (pageId == null) pageId = 0;
|
||||
|
||||
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.不通过) s.Status = status.需调整时间;
|
||||
}
|
||||
Context.SaveChanges();
|
||||
return Construct((int)pageId, errInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Construct(pageId??0, "您无权进行此操作");
|
||||
}
|
||||
Context.SaveChanges();
|
||||
return Construct((int)pageId, errInfo);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostReselectAllAsync(int? pageId,string errInfo)
|
||||
{
|
||||
if (pageId == null) pageId = 0;
|
||||
foreach (var s in Context.Students)
|
||||
if (HttpContext.User.HasClaim((c) =>
|
||||
{
|
||||
if (s.Status != status.不通过) s.Status = status.需调整时间;
|
||||
return c.Type == ClaimTypes.Role && (
|
||||
c.Value == "admin" || c.Value == "manager");
|
||||
}))
|
||||
{
|
||||
if (pageId == null) pageId = 0;
|
||||
foreach (var s in Context.Students)
|
||||
{
|
||||
if (s.Status != status.不通过) s.Status = status.需调整时间;
|
||||
}
|
||||
Context.SaveChanges();
|
||||
return Construct((int)pageId, errInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Construct(pageId ?? 0, "您无权进行此操作");
|
||||
}
|
||||
Context.SaveChanges();
|
||||
return Construct((int)pageId,errInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user