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
8ec90002
Commit
8ec90002
authored
Sep 28, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增实体类
parent
10a039dc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
15 deletions
+56
-15
RB_Course_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_ViewModel.cs
+5
-0
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+2
-2
RB_CourseRepository.cs
Edu.Repository/Course/RB_CourseRepository.cs
+20
-13
CourseController.cs
Edu.WebApi/Controllers/Course/CourseController.cs
+29
-0
No files found.
Edu.Model/ViewModel/Course/RB_Course_ViewModel.cs
View file @
8ec90002
...
...
@@ -28,5 +28,10 @@ namespace Edu.Model.ViewModel.Course
/// 更新时间
/// </summary>
public
string
UpdateTimeStr
{
get
{
return
this
.
UpdateTime
.
FormatTime
();
}
}
/// <summary>
/// 分类名称
/// </summary>
public
string
CateName
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.Course/CourseModule.cs
View file @
8ec90002
...
...
@@ -124,7 +124,7 @@ namespace Edu.Module.Course
/// <param name="CourseId"></param>
/// <param name="IsShowChapterNo">是否显示章节编号(1-显示,0-不显示)</param>
/// <returns></returns>
public
bool
SetCourseIsShowChapterNo
(
int
CourseId
,
int
IsShowChapterNo
)
public
bool
SetCourseIsShowChapterNo
Module
(
int
CourseId
,
int
IsShowChapterNo
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
...
...
@@ -138,7 +138,7 @@ namespace Edu.Module.Course
/// 设置课程教师
/// </summary>
/// <param name="CourseId"></param>
/// <param name="Teacher_Id"></param>
/// <param name="Teacher_Id">
教师编号
</param>
/// <returns></returns>
public
bool
SetCourseTeacherModule
(
int
CourseId
,
int
Teacher_Id
)
{
...
...
Edu.Repository/Course/RB_CourseRepository.cs
View file @
8ec90002
using
Edu.Model.ViewModel.Course
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.Course
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -21,22 +22,23 @@ namespace Edu.Repository.Course
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT
*
FROM RB_Course
SELECT
A.*,IFNULL(B.CateName,'') AS CateName
FROM RB_Course
AS A LEFT JOIN rb_course_category AS B ON A.CateId=B.CateId
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Course_ViewModel
.
Group_Id
),
query
.
Group_Id
);
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Course_ViewModel
.
School_Id
),
query
.
School_Id
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
Group_Id
),
query
.
Group_Id
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
School_Id
),
query
.
School_Id
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CourseName
))
{
builder
.
AppendFormat
(
" AND {0} LIKE @CourseName "
,
nameof
(
RB_Course_ViewModel
.
CourseName
));
builder
.
AppendFormat
(
" AND
A.
{0} LIKE @CourseName "
,
nameof
(
RB_Course_ViewModel
.
CourseName
));
parameters
.
Add
(
"CourseName"
,
"%"
+
query
.
CourseName
.
Trim
()
+
"%"
);
}
if
(
query
.
CateId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Course_ViewModel
.
CateId
),
query
.
CateId
);
builder
.
AppendFormat
(
" AND
A.
{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
CateId
),
query
.
CateId
);
}
}
return
Get
<
RB_Course_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
...
...
@@ -55,22 +57,27 @@ WHERE 1=1
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT
*
FROM RB_Course
SELECT
A.*,IFNULL(B.CateName,'') AS CateName
FROM RB_Course
AS A LEFT JOIN rb_course_category AS B ON A.CateId=B.CateId
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Course_ViewModel
.
Group_Id
),
query
.
Group_Id
);
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Course_ViewModel
.
School_Id
),
query
.
School_Id
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
Group_Id
),
query
.
Group_Id
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
School_Id
),
query
.
School_Id
);
if
(
query
!=
null
)
{
if
((
int
)
query
.
Status
>
-
1
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
Status
),
query
.
Status
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CourseName
))
{
builder
.
AppendFormat
(
" AND {0} LIKE @CourseName "
,
nameof
(
RB_Course_ViewModel
.
CourseName
));
builder
.
AppendFormat
(
" AND
A.
{0} LIKE @CourseName "
,
nameof
(
RB_Course_ViewModel
.
CourseName
));
parameters
.
Add
(
"CourseName"
,
"%"
+
query
.
CourseName
.
Trim
()
+
"%"
);
}
if
(
query
.
CateId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Course_ViewModel
.
CateId
),
query
.
CateId
);
builder
.
AppendFormat
(
" AND
A.
{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
CateId
),
query
.
CateId
);
}
}
return
GetPage
<
RB_Course_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
...
...
Edu.WebApi/Controllers/Course/CourseController.cs
View file @
8ec90002
...
...
@@ -212,6 +212,35 @@ namespace Edu.WebApi.Controllers.Course
var
flag
=
courseModule
.
RemoveCourseModule
(
CourseId
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 是否显示章节编号
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetCourseIsShowChapterNo
()
{
var
CourseId
=
base
.
ParmJObj
.
GetInt
(
"CourseId"
,
0
);
int
IsShowChapterNo
=
base
.
ParmJObj
.
GetInt
(
"IsShowChapterNo"
,
0
);
var
flag
=
courseModule
.
SetCourseIsShowChapterNoModule
(
CourseId
,
IsShowChapterNo
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 设置课程教师
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetCourseTeacher
()
{
var
CourseId
=
base
.
ParmJObj
.
GetInt
(
"CourseId"
,
0
);
int
Teacher_Id
=
base
.
ParmJObj
.
GetInt
(
"Teacher_Id"
,
0
);
var
flag
=
courseModule
.
SetCourseTeacherModule
(
CourseId
,
Teacher_Id
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
#
region
教案管理
#
endregion
}
}
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