-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMedicalCentre.cs
49 lines (42 loc) · 1.27 KB
/
MedicalCentre.cs
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
46
47
48
49
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
namespace medConvert
{
class MedicalCentre
{
public static List<MedicalCentre> Centres = new List<MedicalCentre>();
public long Id { get; set; }
public string FullName { get; private set; }
public string Location { get; private set; }
public string Vid { get; private set; }
public string Type { get; private set; }
public List<Rate> Rates { get; private set; } = new List<Rate>();
public static void SaveAll()
{
foreach (var centre in Centres)
{
centre.Save();
}
}
void Save()
{
this.Id = DBWriter.InsertCenter(this);
DBWriter.InsertRates(this);
}
public MedicalCentre(string fullName, string city, string type, string vid)
{
this.FullName = fullName;
this.Location = city;
this.Type = type;
this.Vid = vid;
Debug.WriteLine(this);
Centres.Add(this);
}
override public string ToString()
{
return $"{this.FullName} - {this.Location}";
}
}
}