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
2e5d4d2b
Commit
2e5d4d2b
authored
Sep 24, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增实体类
parent
dbe0eb0f
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
384 additions
and
7 deletions
+384
-7
RB_Course_Notice.cs
Edu.Model/Entity/Course/RB_Course_Notice.cs
+0
-2
RB_Course_NoticeRevice.cs
Edu.Model/Entity/Course/RB_Course_NoticeRevice.cs
+0
-2
CourseCategoryTree_ViewModel.cs
Edu.Model/ViewModel/Course/CourseCategoryTree_ViewModel.cs
+3
-1
RB_Course_Category_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_Category_ViewModel.cs
+0
-2
RB_Course_Chapter_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_Chapter_ViewModel.cs
+16
-0
RB_Course_NoticeRevice_ViewModel.cs
...odel/ViewModel/Course/RB_Course_NoticeRevice_ViewModel.cs
+16
-0
RB_Course_Notice_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_Notice_ViewModel.cs
+16
-0
RB_Course_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_ViewModel.cs
+13
-0
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+113
-0
RB_CourseRepository.cs
Edu.Repository/Course/RB_CourseRepository.cs
+75
-0
RB_Course_ChapterRepository.cs
Edu.Repository/Course/RB_Course_ChapterRepository.cs
+43
-0
RB_Course_NoticeRepository.cs
Edu.Repository/Course/RB_Course_NoticeRepository.cs
+47
-0
RB_Course_NoticeReviceRepository.cs
Edu.Repository/Course/RB_Course_NoticeReviceRepository.cs
+42
-0
No files found.
Edu.Model/Entity/Course/RB_Course_Notice.cs
View file @
2e5d4d2b
using
Edu.Common.Enum
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Course
...
...
Edu.Model/Entity/Course/RB_Course_NoticeRevice.cs
View file @
2e5d4d2b
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Course
...
...
Edu.Model/ViewModel/Course/CourseCategoryTree_ViewModel.cs
View file @
2e5d4d2b
using
System.Collections.Generic
;
using
System
;
using
System.Collections.Generic
;
namespace
Edu.Model.ViewModel.Course
{
/// <summary>
/// 课程分类树形结构实体类
/// </summary>
[
Serializable
]
public
class
CourseCategoryTree_ViewModel
{
/// <summary>
...
...
Edu.Model/ViewModel/Course/RB_Course_Category_ViewModel.cs
View file @
2e5d4d2b
using
System
;
using
VT.FW.DB
;
namespace
Edu.Model.ViewModel.Course
{
...
...
@@ -7,7 +6,6 @@ namespace Edu.Model.ViewModel.Course
/// 课程分类视图实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Course_Category_ViewModel
:
Model
.
Entity
.
Course
.
RB_Course_Category
{
/// <summary>
...
...
Edu.Model/ViewModel/Course/RB_Course_Chapter_ViewModel.cs
0 → 100644
View file @
2e5d4d2b
using
System
;
namespace
Edu.Model.ViewModel.Course
{
/// <summary>
/// 课程章节视图实体类
/// </summary>
[
Serializable
]
public
class
RB_Course_Chapter_ViewModel
:
Model
.
Entity
.
Course
.
RB_Course_Chapter
{
/// <summary>
/// 课程编号【逗号分隔】
/// </summary>
public
string
CourseIds
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Course_NoticeRevice_ViewModel.cs
0 → 100644
View file @
2e5d4d2b
using
System
;
namespace
Edu.Model.ViewModel.Course
{
/// <summary>
/// 课程通知接收视图实体类
/// </summary>
[
Serializable
]
public
class
RB_Course_NoticeRevice_ViewModel
:
Model
.
Entity
.
Course
.
RB_Course_NoticeRevice
{
/// <summary>
/// 通知编号【逗号分隔】
/// </summary>
public
string
NoticeIds
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Course_Notice_ViewModel.cs
0 → 100644
View file @
2e5d4d2b
using
System
;
namespace
Edu.Model.ViewModel.Course
{
/// <summary>
/// 课程通知视图实体类
/// </summary>
[
Serializable
]
public
class
RB_Course_Notice_ViewModel
:
Model
.
Entity
.
Course
.
RB_Course_Notice
{
/// <summary>
/// 课程编号【逗号分隔】
/// </summary>
public
string
CourseIds
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Course/RB_Course_ViewModel.cs
0 → 100644
View file @
2e5d4d2b
using
System
;
namespace
Edu.Model.ViewModel.Course
{
/// <summary>
/// 课程视图实体类
/// </summary>
[
Serializable
]
public
class
RB_Course_ViewModel
:
Model
.
Entity
.
Course
.
RB_Course
{
}
}
\ No newline at end of file
Edu.Module.Course/CourseModule.cs
0 → 100644
View file @
2e5d4d2b
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Repository.Course
;
using
Microsoft.AspNetCore.Mvc.ModelBinding
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Module.Course
{
/// <summary>
/// 课程处理类
/// </summary>
public
class
CourseModule
{
/// <summary>
/// 课程章节仓储层对象
/// </summary>
private
readonly
RB_Course_ChapterRepository
chapterRepository
=
new
RB_Course_ChapterRepository
();
/// <summary>
/// 课程通知仓储层对象
/// </summary>
private
readonly
RB_Course_NoticeRepository
noticeRepository
=
new
RB_Course_NoticeRepository
();
/// <summary>
/// 课程通知接收仓储层对象
/// </summary>
private
readonly
RB_Course_NoticeReviceRepository
noticeReviceRepository
=
new
RB_Course_NoticeReviceRepository
();
/// <summary>
/// 课程处理仓储层对象
/// </summary>
private
readonly
RB_CourseRepository
courseRepository
=
new
RB_CourseRepository
();
/// <summary>
/// 获取课程列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course_ViewModel
>
GetCourseListModule
(
RB_Course_ViewModel
query
)
{
return
courseRepository
.
GetCourseListRepository
(
query
);
}
/// <summary>
/// 获取课程分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course_ViewModel
>
GetCoursePageListModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Course_ViewModel
query
)
{
return
courseRepository
.
GetCoursePageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
}
/// <summary>
/// 根据课程编号获取课程实体
/// </summary>
/// <param name="CourseId"></param>
/// <returns></returns>
public
RB_Course_ViewModel
GetCourseModule
(
object
CourseId
)
{
return
courseRepository
.
GetEntity
<
RB_Course_ViewModel
>(
CourseId
);
}
/// <summary>
/// 新增修改课程
/// </summary>
/// <returns></returns>
public
bool
SetCourseModule
(
RB_Course_ViewModel
model
)
{
bool
flag
;
if
(
model
.
CourseId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_ViewModel
.
CoverImg
),
model
.
CoverImg
},
{
nameof
(
RB_Course_ViewModel
.
CourseName
),
model
.
CourseName
},
{
nameof
(
RB_Course_ViewModel
.
CourseIntro
),
model
.
CourseIntro
},
{
nameof
(
RB_Course_ViewModel
.
CateId
),
model
.
CateId
},
};
flag
=
courseRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_ViewModel
.
CourseId
),
model
.
CourseId
));
}
else
{
var
newId
=
courseRepository
.
Insert
(
model
);
model
.
CourseId
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 删除课程
/// </summary>
/// <param name="CourseId"></param>
/// <returns></returns>
public
bool
RemoveCourseModule
(
object
CourseId
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_ViewModel
.
Status
),(
int
)
DateStateEnum
.
Delete
},
};
bool
flag
=
courseRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_ViewModel
.
CourseId
),
CourseId
));
return
flag
;
}
}
}
Edu.Repository/Course/RB_CourseRepository.cs
0 → 100644
View file @
2e5d4d2b
using
Edu.Model.ViewModel.Course
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.Course
{
/// <summary>
/// 课程仓储层
/// </summary>
public
class
RB_CourseRepository
:
BaseRepository
<
Model
.
Entity
.
Course
.
RB_Course
>
{
/// <summary>
/// 获取课程列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course_ViewModel
>
GetCourseListRepository
(
RB_Course_ViewModel
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT *
FROM RB_Course
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CourseName
))
{
builder
.
AppendFormat
(
" AND {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
);
}
}
return
Get
<
RB_Course_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
/// <summary>
/// 获取课程分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course_ViewModel
>
GetCoursePageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Course_ViewModel
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT *
FROM RB_Course
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CourseName
))
{
builder
.
AppendFormat
(
" AND {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
);
}
}
return
GetPage
<
RB_Course_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
Edu.Repository/Course/RB_Course_ChapterRepository.cs
0 → 100644
View file @
2e5d4d2b
using
Edu.Model.ViewModel.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.Course
{
/// <summary>
/// 课程章节仓储层
/// </summary>
public
class
RB_Course_ChapterRepository
:
BaseRepository
<
Model
.
Entity
.
Course
.
RB_Course_Chapter
>
{
/// <summary>
/// 获取课程章节列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course_Chapter_ViewModel
>
GetChapterListRepository
(
RB_Course_Chapter_ViewModel
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT *
FROM rb_course_chapter
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
CourseId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Course_Chapter_ViewModel
.
CourseId
),
query
.
CourseId
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CourseIds
))
{
builder
.
AppendFormat
(
" AND {0} IN({1}) "
,
nameof
(
RB_Course_Chapter_ViewModel
.
CourseId
),
query
.
CourseIds
);
}
}
return
Get
<
RB_Course_Chapter_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
Edu.Repository/Course/RB_Course_NoticeRepository.cs
0 → 100644
View file @
2e5d4d2b
using
Edu.Model.ViewModel.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.Course
{
/// <summary>
/// 课程通知仓储层
/// </summary>
public
class
RB_Course_NoticeRepository
:
BaseRepository
<
Model
.
Entity
.
Course
.
RB_Course_Notice
>
{
/// <summary>
/// 获取课程通知分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course_Notice_ViewModel
>
GetNoticePageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Course_Notice_ViewModel
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT *
FROM rb_course_notice
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
CourseId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Course_Notice_ViewModel
.
CourseId
),
query
.
CourseId
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CourseIds
))
{
builder
.
AppendFormat
(
" AND {0} IN({1}) "
,
nameof
(
RB_Course_Notice_ViewModel
.
CourseId
),
query
.
CourseIds
);
}
}
return
GetPage
<
RB_Course_Notice_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
Edu.Repository/Course/RB_Course_NoticeReviceRepository.cs
0 → 100644
View file @
2e5d4d2b
using
Edu.Model.ViewModel.Course
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.Course
{
/// <summary>
/// 课程通知接收仓储层
/// </summary>
public
class
RB_Course_NoticeReviceRepository
:
BaseRepository
<
Model
.
Entity
.
Course
.
RB_Course_NoticeRevice
>
{
/// <summary>
/// 获取课程通知接收列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course_NoticeRevice_ViewModel
>
GetNoticeReviceListRepository
(
RB_Course_NoticeRevice_ViewModel
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT *
FROM RB_Course_NoticeRevice
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
NoticeId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Course_NoticeRevice_ViewModel
.
NoticeId
),
query
.
NoticeId
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
NoticeIds
))
{
builder
.
AppendFormat
(
" AND {0} IN({1}) "
,
nameof
(
RB_Course_NoticeRevice_ViewModel
.
NoticeId
),
query
.
NoticeIds
);
}
}
return
Get
<
RB_Course_NoticeRevice_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
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