Commit 6e3d7884 authored by 黄奎's avatar 黄奎

页面修改

parent c9ac727d
...@@ -121,5 +121,10 @@ namespace Edu.Model.Entity.Course ...@@ -121,5 +121,10 @@ namespace Edu.Model.Entity.Course
/// 客户人数 /// 客户人数
/// </summary> /// </summary>
public int JoinNum { get; set; } public int JoinNum { get; set; }
/// <summary>
/// 订单编号
/// </summary>
public int OrderId { get; set; }
} }
} }
...@@ -29,5 +29,20 @@ namespace Edu.Model.ViewModel.Course ...@@ -29,5 +29,20 @@ namespace Edu.Model.ViewModel.Course
/// 课程源数据 /// 课程源数据
/// </summary> /// </summary>
public object SourceData { get; set; } public object SourceData { get; set; }
/// <summary>
/// 班级编号【转订单使用】
/// </summary>
public int ClassId { get; set; }
/// <summary>
/// 班级名称【转订单使用】
/// </summary>
public string ClassName { get; set; }
/// <summary>
/// 可选班级列表【转订单使用】
/// </summary>
public List<object> ClassList { get; set; }
} }
} }
...@@ -204,7 +204,6 @@ namespace Edu.Module.Course ...@@ -204,7 +204,6 @@ namespace Edu.Module.Course
model.RenewOgPrice = 0; model.RenewOgPrice = 0;
model.RenewSlPrice = 0; model.RenewSlPrice = 0;
} }
if (model.CourseId > 0) if (model.CourseId > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -861,6 +860,47 @@ namespace Edu.Module.Course ...@@ -861,6 +860,47 @@ namespace Edu.Module.Course
model.JobId = newId; model.JobId = newId;
flag = newId > 0; flag = newId > 0;
} }
var oldJobDetailsList = course_JobDetailsRepository.GetCourseJobDetailsListRepository(new RB_Course_JobDetails_ViewModel() { JobId = model.JobId });
if (oldJobDetailsList == null || (oldJobDetailsList != null && oldJobDetailsList.Count == 0))
{
if (model.JobDetailsList != null && model.JobDetailsList.Count > 0)
{
foreach (var item in model.JobDetailsList)
{
item.JobId = model.JobId;
flag = course_JobDetailsRepository.Insert(item) > 0;
}
}
else {
//现在没有详情列表【直接删除以前的详情列表】
if (model.JobDetailsList == null || (model.JobDetailsList != null && model.JobDetailsList.Count == 0))
{
course_JobDetailsRepository.RemoveCourseJobDetailsRepository(model.JobId);
}
//找出差异的数据
var deleteList = oldJobDetailsList.Where(qitem => !model.JobDetailsList.Any(oldItem => qitem.DetailsId == oldItem.DetailsId)).ToList();
foreach (var dItem in deleteList)
{
if (dItem.DetailsId > 0)
{
course_JobDetailsRepository.Delete(dItem.DetailsId);
}
}
foreach (var dItem in model.JobDetailsList)
{
dItem.JobId = model.JobId;
if (dItem.DetailsId == 0)
{
course_JobDetailsRepository.Insert(dItem);
}
else
{
course_JobDetailsRepository.Update(dItem);
}
}
}
}
return flag; return flag;
} }
......
...@@ -39,5 +39,17 @@ WHERE 1=1 ...@@ -39,5 +39,17 @@ WHERE 1=1
} }
return Get<RB_Course_JobDetails_ViewModel>(builder.ToString()).ToList(); return Get<RB_Course_JobDetails_ViewModel>(builder.ToString()).ToList();
} }
/// <summary>
/// 根据作业编号删除作业
/// </summary>
/// <param name="JobId"></param>
/// <returns></returns>
public bool RemoveCourseJobDetailsRepository(int JobId)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" DELETE FROM RB_Course_JobDetails WHERE JobId={0} ", JobId);
return base.Execute(builder.ToString()) > 0;
}
} }
} }
...@@ -86,7 +86,10 @@ namespace Edu.WebApi.Controllers.Course ...@@ -86,7 +86,10 @@ namespace Edu.WebApi.Controllers.Course
[HttpPost] [HttpPost]
public ApiResult GetClassList() public ApiResult GetClassList()
{ {
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Class_ViewModel>(RequestParm.Msg.ToString()); var query = new RB_Class_ViewModel()
{
CouseId=base.ParmJObj.GetInt("CourseId")
};
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id; query.School_Id = base.UserInfo.School_Id;
var list = classModule.GetClassListModule(query); var list = classModule.GetClassListModule(query);
......
...@@ -247,5 +247,16 @@ namespace Edu.WebApi.Controllers.Course ...@@ -247,5 +247,16 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.Success(data: data); return ApiResult.Success(data: data);
} }
#endregion #endregion
/// <summary>
/// 报价单转订单
/// </summary>
/// <returns></returns>
public ApiResult OfferTransOrder()
{
var offerId = base.ParmJObj.GetInt("OfferId", 0);
return ApiResult.Failed();
}
} }
} }
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