-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDbEntry.cs
More file actions
43 lines (35 loc) · 1.15 KB
/
DbEntry.cs
File metadata and controls
43 lines (35 loc) · 1.15 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
using System;
using System.Collections.Generic;
using System.Text;
namespace CityDBTest
{
public class City : DbEntry
{
public int Id { get; set; }
public string Name { get; set; }
public string CountryCode { get; set; }
public string District { get; set; }
public int Population { get; set; }
public override string FullInfo
{
get { return $"{Id.ToString().PadLeft(5)} | {Name.PadRight(20)} | {CountryCode.PadLeft(4)} | {District.PadRight(15)} | {Population.ToString().PadLeft(15)}"; }
}
}
public class Grid : DbEntry
{
public int GridID { get; set; }
public int ColumnNum { get; set; }
public int RowNum { get; set; }
public int EntryNum { get; set; }
public override string FullInfo
{
get { return $"{GridID.ToString().PadLeft(5, '0')} | {ColumnNum} | {RowNum} | {EntryNum}"; }
}
}
public abstract class DbEntry
{
//Every entry in the database must have an id and
//build a FullInfo property to be read
public abstract string FullInfo { get; }
}
}