Commit 11253b94 authored by 黄奎's avatar 黄奎

页面修改

parent 5ea00f2e
......@@ -437,7 +437,18 @@ namespace Edu.Module.Duty
if (model.PlanDetails != null && model.PlanDetails.Count > 0)
{
//当前值班人员索引
int currentIndex = model.PlanDetails.FindIndex(qitem => qitem.DutyMan == user.Id);
int currentIndex = 0;
var currentDayNow = Convert.ToDateTime(Common.ConvertHelper.FormatDate(model.Date) + " " + DateTime.Now.ToString("HH:mm:ss"));
for (var i = 0; i < model.PlanDetails.Count; i++)
{
var sStartTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(model.Date) + " " + model.PlanDetails[i].StartTime);
var sEndTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(model.Date) + " " + model.PlanDetails[i].EndTime);
if (currentDayNow >= sStartTime && currentDayNow <= sEndTime && model.PlanDetails[i].DutyMan == user.Id)
{
currentIndex = i;
}
}
//上一个班次索引
int previousIndex = currentIndex - 1;
//下一个班次索引
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment