满勤天数动态

parent 2ddb327b
...@@ -495,7 +495,9 @@ public void Copy(per_allot allot) ...@@ -495,7 +495,9 @@ public void Copy(per_allot allot)
if (data == null || data.Count == 0) if (data == null || data.Count == 0)
{ {
var again = _againRepository.GetEntities(t => t.AllotID == allotId) ?? _againRepository.GetEntities(t => t.AllotID == -1); var again = _againRepository.GetEntities(t => t.AllotID == allotId) ?? _againRepository.GetEntities(t => t.AllotID == -1);
var newAgains = again.Select(t => new cof_again { AllotID = allot.ID, Type = t.Type, Department = t.Department, TypeName = t.TypeName, Value = t.Value }); var days = DateTime.DaysInMonth(allot.Year, allot.Month);
var newAgains = again.Select(t => new cof_again
{ AllotID = allot.ID, Type = t.Type, Department = t.Department, TypeName = t.TypeName, Value = t.TypeName == "满勤天数" ? days : t.Value });
_againRepository.AddRange(newAgains.ToArray()); _againRepository.AddRange(newAgains.ToArray());
} }
} }
......
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