-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathData.cs
More file actions
45 lines (36 loc) · 1.04 KB
/
Data.cs
File metadata and controls
45 lines (36 loc) · 1.04 KB
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
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace ProcessSchedulerProyect
{
class Data
{
public static List<ProcessClass> Processes = new List<ProcessClass>();
public static void addProcess(ProcessClass process)
{
Processes.Add(process);
Helper.saveProcess(Processes);
}
public static void deleteProcess(int index)
{
Processes.RemoveAt(index);
Helper.saveProcess(Processes);
}
public static int getNextID()
{
if (Processes.Count == 0) return 0;
return Processes[Processes.Count - 1].id + 1;
}
public static int getIDForUser(string loginID)
{
foreach (ProcessClass process in Processes)
{
if (process.Name == loginID) return process.id;
}
return -1;
}
}
}