Rhomaios 2 년 전
부모
커밋
0a30d9f4e4

BIN
.vs/Reconstruction/v17/.suo


BIN
.vs/slnx.sqlite


+ 19 - 5
Reconstruction/Functions/LoggedUser/Display.cs

@@ -1,4 +1,5 @@
 using Reconstruction;
+using System.Collections.ObjectModel;
 
 namespace Reconstruction.Functions
 { 
@@ -34,13 +35,26 @@ namespace Reconstruction.Functions
 
         public static void ShowAvailableTask()
         {
+            ObservableCollection<Task> TaskCollection = new ObservableCollection<Task>(Service.db.Tasks.ToList());
 
-            Console.WriteLine("Title:");
-            Service.db.Tasks.Where  (t => t.StatusId == 1).ToList()
-                            .ForEach(t => global::System.Console.Write("\nTitle: "       + t.Title       + 
-                                                                       "\nDescription: " + t.Description + 
-                                                                       "\nCreated by " + Service.db.Users.Where(u => t.CreatorUserId == u.Id).DefaultIfEmpty());
+            foreach (Task t in TaskCollection)
+            {
+                User user = (User)Service.db.Users.Where(u => u.Id == t.CreatorUserId).SingleOrDefault();
+
+                if(user == null)
+                {
+                    user.Login = "No user attached";
+                }
+
+                if(t.StatusId == 1)
+                {
+                    Console.WriteLine("Title: " + t.Title +
+                                      "\nDescription: " + t.Description +
+                                      "\nCreated by " + user.Login + "\n");
+                }
 
+
+            }
             Console.ReadKey();
         }
 

+ 1 - 0
Reconstruction/Program.cs

@@ -45,6 +45,7 @@ while(Service.IsLoggedIn == true)
             }
         case 3:
             {
+                Display.ShowAvailableTask();
                 break;
             }
         case 4:

BIN
Reconstruction/bin/Debug/net6.0/Reconstruction.dll


BIN
Reconstruction/bin/Debug/net6.0/Reconstruction.pdb


BIN
Reconstruction/bin/Debug/net6.0/ref/Reconstruction.dll


BIN
Reconstruction/obj/Debug/net6.0/Reconstruction.assets.cache


BIN
Reconstruction/obj/Debug/net6.0/Reconstruction.dll


BIN
Reconstruction/obj/Debug/net6.0/Reconstruction.pdb


BIN
Reconstruction/obj/Debug/net6.0/ref/Reconstruction.dll