Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
bf0c8c3f
Commit
bf0c8c3f
authored
Mar 10, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
异常处理
parent
a1ed253b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
25 deletions
+32
-25
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+23
-23
CourseController.cs
Edu.WebApi/Controllers/Course/CourseController.cs
+8
-1
appsettings.json
Edu.WebApi/appsettings.json
+1
-1
No files found.
Edu.Module.Course/CourseModule.cs
View file @
bf0c8c3f
...
...
@@ -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
...
...
Edu.WebApi/Controllers/Course/CourseController.cs
View file @
bf0c8c3f
...
...
@@ -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
;
...
...
Edu.WebApi/appsettings.json
View file @
bf0c8c3f
...
...
@@ -13,7 +13,7 @@
}
},
"JwtSecretKey"
:
"@VIITTOREBORN*2018"
,
"JwtExpirTime"
:
25920
00
,
"JwtExpirTime"
:
864
00
,
"IsSendMsg"
:
2
,
"AllowedHosts"
:
"*"
,
"OpenValidation"
:
"False"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment