@@ -176,7 +176,7 @@ public bool AddPost(Entities.PostText post, string login)
176
176
{
177
177
using ( SqlConnection con = new SqlConnection ( ConnectionString ) )
178
178
{
179
- SqlCommand command = new SqlCommand ( "SELECT Post_Title, Post_Id FROM dbo.Posts WHERE User_Name = @Name" , con ) ;
179
+ SqlCommand command = new SqlCommand ( "SELECT Post_Title, Post_Id FROM dbo.Posts WHERE User_Name = @Name ORDER BY Time DESC " , con ) ;
180
180
command . Parameters . Add ( new SqlParameter ( "@Name" , user ) ) ;
181
181
con . Open ( ) ;
182
182
var reader = command . ExecuteReader ( ) ;
@@ -392,7 +392,7 @@ public bool AddComment(Entities.Comment comment)
392
392
{
393
393
using ( SqlConnection con = new SqlConnection ( ConnectionString ) )
394
394
{
395
- SqlCommand command = new SqlCommand ( "SELECT Post_ID, User_Name, Comment_ID, Text, Time FROM dbo.Comments WHERE Post_ID = CAST(@Post_ID AS NVARCHAR(36)) ORDER BY Time" , con ) ;
395
+ SqlCommand command = new SqlCommand ( "SELECT Post_ID, User_Name, Comment_ID, Text, Time FROM dbo.Comments WHERE Post_ID = CAST(@Post_ID AS NVARCHAR(36)) ORDER BY Time DESC " , con ) ;
396
396
command . Parameters . Add ( new SqlParameter ( "@Post_ID" , Post_ID ) ) ;
397
397
con . Open ( ) ;
398
398
var reader = command . ExecuteReader ( ) ;
@@ -417,7 +417,7 @@ public bool AddComment(Entities.Comment comment)
417
417
{
418
418
using ( SqlConnection con = new SqlConnection ( ConnectionString ) )
419
419
{
420
- SqlCommand command = new SqlCommand ( "SELECT Post_Id, Comment_ID, Text, Time FROM dbo.Comments WHERE User_Name = @Name ORDER BY Time" , con ) ;
420
+ SqlCommand command = new SqlCommand ( "SELECT Post_Id, Comment_ID, Text, Time FROM dbo.Comments WHERE User_Name = @Name ORDER BY Time DESC " , con ) ;
421
421
command . Parameters . Add ( new SqlParameter ( "@Name" , name ) ) ;
422
422
con . Open ( ) ;
423
423
var reader = command . ExecuteReader ( ) ;
@@ -463,7 +463,7 @@ public bool DeleteCommentById(Guid id)
463
463
{
464
464
using ( SqlConnection con = new SqlConnection ( ConnectionString ) )
465
465
{
466
- SqlCommand command = new SqlCommand ( "SELECT Login, E_mail, Title FROM dbo.Users, dbo.Roles WHERE Users.Role_Id = Roles.Id" , con ) ;
466
+ SqlCommand command = new SqlCommand ( "SELECT Login, E_mail, Title FROM dbo.Users, dbo.Roles WHERE Users.Role_Id = Roles.Id ORDER BY Login " , con ) ;
467
467
con . Open ( ) ;
468
468
var reader = command . ExecuteReader ( ) ;
469
469
while ( reader . Read ( ) )
@@ -708,7 +708,7 @@ public bool AddAvatar(Entities.Avatar avatar)
708
708
{
709
709
using ( SqlConnection con = new SqlConnection ( ConnectionString ) )
710
710
{
711
- SqlCommand command = new SqlCommand ( "SELECT Post_Title, Post_Id FROM dbo.Posts" , con ) ;
711
+ SqlCommand command = new SqlCommand ( "SELECT Post_Title, Post_Id FROM dbo.Posts ORDER BY Time DESC " , con ) ;
712
712
con . Open ( ) ;
713
713
var reader = command . ExecuteReader ( ) ;
714
714
0 commit comments