Database

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MTP_UManager
{
static class Database
{
public static bool CheckIfUserExist(string username, string password) /**/
{
if (/*Query from database is*/ true)
if ((username == "Yui") && (password == "12345"))
return true;
else
return false;
}
public static string[] GetTheUserFromDatabase(string username,
out List<string> coursesUserTook, out List<string> coursesUserSee, out List<string> coursesUserEnded)
{
//TO REWRITE
string[] arrayWasGotFromDatabase = new string[]
{
username,
"student"
};
coursesUserSee = new List<string> { "1", "2", "3" };
coursesUserTook = new List<string> { "1" };
coursesUserEnded = new List<string> { "2" };
return arrayWasGotFromDatabase;
}
}
}