Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 873121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:53:05+00:00 2026-05-15T10:53:05+00:00

In one of the financial Winform projects , the application code will have to

  • 0

In one of the financial Winform projects , the application code will have to work with values such as currencies. In the object model that represents business entities , there are fields that need to hold currency values such as USD , EUR , etc. The set of values for this field will most probably be limited to one of the standard currencies and rarely will it need to be expanded for new currencies. The application gets the currency inputs from a GUI control that brings these values from another standard source and displays as a dropdown, although it is possible that user inputs a value directly into the control. The application’s logic does not specifically depend on the values of the currency and no special process is performed on these fields directly that demands referring to the actual values contained in the fields.

Now for the question : Is it advisable to use an enumeration , that enumerates values such as USD , EUR and the likes, so that currency values received into the code can be validated against the enumeration ? If not , is it advisable to leave it to the fact that the currency values are input from a dropdown , so that no extra validations be needed in code ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T10:53:06+00:00Added an answer on May 15, 2026 at 10:53 am

    I recommend you create a simple class or event struct for currency, and also create few static readonly members for currently defined currencies:

    class Currency
    {
         public static reaonly IEnumerable<Currency> Currencies = new List<Currency>
         {
             new Currency { Name = "USD", CurrencySign = "$" },
             new Currency { Name = "EUR", CurrencySign = "€" }
         }
    
         public string Name {get; private set;}
    
         public string CurrencySign {get; private set;}
    
         public override ToString() { return Name; }
    }
    

    It allows you to easy extend currency list and extract it from other places then static member, like database or web service without redesing your application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an application that works with financial data that is schemaless. More accurately,
I have an Excel 2010 workbook for financial records. On one worksheet, I have
One has txtDateReceived and second has txtVendorPackDate. Before insert will add record I have
Hi Android developers, Currently i am working on one Financial based chart application, and
I have a (C#) genetic program that uses financial time-series data and it's currently
I want to create a massive TimeSeries object which will hold 1000 different financial
I have written a chart that displays financial data. Performance was good while I
I have produced a report where the user will need to view financial years
I'm trying to construct a query that will map two columns, one, a date
One of the neat characteristics of UTF-8 is that if you compare two strings

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.