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
e1a43e73
Commit
e1a43e73
authored
Mar 17, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
acd3aa1d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
3 deletions
+60
-3
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+60
-3
No files found.
Edu.Module.Course/CourseModule.cs
View file @
e1a43e73
using
Edu.AOP.CustomerAttribute
;
using
Edu.AOP.CustomerAttribute
;
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.Question
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
Edu.Repository.Course
;
using
Edu.Repository.Course
;
using
Edu.Repository.Question
;
using
Edu.Repository.User
;
using
Edu.Repository.User
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
...
@@ -85,6 +87,11 @@ namespace Edu.Module.Course
...
@@ -85,6 +87,11 @@ namespace Edu.Module.Course
/// </summary>
/// </summary>
private
readonly
RB_TeacherRepository
teacherRepository
=
new
RB_TeacherRepository
();
private
readonly
RB_TeacherRepository
teacherRepository
=
new
RB_TeacherRepository
();
/// <summary>
/// 问题仓储层对象
/// </summary>
private
readonly
RB_QuestionRepository
questionRepository
=
new
RB_QuestionRepository
();
#
region
课程管理
#
region
课程管理
/// <summary>
/// <summary>
...
@@ -216,8 +223,6 @@ namespace Edu.Module.Course
...
@@ -216,8 +223,6 @@ namespace Edu.Module.Course
{
nameof
(
RB_Course_ViewModel
.
UpdateTime
),
model
.
UpdateTime
},
{
nameof
(
RB_Course_ViewModel
.
UpdateTime
),
model
.
UpdateTime
},
{
nameof
(
RB_Course_ViewModel
.
Teacher_Ids
),
model
.
Teacher_Ids
},
{
nameof
(
RB_Course_ViewModel
.
Teacher_Ids
),
model
.
Teacher_Ids
},
{
nameof
(
RB_Course_ViewModel
.
CourseFeature
),
model
.
CourseFeature
},
{
nameof
(
RB_Course_ViewModel
.
CourseFeature
),
model
.
CourseFeature
},
//{nameof(RB_Course_ViewModel.OriginalPrice),model.OriginalPrice },
//{nameof(RB_Course_ViewModel.SellPrice),model.SellPrice },
{
nameof
(
RB_Course_ViewModel
.
IsOpenStepPrice
),
model
.
IsOpenStepPrice
},
{
nameof
(
RB_Course_ViewModel
.
IsOpenStepPrice
),
model
.
IsOpenStepPrice
},
{
nameof
(
RB_Course_ViewModel
.
IsRenew
),
model
.
IsRenew
},
{
nameof
(
RB_Course_ViewModel
.
IsRenew
),
model
.
IsRenew
},
{
nameof
(
RB_Course_ViewModel
.
RenewOgPrice
),
model
.
RenewOgPrice
},
{
nameof
(
RB_Course_ViewModel
.
RenewOgPrice
),
model
.
RenewOgPrice
},
...
@@ -860,7 +865,6 @@ namespace Edu.Module.Course
...
@@ -860,7 +865,6 @@ 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
});
var
oldJobDetailsList
=
course_JobDetailsRepository
.
GetCourseJobDetailsListRepository
(
new
RB_Course_JobDetails_ViewModel
()
{
JobId
=
model
.
JobId
});
if
(
oldJobDetailsList
==
null
||
(
oldJobDetailsList
!=
null
&&
oldJobDetailsList
.
Count
==
0
))
if
(
oldJobDetailsList
==
null
||
(
oldJobDetailsList
!=
null
&&
oldJobDetailsList
.
Count
==
0
))
{
{
...
@@ -869,6 +873,7 @@ namespace Edu.Module.Course
...
@@ -869,6 +873,7 @@ namespace Edu.Module.Course
foreach
(
var
item
in
model
.
JobDetailsList
)
foreach
(
var
item
in
model
.
JobDetailsList
)
{
{
item
.
JobId
=
model
.
JobId
;
item
.
JobId
=
model
.
JobId
;
item
.
QuestionId
=
SetQuestionModule
(
model
,
item
);
flag
=
course_JobDetailsRepository
.
Insert
(
item
)
>
0
;
flag
=
course_JobDetailsRepository
.
Insert
(
item
)
>
0
;
}
}
}
}
...
@@ -889,6 +894,7 @@ namespace Edu.Module.Course
...
@@ -889,6 +894,7 @@ namespace Edu.Module.Course
}
}
foreach
(
var
dItem
in
model
.
JobDetailsList
)
foreach
(
var
dItem
in
model
.
JobDetailsList
)
{
{
dItem
.
QuestionId
=
SetQuestionModule
(
model
,
dItem
);
dItem
.
JobId
=
model
.
JobId
;
dItem
.
JobId
=
model
.
JobId
;
if
(
dItem
.
DetailsId
==
0
)
if
(
dItem
.
DetailsId
==
0
)
{
{
...
@@ -904,6 +910,57 @@ namespace Edu.Module.Course
...
@@ -904,6 +910,57 @@ namespace Edu.Module.Course
return
flag
;
return
flag
;
}
}
/// <summary>
/// 处理作业问题
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public
int
SetQuestionModule
(
RB_Course_Job_ViewModel
jobModel
,
RB_Course_JobDetails_ViewModel
item
)
{
var
model
=
new
RB_Question_ViewModel
()
{
QuestionId
=
item
.
QuestionId
,
CourseId
=
jobModel
.
CourseId
,
Title
=
item
.
Title
,
QuestionContent
=
item
.
QuestionContent
,
DifficultyType
=
item
.
DifficultyType
,
AnswerParse
=
item
.
AnswerParse
,
QuestionTypeId
=
item
.
QuestionTypeId
,
QuestionTypeName
=
item
.
QuestionTypeKey
,
Knowledge
=
item
.
Knowledge
,
CreateBy
=
jobModel
.
CreateBy
,
CreateTime
=
jobModel
.
CreateTime
,
UpdateBy
=
jobModel
.
UpdateBy
,
UpdateTime
=
jobModel
.
UpdateTime
,
IsUpdateJobExam
=
item
.
IsUpdateJobExam
,
Status
=
0
,
SortNum
=
0
,
Answer
=
item
.
Answer
,
IsMutex
=
item
.
IsMutex
,
Category
=
item
.
Category
,
LevelType
=
item
.
LevelType
,
};
if
(
model
.
QuestionId
>
0
)
{
var
newId
=
questionRepository
.
Insert
(
model
);
model
.
QuestionId
=
newId
;
if
(
newId
>
0
)
{
Dictionary
<
string
,
object
>
sortFileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Question_ViewModel
.
SortNum
),
newId
},
};
//更新问题排序
questionRepository
.
Update
(
sortFileds
,
new
WhereHelper
(
nameof
(
RB_Question_ViewModel
.
QuestionId
),
newId
));
}
}
else
{
questionRepository
.
Update
(
model
);
}
return
model
.
QuestionId
;
}
/// <summary>
/// <summary>
/// 设置作业其他配置
/// 设置作业其他配置
/// </summary>
/// </summary>
...
...
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