Commit bf0c8c3f authored by 黄奎's avatar 黄奎

异常处理

parent a1ed253b
......@@ -241,31 +241,31 @@ namespace Edu.Module.Course
//现在没有阶梯报价了【直接删除以前的阶梯报价】
if (model.StepPriceList == null || (model.StepPriceList != null && model.StepPriceList.Count == 0))
{
course_StepPriceRepository.DeleteStepPriceRepository(model.CourseId);
//course_StepPriceRepository.DeleteStepPriceRepository(model.CourseId);
}
//找出差异的数据
var deleteList = oldStepPriceList.Where(qitem => !model.StepPriceList.Any(oldItem => qitem.CoursePriceId == oldItem.CoursePriceId)).ToList();
foreach (var dItem in deleteList)
{
if (dItem.CoursePriceId > 0)
{
course_StepPriceRepository.Delete(dItem.CoursePriceId);
}
}
foreach (var priceItem in model.StepPriceList)
{
priceItem.CourseId = model.CourseId;
priceItem.Group_Id = model.Group_Id;
priceItem.School_Id = model.School_Id;
if (priceItem.CoursePriceId == 0)
{
course_StepPriceRepository.Insert(priceItem);
}
else
{
course_StepPriceRepository.Update(priceItem);
}
}
//var deleteList = oldStepPriceList.Where(qitem => !model.StepPriceList.Any(oldItem => qitem.CoursePriceId == oldItem.CoursePriceId)).ToList();
//foreach (var dItem in deleteList)
//{
// if (dItem.CoursePriceId > 0)
// {
// course_StepPriceRepository.Delete(dItem.CoursePriceId);
// }
//}
//foreach (var priceItem in model.StepPriceList)
//{
// priceItem.CourseId = model.CourseId;
// priceItem.Group_Id = model.Group_Id;
// priceItem.School_Id = model.School_Id;
// if (priceItem.CoursePriceId == 0)
// {
// course_StepPriceRepository.Insert(priceItem);
// }
// else
// {
// course_StepPriceRepository.Update(priceItem);
// }
//}
}
}
#endregion
......
......@@ -112,7 +112,14 @@ namespace Edu.WebApi.Controllers.Course
[HttpPost]
public ApiResult SetCourseCategory()
{
var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_Course_Category_ViewModel>(RequestParm.Msg.ToString());
var extModel = new RB_Course_Category_ViewModel()
{
CateId=base.ParmJObj.GetInt("CateId"),
CateName=base.ParmJObj.GetStringValue("CateName"),
ParentId=base.ParmJObj.GetInt("ParentId"),
SortNum=base.ParmJObj.GetInt("SortNum"),
Status=(DateStateEnum)base.ParmJObj.GetInt("Status")
};
extModel.CreateTime = DateTime.Now;
extModel.CreateBy = UserInfo.Id;
extModel.UpdateBy = UserInfo.Id;
......
......@@ -13,7 +13,7 @@
}
},
"JwtSecretKey": "@VIITTOREBORN*2018",
"JwtExpirTime": 2592000,
"JwtExpirTime": 86400,
"IsSendMsg": 2,
"AllowedHosts": "*",
"OpenValidation": "False",
......
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