From b033365d5ad7a19c89fd389c84d62f2db88039a8 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 12 Apr 2018 22:28:26 +0100 Subject: [PATCH] Add news type enumeration. --- Cicm.Database/Operations/News.cs | 2 +- Cicm.Database/Schemas/News.cs | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Cicm.Database/Operations/News.cs b/Cicm.Database/Operations/News.cs index 2184bd06..c25d29da 100644 --- a/Cicm.Database/Operations/News.cs +++ b/Cicm.Database/Operations/News.cs @@ -284,7 +284,7 @@ namespace Cicm.Database { Id = int.Parse(dataRow["id"].ToString()), Date = dataRow["date"].ToString(), - Type = int.Parse(dataRow["type"].ToString()), + Type = (NewsType)int.Parse(dataRow["type"].ToString()), AffectedId = int.Parse(dataRow["added_id"].ToString()) }; diff --git a/Cicm.Database/Schemas/News.cs b/Cicm.Database/Schemas/News.cs index 6e6a0f67..bb31c143 100644 --- a/Cicm.Database/Schemas/News.cs +++ b/Cicm.Database/Schemas/News.cs @@ -40,6 +40,19 @@ namespace Cicm.Database.Schemas /// ID public int Id; /// News type - public int Type; + public NewsType Type; + } + + public enum NewsType : int + { + NewComputerInDb = 1, + NewConsoleInDb = 2, + NewComputerInCollection = 3, + NewConsoleInCollection = 4, + UpdatedComputerInDb = 5, + UpdatedConsoleInDb = 6, + UpdatedComputerInCollection = 7, + UpdatedConsoleInCollection = 8, + NewMoneyDonation = 9 } } \ No newline at end of file