Hello all, this is my first post.
I am selecting some fields from a database which are numeric id values e.g. 10,20,100,110 etc. These numbers actually mean something meaningful such as area. Ideally there should be a look up database table with matching ID and name field but there isnt and it has now become difficult to implement in a reasonable timescale (politics).
I currently use a cumbesome switch function to check the id and return the relevent text.
private string GetUnitName(string areaid)
{
string areaName = string.Empty;
switch (areaid.Trim())
{
case "10":
areaName = "area 1";
break;
case "20":
areaName = "area 2";
break;
case "30":
areaName = "area 3";
break;
}
return areaName ;
}
I cant get them in a dateabse so what is the best way to store these area strings?
Can I group them in a settings file or something?
Thanks for listening