Create a model representation C# from this example screenshot

I would like to get some feedback on what is the best way to create a model from this screen representation that I have attached bellow. I created a class GeneralSetupCompanyParame and I'm not sure how I should declare each property that I have circled in yellow in my screenShot. The one for the English,Spanish, French Description...

I'm just looking for the best representation. I started creating my company class, I'm just missing how I will set my property for the English,Spanish and French Description.

 public class GeneralSetupCompanyParameters
    {

         public class SMTPSettings
        {
            public string CommonSMTPSettings { get; set; }
            public string SMTPServer { get; set; }
            public int SMTPPort { get; set; }
        }
        
        public string CountryName { get; set; }

        public string ServiceYear { get; set; }
        public string QuickNote { get; set; }
        public bool AllowFutureSaleDates { get; set; }
        public bool ForcePWComplexity { get; set; }
        public bool AppointmentNotification { get; set; }
        public bool LimitPastSaleDates { get; set; }
        public int LimitPastSaleDatesDay { get; set; }
        public bool ForcePeriodicPWChanges { get; set; }
        public bool LockCallLogEntries { get; set; }
        public string EveryDay { get; set; }
        public bool LimitPastCancelDates { get; set; }
        public string LimitPasCancelDatesDays { get; set; }
        public bool CallLogOutcome { get; set; }
    }
}

Open in new window

yguyon28Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

yguyon28Author Commented:
If there any other comment on how I created my model on something that I did not do correctly please let me know so...
0
Chris StanyonWebDevCommented:
Just a guess really (without knnow more details), but you could create a class that represents a row:

class Language
    bool Use
    int Order
    string English
    string Spanish
    string French

And then add a new property to your GeneralSetupCompanyParameters:

    ICollection<Language> Languages

This list will just be a collection of Language instances:

language = new Language { Use = true, Order = 1, English = "Some Text" ... }
company.Languages.Add(language)
0
it_saigeDeveloperCommented:
Use a list and keep your options, in this list.  You could then have a property in your class which sets the language for all options using an Enum, You could make the Enum flagged so that multiple languages could be supported; e.g. -
class GeneralSetupCompanyParameters
{
	public Language Language { get; set; }
	public List<Option> Options { get; set; }
}

class Option
{
	public bool Active { get; set; }
	public string Name { get; set; }
	public string Description { get; set; }
}

[Flags]
enum Language : int
{
	English = 0,
	Spanish = 1,
	French = 1 << 1
}

Open in new window

If you want to make it so that each 'Option' supports it's own language settings, use an attribute instead of a single class property; e.g. -
class GeneralSetupCompanyParameters
{
	public List<Option> Options { get; set; }
}

[Language(Language = Language.English | Language.French)]
class Option
{
	public bool Active { get; set; }
	public string Name { get; set; }
	public string Description { get; set; }
}

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)]
class LanguageAttribute : Attribute
{
	public Language Language { get; set; }
}

[Flags]
enum Language : int
{
	English = 0,
	Spanish = 1,
	French = 1 << 1
}

Open in new window

-saige-
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yguyon28Author Commented:
Thank you, also do you believe my other properties are declared correctly.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET MVC

From novice to tech pro — start learning today.