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
8fd0bae0
Commit
8fd0bae0
authored
Dec 02, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增实体类
parent
16a877e4
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
187 additions
and
4 deletions
+187
-4
RB_Course.cs
Edu.Model/Entity/Course/RB_Course.cs
+47
-2
RB_Course_StepPrice.cs
Edu.Model/Entity/Course/RB_Course_StepPrice.cs
+33
-0
RB_Course_StepPrice_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_StepPrice_ViewModel.cs
+15
-0
RB_Course_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_ViewModel.cs
+6
-0
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+33
-2
RB_Course_StepPriceRepository.cs
Edu.Repository/Course/RB_Course_StepPriceRepository.cs
+53
-0
No files found.
Edu.Model/Entity/Course/RB_Course.cs
View file @
8fd0bae0
...
...
@@ -72,13 +72,58 @@ namespace Edu.Model.Entity.Course
public
DateStateEnum
Status
{
get
;
set
;
}
/// <summary>
/// 教师编号
/// 教师编号
[逗号分隔]
/// </summary>
public
int
Teacher_Id
{
get
;
set
;
}
public
string
Teacher_Ids
{
get
;
set
;
}
/// <summary>
/// 是否显示章节编号
/// </summary>
public
int
IsShowChapterNo
{
get
;
set
;
}
/// <summary>
/// 课程特色
/// </summary>
public
string
CourseFeature
{
get
;
set
;
}
/// <summary>
/// 原价
/// </summary>
public
decimal
OriginalPrice
{
get
;
set
;
}
/// <summary>
/// 售价
/// </summary>
public
decimal
SellPrice
{
get
;
set
;
}
/// <summary>
/// 是否开启阶梯定价(1-开启)
/// </summary>
public
int
IsOpenStepPrice
{
get
;
set
;
}
/// <summary>
/// 是否可续费课程(1-是)
/// </summary>
public
int
IsRenew
{
get
;
set
;
}
/// <summary>
/// 续费原价
/// </summary>
public
decimal
RenewOgPrice
{
get
;
set
;
}
/// <summary>
/// 续费售价
/// </summary>
public
decimal
RenewSlPrice
{
get
;
set
;
}
/// <summary>
/// 上架端口(1-内部销售,2-学员App,3-网课端)
/// </summary>
public
string
Saleplat
{
get
;
set
;
}
/// <summary>
/// 是否是K12课程(1-是)
/// </summary>
public
int
IsKCourse
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/Entity/Course/RB_Course_StepPrice.cs
0 → 100644
View file @
8fd0bae0
using
System
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Course
{
/// <summary>
/// 课程阶梯价格实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Course_StepPrice
{
/// <summary>
/// 主键
/// </summary>
public
int
CoursePriceId
{
get
;
set
;
}
/// <summary>
/// 课程编号
/// </summary>
public
int
CourseId
{
get
;
set
;
}
/// <summary>
/// 人数
/// </summary>
public
int
PersionNum
{
get
;
set
;
}
/// <summary>
/// 售价
/// </summary>
public
decimal
SellPrice
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Course_StepPrice_ViewModel.cs
0 → 100644
View file @
8fd0bae0
using
Edu.Model.Entity.Course
;
namespace
Edu.Model.ViewModel.Course
{
/// <summary>
/// 课程阶梯价格扩展实体类
/// </summary>
public
class
RB_Course_StepPrice_ViewModel
:
RB_Course_StepPrice
{
/// <summary>
/// 课程编号
/// </summary>
public
string
QCourseIds
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Course_ViewModel.cs
View file @
8fd0bae0
using
Edu.Common
;
using
System
;
using
System.Collections.Generic
;
namespace
Edu.Model.ViewModel.Course
{
...
...
@@ -38,5 +39,10 @@ namespace Edu.Model.ViewModel.Course
/// 分类编号【查询使用】
/// </summary>
public
string
QCateIds
{
get
;
set
;
}
/// <summary>
/// 课程阶梯价格列表
/// </summary>
public
List
<
RB_Course_StepPrice_ViewModel
>
StepPriceList
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.Course/CourseModule.cs
View file @
8fd0bae0
...
...
@@ -62,6 +62,11 @@ namespace Edu.Module.Course
/// </summary>
private
readonly
CourseCategoryModule
courseCategoryModule
=
new
CourseCategoryModule
();
/// <summary>
/// 课程阶梯价格仓储层对象
/// </summary>
private
readonly
RB_Course_StepPriceRepository
course_StepPriceRepository
=
new
RB_Course_StepPriceRepository
();
#
region
课程管理
/// <summary>
...
...
@@ -109,7 +114,7 @@ namespace Edu.Module.Course
/// 新增修改课程
/// </summary>
/// <returns></returns>
public
bool
SetCourseModule
(
RB_Course_ViewModel
model
)
public
virtual
bool
SetCourseModule
(
RB_Course_ViewModel
model
)
{
bool
flag
;
if
(
model
.
CourseId
>
0
)
...
...
@@ -120,6 +125,18 @@ namespace Edu.Module.Course
{
nameof
(
RB_Course_ViewModel
.
CourseName
),
model
.
CourseName
},
{
nameof
(
RB_Course_ViewModel
.
CourseIntro
),
model
.
CourseIntro
},
{
nameof
(
RB_Course_ViewModel
.
CateId
),
model
.
CateId
},
{
nameof
(
RB_Course_ViewModel
.
UpdateBy
),
model
.
UpdateBy
},
{
nameof
(
RB_Course_ViewModel
.
UpdateTime
),
model
.
UpdateTime
},
{
nameof
(
RB_Course_ViewModel
.
Teacher_Ids
),
model
.
Teacher_Ids
},
{
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
.
IsRenew
),
model
.
IsRenew
},
{
nameof
(
RB_Course_ViewModel
.
RenewOgPrice
),
model
.
RenewOgPrice
},
{
nameof
(
RB_Course_ViewModel
.
RenewSlPrice
),
model
.
RenewSlPrice
},
{
nameof
(
RB_Course_ViewModel
.
Saleplat
),
model
.
Saleplat
},
{
nameof
(
RB_Course_ViewModel
.
IsKCourse
),
model
.
IsKCourse
},
};
flag
=
courseRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_ViewModel
.
CourseId
),
model
.
CourseId
));
}
...
...
@@ -128,6 +145,20 @@ namespace Edu.Module.Course
var
newId
=
courseRepository
.
Insert
(
model
);
model
.
CourseId
=
newId
;
flag
=
newId
>
0
;
}
if
(
model
.
IsOpenStepPrice
==
1
)
{
if
(
model
.
StepPriceList
!=
null
&&
model
.
StepPriceList
.
Count
>
0
)
{
foreach
(
var
item
in
model
.
StepPriceList
)
{
course_StepPriceRepository
.
Insert
(
item
);
}
}
}
else
{
}
return
flag
;
}
...
...
@@ -158,7 +189,7 @@ namespace Edu.Module.Course
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_ViewModel
.
Teacher_Id
),
Teacher_Id
},
{
nameof
(
RB_Course_ViewModel
.
Teacher_Id
s
),
Teacher_Id
},
};
bool
flag
=
courseRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_ViewModel
.
CourseId
),
CourseId
));
return
flag
;
...
...
Edu.Repository/Course/RB_Course_StepPriceRepository.cs
0 → 100644
View file @
8fd0bae0
using
Edu.Model.Entity.Course
;
using
Edu.Model.ViewModel.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Edu.Repository.Course
{
/// <summary>
/// 课程阶梯价格仓储层
/// </summary>
public
class
RB_Course_StepPriceRepository
:
BaseRepository
<
RB_Course_StepPrice
>
{
/// <summary>
/// 获取课程阶梯价格列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Course_StepPrice_ViewModel
>
GetCourseStepPriceListRepository
(
RB_Course_StepPrice_ViewModel
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
@"
SELECT *
FROM RB_Course_StepPrice
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
CourseId
>
0
)
{
builder
.
AppendFormat
(
@" AND {0}={1} "
,
nameof
(
RB_Course_StepPrice_ViewModel
.
CourseId
),
query
.
CourseId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QCourseIds
))
{
builder
.
AppendFormat
(
@" AND {0} IN({1}) "
,
nameof
(
RB_Course_StepPrice_ViewModel
.
CourseId
),
query
.
QCourseIds
);
}
}
return
Get
<
RB_Course_StepPrice_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 根据课程编号删除课程阶梯价格
/// </summary>
/// <param name="CourseId"></param>
/// <returns></returns>
public
bool
DeleteStepPriceRepository
(
int
CourseId
)
{
bool
flag
=
base
.
DeleteOne
(
new
VT
.
FW
.
DB
.
WhereHelper
(
nameof
(
RB_Course_StepPrice_ViewModel
.
CourseId
),
CourseId
));
return
flag
;
}
}
}
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