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
0e32762c
Commit
0e32762c
authored
Jan 26, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
cde9b8a0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
QuestionModule.cs
Edu.Module.Question/QuestionModule.cs
+4
-2
RB_QuestionRepository.cs
Edu.Repository/Question/RB_QuestionRepository.cs
+1
-1
QuestionController.cs
Edu.WebApi/Controllers/Course/QuestionController.cs
+4
-1
No files found.
Edu.Module.Question/QuestionModule.cs
View file @
0e32762c
...
@@ -213,9 +213,11 @@ namespace Edu.Module.Question
...
@@ -213,9 +213,11 @@ namespace Edu.Module.Question
[
TransactionCallHandler
]
[
TransactionCallHandler
]
public
virtual
bool
UpdateQuestionSortModule
(
int
curQId
,
int
targetQId
)
public
virtual
bool
UpdateQuestionSortModule
(
int
curQId
,
int
targetQId
)
{
{
var
currentModel
=
GetQuestionModule
(
curQId
);
var
targetModel
=
GetQuestionModule
(
targetQId
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
{
nameof
(
RB_Question_ViewModel
.
SortNum
),
target
QId
},
{
nameof
(
RB_Question_ViewModel
.
SortNum
),
target
Model
.
SortNum
},
};
};
bool
flag
=
questionRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Question_ViewModel
.
QuestionId
),
curQId
));
bool
flag
=
questionRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Question_ViewModel
.
QuestionId
),
curQId
));
if
(
flag
)
if
(
flag
)
...
@@ -223,7 +225,7 @@ namespace Edu.Module.Question
...
@@ -223,7 +225,7 @@ namespace Edu.Module.Question
//排序修改
//排序修改
Dictionary
<
string
,
object
>
fileds2
=
new
Dictionary
<
string
,
object
>()
Dictionary
<
string
,
object
>
fileds2
=
new
Dictionary
<
string
,
object
>()
{
{
{
nameof
(
RB_Question_ViewModel
.
SortNum
),
cur
QId
},
{
nameof
(
RB_Question_ViewModel
.
SortNum
),
cur
rentModel
.
SortNum
},
};
};
flag
=
questionRepository
.
Update
(
fileds2
,
new
WhereHelper
(
nameof
(
RB_Question_ViewModel
.
QuestionId
),
targetQId
));
flag
=
questionRepository
.
Update
(
fileds2
,
new
WhereHelper
(
nameof
(
RB_Question_ViewModel
.
QuestionId
),
targetQId
));
}
}
...
...
Edu.Repository/Question/RB_QuestionRepository.cs
View file @
0e32762c
...
@@ -93,7 +93,7 @@ WHERE 1=1 ");
...
@@ -93,7 +93,7 @@ WHERE 1=1 ");
{
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Question_ViewModel
.
Category
),
query
.
QCategoryId
);
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Question_ViewModel
.
Category
),
query
.
QCategoryId
);
}
}
builder
.
AppendFormat
(
" ORDER BY A.{0}
DESC "
,
nameof
(
RB_Question_ViewModel
.
QuestionId
));
builder
.
AppendFormat
(
" ORDER BY A.{0}
ASC "
,
nameof
(
RB_Question_ViewModel
.
SortNum
));
return
GetPage
<
RB_Question_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
return
GetPage
<
RB_Question_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
}
...
...
Edu.WebApi/Controllers/Course/QuestionController.cs
View file @
0e32762c
...
@@ -172,6 +172,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -172,6 +172,7 @@ namespace Edu.WebApi.Controllers.Course
}
}
var
list
=
questionModule
.
GetQuestionPageListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
var
list
=
questionModule
.
GetQuestionPageListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
List
<
object
>
resultList
=
new
List
<
object
>();
List
<
object
>
resultList
=
new
List
<
object
>();
int
index
=
1
;
foreach
(
var
item
in
list
)
foreach
(
var
item
in
list
)
{
{
if
(
item
.
CreateBy
>
0
)
if
(
item
.
CreateBy
>
0
)
...
@@ -195,6 +196,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -195,6 +196,7 @@ namespace Edu.WebApi.Controllers.Course
}
}
resultList
.
Add
(
new
resultList
.
Add
(
new
{
{
Number
=(
pageModel
.
PageIndex
-
1
)*
pageModel
.
PageSize
+
index
,
item
.
QuestionId
,
item
.
QuestionId
,
item
.
CourseId
,
item
.
CourseId
,
Title
=
newTitle
,
Title
=
newTitle
,
...
@@ -207,6 +209,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -207,6 +209,7 @@ namespace Edu.WebApi.Controllers.Course
item
.
CategoryName
,
item
.
CategoryName
,
DifficultyTypeName
=
item
.
DifficultyType
.
ToName
(),
DifficultyTypeName
=
item
.
DifficultyType
.
ToName
(),
});
;
});
;
index
++;
}
}
pageModel
.
Count
=
rowsCount
;
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
resultList
;
pageModel
.
PageData
=
resultList
;
...
@@ -705,7 +708,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -705,7 +708,7 @@ namespace Edu.WebApi.Controllers.Course
copyModel
.
UpdateBy
=
base
.
UserInfo
.
Id
;
copyModel
.
UpdateBy
=
base
.
UserInfo
.
Id
;
copyModel
.
UpdateTime
=
DateTime
.
Now
;
copyModel
.
UpdateTime
=
DateTime
.
Now
;
}
}
var
flag
=
false
;
var
flag
=
questionModule
.
SetQuestionModule
(
copyModel
)
;
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
else
else
...
...
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