BUG

parent 602fc3b3
......@@ -117,13 +117,13 @@ public ApiResponse SetAssessType(SetAssessRequest request)
if (intersectList != null && intersectList.Count() > 0)
intersectList.ForEach(t => request.Department.Remove(t));
//删除更改
var removeList = perforAsdataRepository.GetEntities(t => !intersectList.Contains(t.Department));
var removeList = perforAsdataRepository.GetEntities(t => !intersectList.Contains(t.Department) && t.AssessID == request.AssessID);
if (removeList != null && removeList.Count() > 0)
perforAsdataRepository.RemoveRange(removeList.ToArray());
}
//添加新增
var addList = request.Department.Select(t => new as_data { AllotID = request.AllotID, AssessID = request.AssessID, Department = t }).ToArray();
var result = perforAsdataRepository.AddRange(addList);
var result = (addList != null && addList.Count() > 0) ? perforAsdataRepository.AddRange(addList) : true;
return result ? new ApiResponse(ResponseType.OK) : new ApiResponse(ResponseType.Fail);
}
......@@ -163,7 +163,7 @@ public ApiResponse AddColumn(int assessID, int parentID, string columnName, int
if (clist != null && clist.Count > 0)
{
int atsort = sort;
clist.ForEach(t => t.Sort = atsort + 1);
clist.ForEach(t => { t.Sort = atsort + 1; atsort++; });
perforAscolumnsRepository.UpdateRange(clist.ToArray());
}
var column = new as_columns { AssessID = assessID, ParentID = parentID, ColumnName = columnName, Sort = sort };
......
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