Commit 5925413b authored by 黄奎's avatar 黄奎

页面修改

parent 068d1c08
......@@ -1011,26 +1011,30 @@ namespace Edu.Module.Course
{
flag = course_PreferentialRepository.DeleteCoursePreferentialRepostory(courseModel.CourseId);
}
//找出差异的数据
var deleteList = oldList.Where(qitem => !list.Any(oldItem => qitem.Id == oldItem.Id)).ToList();
foreach (var dItem in deleteList)
else
{
if (dItem.Id > 0)
{
flag = course_PreferentialRepository.Delete(dItem.Id) > 0;
}
}
foreach (var priceItem in list)
{
if (priceItem.Id == 0)
//找出差异的数据
var deleteList = oldList.Where(qitem => !list.Any(oldItem => qitem.Id == oldItem.Id)).ToList();
foreach (var dItem in deleteList)
{
flag = course_PreferentialRepository.Insert(priceItem) > 0;
if (dItem.Id > 0)
{
flag = course_PreferentialRepository.Delete(dItem.Id) > 0;
}
}
else
foreach (var priceItem in list)
{
flag = course_PreferentialRepository.Update(priceItem);
if (priceItem.Id == 0)
{
flag = course_PreferentialRepository.Insert(priceItem) > 0;
}
else
{
flag = course_PreferentialRepository.Update(priceItem);
}
}
}
}
return flag;
}
......
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