|
@@ -1,4 +1,5 @@
|
|
using Reconstruction;
|
|
using Reconstruction;
|
|
|
|
+using System.Collections.ObjectModel;
|
|
|
|
|
|
namespace Reconstruction.Functions
|
|
namespace Reconstruction.Functions
|
|
{
|
|
{
|
|
@@ -34,13 +35,26 @@ namespace Reconstruction.Functions
|
|
|
|
|
|
public static void ShowAvailableTask()
|
|
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();
|
|
Console.ReadKey();
|
|
}
|
|
}
|
|
|
|
|