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
e2006729
Commit
e2006729
authored
Dec 09, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
16993d3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
5 deletions
+38
-5
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+38
-5
No files found.
Edu.Module.Course/ClassModule.cs
View file @
e2006729
...
@@ -552,8 +552,14 @@ namespace Edu.Module.Course
...
@@ -552,8 +552,14 @@ namespace Edu.Module.Course
extModel
.
ClassPlanId
=
newId
;
extModel
.
ClassPlanId
=
newId
;
flag
=
newId
>
0
;
flag
=
newId
>
0
;
}
}
class_TimeRepository
.
DeleteClassTimeByPlanIdRepository
(
extModel
.
ClassPlanId
);
var
oldPlanList
=
class_TimeRepository
.
GetClassTimeListRepository
(
new
RB_Class_Time_ViewModel
()
if
(
extModel
.
PlanTimeList
!=
null
&&
extModel
.
PlanTimeList
.
Count
>
0
)
{
ClassId
=
extModel
.
ClassId
,
ClassPlanId
=
extModel
.
ClassPlanId
,
});
//原来没有计划
if
(
oldPlanList
==
null
||
(
oldPlanList
!=
null
&&
oldPlanList
.
Count
==
0
))
{
{
foreach
(
var
item
in
extModel
.
PlanTimeList
)
foreach
(
var
item
in
extModel
.
PlanTimeList
)
{
{
...
@@ -561,14 +567,41 @@ namespace Edu.Module.Course
...
@@ -561,14 +567,41 @@ namespace Edu.Module.Course
item
.
ClassPlanId
=
extModel
.
ClassPlanId
;
item
.
ClassPlanId
=
extModel
.
ClassPlanId
;
item
.
Group_Id
=
extModel
.
Group_Id
;
item
.
Group_Id
=
extModel
.
Group_Id
;
item
.
School_Id
=
extModel
.
School_Id
;
item
.
School_Id
=
extModel
.
School_Id
;
if
(
item
.
ClassTimeId
>
0
)
item
.
ClassTimeId
=
0
;
flag
=
class_TimeRepository
.
Insert
(
item
)
>
0
;
}
}
//以前有计划
else
{
//现在没有设置时间【直接删除以前的时间】
if
(
extModel
.
PlanTimeList
==
null
||
(
extModel
.
PlanTimeList
!=
null
&&
extModel
.
PlanTimeList
.
Count
==
0
))
{
class_TimeRepository
.
DeleteClassTimeByPlanIdRepository
(
extModel
.
ClassPlanId
);
}
//找出差异的数据
var
deleteList
=
oldPlanList
.
Where
(
qitem
=>
!
extModel
.
PlanTimeList
.
Any
(
oldItem
=>
qitem
.
ClassTimeId
==
oldItem
.
ClassTimeId
)).
ToList
();
foreach
(
var
dItem
in
deleteList
)
{
if
(
dItem
.
ClassTimeId
>
0
)
{
{
flag
=
class_TimeRepository
.
Update
(
item
);
class_TimeRepository
.
Delete
(
dItem
.
ClassTimeId
);
}
}
else
}
foreach
(
var
item
in
extModel
.
PlanTimeList
)
{
item
.
ClassId
=
extModel
.
ClassId
;
item
.
ClassPlanId
=
extModel
.
ClassPlanId
;
item
.
Group_Id
=
extModel
.
Group_Id
;
item
.
School_Id
=
extModel
.
School_Id
;
if
(
item
.
ClassTimeId
==
0
)
{
{
flag
=
class_TimeRepository
.
Insert
(
item
)
>
0
;
flag
=
class_TimeRepository
.
Insert
(
item
)
>
0
;
}
}
else
{
flag
=
class_TimeRepository
.
Update
(
item
);
}
}
}
}
}
return
flag
;
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