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
c3f9d9f1
Commit
c3f9d9f1
authored
4 years ago
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
fe834d1c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
316 additions
and
2 deletions
+316
-2
RB_Course_Source.cs
Edu.Model/Entity/Course/RB_Course_Source.cs
+7
-1
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+309
-1
No files found.
Edu.Model/Entity/Course/RB_Course_Source.cs
View file @
c3f9d9f1
using
System
;
using
Edu.Common.Enum
;
using
System
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Course
...
...
@@ -90,5 +91,10 @@ namespace Edu.Model.Entity.Course
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
DateStateEnum
Status
{
get
;
set
;
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Edu.Module.Course/CourseModule.cs
View file @
c3f9d9f1
...
...
@@ -19,6 +19,11 @@ namespace Edu.Module.Course
/// </summary>
private
readonly
RB_Course_ChapterRepository
chapterRepository
=
new
RB_Course_ChapterRepository
();
/// <summary>
/// 课程讨论仓储层对象
/// </summary>
private
readonly
RB_Course_DiscussRepository
discussRepository
=
new
RB_Course_DiscussRepository
();
/// <summary>
/// 课程通知仓储层对象
/// </summary>
...
...
@@ -29,6 +34,21 @@ namespace Edu.Module.Course
/// </summary>
private
readonly
RB_Course_NoticeReviceRepository
noticeReviceRepository
=
new
RB_Course_NoticeReviceRepository
();
/// <summary>
/// 课程设置仓储层对象
/// </summary>
private
readonly
RB_Course_SettingRepository
settingRepository
=
new
RB_Course_SettingRepository
();
/// <summary>
/// 课程资料仓储层对象
/// </summary>
private
readonly
RB_Course_SourceRepository
sourceRepository
=
new
RB_Course_SourceRepository
();
/// <summary>
/// 课程教案仓储层对象
/// </summary>
private
readonly
RB_Course_TeachPlanRepository
teachPlanRepository
=
new
RB_Course_TeachPlanRepository
();
/// <summary>
/// 课程处理仓储层对象
/// </summary>
...
...
@@ -111,6 +131,22 @@ namespace Edu.Module.Course
return
flag
;
}
/// <summary>
/// 设置课程教师
/// </summary>
/// <param name="CourseId"></param>
/// <param name="Teacher_Id"></param>
/// <returns></returns>
public
bool
SetCourseTeacherModule
(
int
CourseId
,
int
Teacher_Id
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_ViewModel
.
Teacher_Id
),
Teacher_Id
},
};
bool
flag
=
courseRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_ViewModel
.
CourseId
),
CourseId
));
return
flag
;
}
/// <summary>
/// 删除课程
/// </summary>
...
...
@@ -187,5 +223,277 @@ namespace Edu.Module.Course
model
.
ReviceId
=
newId
;
return
newId
>
0
;
}
/// <summary>
/// 新增修改课程章节
/// </summary>
/// <returns></returns>
public
bool
SetChapterModule
(
RB_Course_Chapter_ViewModel
model
)
{
bool
flag
;
if
(
model
.
ChapterId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_Chapter_ViewModel
.
ChapterNo
)
,
model
.
ChapterNo
},
{
nameof
(
RB_Course_Chapter_ViewModel
.
ChapterName
)
,
model
.
ChapterName
},
{
nameof
(
RB_Course_Chapter_ViewModel
.
ChapterContent
)
,
model
.
ChapterContent
},
{
nameof
(
RB_Course_Chapter_ViewModel
.
ParentId
)
,
model
.
ParentId
},
};
flag
=
chapterRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Chapter_ViewModel
.
ChapterId
),
model
.
ChapterId
));
}
else
{
var
newId
=
chapterRepository
.
Insert
(
model
);
model
.
ChapterId
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 获取章节实体类
/// </summary>
/// <param name="ChapterId"></param>
/// <returns></returns>
public
RB_Course_Chapter_ViewModel
GetChapterModule
(
object
ChapterId
)
{
return
chapterRepository
.
GetEntity
<
RB_Course_Chapter_ViewModel
>(
ChapterId
);
}
/// <summary>
/// 删除章节
/// </summary>
/// <param name="ChapterId"></param>
/// <returns></returns>
public
bool
RemoveChapterModule
(
object
ChapterId
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_Chapter_ViewModel
.
Status
)
,(
int
)
DateStateEnum
.
Delete
},
};
bool
flag
=
chapterRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Chapter_ViewModel
.
ChapterId
),
ChapterId
));
return
flag
;
}
/// <summary>
/// 设置章节开发状态
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetChapterOpenStatusModule
(
RB_Course_Chapter_ViewModel
model
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_Chapter_ViewModel
.
OpenStatus
)
,
model
.
OpenStatus
},
{
nameof
(
RB_Course_Chapter_ViewModel
.
OpenStart
)
,
model
.
OpenStart
},
{
nameof
(
RB_Course_Chapter_ViewModel
.
OpenEnd
)
,
model
.
OpenEnd
},
};
bool
flag
=
chapterRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Chapter_ViewModel
.
ChapterId
),
model
.
ChapterId
));
return
flag
;
}
/// <summary>
/// 设置章节进度
/// </summary>
/// <param name="ChapterId"></param>
/// <param name="Progress"></param>
/// <returns></returns>
public
bool
SetChapterProgressModule
(
object
ChapterId
,
int
Progress
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_Chapter_ViewModel
.
Progress
)
,
Progress
},
};
bool
flag
=
chapterRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Chapter_ViewModel
.
ChapterId
),
ChapterId
));
return
flag
;
}
/// <summary>
/// 新增修改讨论话题
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetDiscussModule
(
RB_Course_Discuss_ViewModel
model
)
{
bool
flag
;
if
(
model
.
DiscussId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_Discuss_ViewModel
.
DiscussTitle
),
model
.
DiscussTitle
},
{
nameof
(
RB_Course_Discuss_ViewModel
.
DiscussContent
),
model
.
DiscussContent
},
{
nameof
(
RB_Course_Discuss_ViewModel
.
DiscussUrl
),
model
.
DiscussUrl
},
};
flag
=
discussRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Discuss_ViewModel
.
DiscussId
),
model
.
DiscussId
));
}
else
{
var
newId
=
discussRepository
.
Insert
(
model
);
model
.
DiscussId
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 获取讨论话题
/// </summary>
/// <param name="DiscussId"></param>
/// <returns></returns>
public
RB_Course_Discuss_ViewModel
GetDiscussModule
(
object
DiscussId
)
{
return
discussRepository
.
GetEntity
<
RB_Course_Discuss_ViewModel
>(
DiscussId
);
}
/// <summary>
/// 删除讨论话题
/// </summary>
/// <param name="DiscussId"></param>
/// <returns></returns>
public
bool
RemoveDiscussModule
(
object
DiscussId
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_Discuss_ViewModel
.
Status
),(
int
)
DateStateEnum
.
Delete
},
};
bool
flag
=
discussRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Discuss_ViewModel
.
DiscussId
),
DiscussId
));
return
flag
;
}
/// <summary>
/// 新增修改课程配置
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetCourseSettingModule
(
RB_Course_Setting_ViewModel
model
)
{
var
oldModel
=
settingRepository
.
GetCourseSettingRepository
(
model
);
bool
flag
;
if
(
oldModel
!=
null
&&
oldModel
.
SettingId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_Setting_ViewModel
.
AppIsCache
),
model
.
AppIsCache
},
{
nameof
(
RB_Course_Setting_ViewModel
.
PlayType
),
model
.
PlayType
},
};
flag
=
settingRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Setting_ViewModel
.
SettingId
),
oldModel
.
SettingId
));
}
else
{
var
newId
=
settingRepository
.
Insert
(
model
);
model
.
SettingId
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 新增修改课程资料
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetCourseSourceModule
(
RB_Course_Source_ViewModel
model
)
{
bool
flag
;
if
(
model
.
SourceId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_Source_ViewModel
.
SourceName
),
model
.
SourceName
},
{
nameof
(
RB_Course_Source_ViewModel
.
SourceType
),
model
.
SourceType
},
{
nameof
(
RB_Course_Source_ViewModel
.
SourceUrl
),
model
.
SourceUrl
},
{
nameof
(
RB_Course_Source_ViewModel
.
SourceSize
),
model
.
SourceSize
},
{
nameof
(
RB_Course_Source_ViewModel
.
ParentSourceId
),
model
.
ParentSourceId
},
};
flag
=
sourceRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Source_ViewModel
.
SourceId
),
model
.
SourceId
));
}
else
{
var
newId
=
sourceRepository
.
Insert
(
model
);
model
.
SourceId
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 根据编号获取课程资料实体
/// </summary>
/// <param name="SourceId"></param>
/// <returns></returns>
public
RB_Course_Source_ViewModel
GetCourseSourceModule
(
object
SourceId
)
{
return
sourceRepository
.
GetEntity
<
RB_Course_Source_ViewModel
>(
SourceId
);
}
/// <summary>
/// 更新资料共享类型
/// </summary>
/// <param name="SourceId"></param>
/// <param name="ShareType">共享类型</param>
/// <returns></returns>
public
bool
SetCourseSourceShareTypeModule
(
object
SourceId
,
int
ShareType
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_Source_ViewModel
.
ShareType
),
ShareType
},
};
bool
flag
=
sourceRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Source_ViewModel
.
SourceId
),
SourceId
));
return
flag
;
}
/// <summary>
/// 根据编号删除课程资料
/// </summary>
/// <param name="SourceId"></param>
/// <returns></returns>
public
bool
RemoveCourseSourceModule
(
object
SourceId
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_Source_ViewModel
.
Status
),(
int
)
DateStateEnum
.
Delete
},
};
bool
flag
=
sourceRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Source_ViewModel
.
SourceId
),
SourceId
));
return
flag
;
}
/// <summary>
/// 添加修改课程教案
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetTeachPlanModule
(
RB_Course_TeachPlan_ViewModel
model
)
{
bool
flag
;
if
(
model
.
PlanId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_TeachPlan_ViewModel
.
PlanName
),
model
.
PlanName
},
{
nameof
(
RB_Course_TeachPlan_ViewModel
.
ClassBefore
),
model
.
ClassBefore
},
{
nameof
(
RB_Course_TeachPlan_ViewModel
.
ClassIn
),
model
.
ClassIn
},
{
nameof
(
RB_Course_TeachPlan_ViewModel
.
ClassAfter
),
model
.
ClassAfter
},
{
nameof
(
RB_Course_TeachPlan_ViewModel
.
ParentPlanId
),
model
.
ParentPlanId
},
{
nameof
(
RB_Course_TeachPlan_ViewModel
.
SourceUrl
),
model
.
SourceUrl
},
{
nameof
(
RB_Course_TeachPlan_ViewModel
.
PlanFileExtension
),
model
.
PlanFileExtension
},
{
nameof
(
RB_Course_TeachPlan_ViewModel
.
PlanNodeType
),
model
.
PlanNodeType
},
{
nameof
(
RB_Course_TeachPlan_ViewModel
.
ExtUrl
),
model
.
ExtUrl
},
{
nameof
(
RB_Course_TeachPlan_ViewModel
.
Remark
),
model
.
Remark
},
{
nameof
(
RB_Course_TeachPlan_ViewModel
.
IsTop
),
model
.
IsTop
},
};
flag
=
teachPlanRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_TeachPlan_ViewModel
.
PlanId
),
model
.
PlanId
));
}
else
{
var
newId
=
teachPlanRepository
.
Insert
(
model
);
model
.
PlanId
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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