Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
3663b676
Commit
3663b676
authored
Apr 26, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增考核项 排序
parent
2961ff5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
performance/Performance.Repository/BaseRepository.cs
+6
-0
performance/Performance.Services/AssessService.cs
+9
-0
No files found.
performance/Performance.Repository/BaseRepository.cs
View file @
3663b676
...
@@ -74,6 +74,12 @@ public bool Update(TEntity entity)
...
@@ -74,6 +74,12 @@ public bool Update(TEntity entity)
return
context
.
SaveChanges
()
>
0
;
return
context
.
SaveChanges
()
>
0
;
}
}
public
bool
UpdateRange
(
params
TEntity
[]
entities
)
{
context
.
Set
<
TEntity
>().
UpdateRange
(
entities
);
return
context
.
SaveChanges
()
>
0
;
}
public
bool
Update
(
TEntity
entity
,
Action
<
TEntity
>
action
)
public
bool
Update
(
TEntity
entity
,
Action
<
TEntity
>
action
)
{
{
action
?.
Invoke
(
entity
);
action
?.
Invoke
(
entity
);
...
...
performance/Performance.Services/AssessService.cs
View file @
3663b676
...
@@ -158,6 +158,15 @@ public ApiResponse AddColumn(int assessID, int parentID, string columnName, int
...
@@ -158,6 +158,15 @@ public ApiResponse AddColumn(int assessID, int parentID, string columnName, int
var
centity
=
perforAscolumnsRepository
.
GetEntity
(
t
=>
t
.
ID
==
parentID
);
var
centity
=
perforAscolumnsRepository
.
GetEntity
(
t
=>
t
.
ID
==
parentID
);
if
(
centity
==
null
)
if
(
centity
==
null
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"考核项目父级ID无效"
);
return
new
ApiResponse
(
ResponseType
.
Fail
,
"考核项目父级ID无效"
);
var
clist
=
perforAscolumnsRepository
.
GetEntities
(
t
=>
t
.
ParentID
==
parentID
&&
t
.
AssessID
==
assessID
&&
t
.
Sort
>=
sort
);
if
(
clist
!=
null
)
{
clist
.
ForEach
(
t
=>
t
.
Sort
=
t
.
Sort
+
1
);
perforAscolumnsRepository
.
UpdateRange
(
clist
.
ToArray
());
}
var
model
=
new
as_columns
{
AssessID
=
assessID
,
ParentID
=
parentID
,
ColumnName
=
columnName
,
Sort
=
sort
};
var
flag
=
perforAscolumnsRepository
.
Add
(
model
);
return
flag
?
new
ApiResponse
(
ResponseType
.
OK
,
model
)
:
new
ApiResponse
(
ResponseType
.
Fail
);
}
}
var
column
=
new
as_columns
{
AssessID
=
assessID
,
ParentID
=
parentID
,
ColumnName
=
columnName
,
Sort
=
sort
};
var
column
=
new
as_columns
{
AssessID
=
assessID
,
ParentID
=
parentID
,
ColumnName
=
columnName
,
Sort
=
sort
};
var
result
=
perforAscolumnsRepository
.
Add
(
column
);
var
result
=
perforAscolumnsRepository
.
Add
(
column
);
...
...
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