title: Too many If statements?
body: <p>I have a class that reads in text from a spreadsheet using EPPlus. It works and it does exactly what I want it to do but I feel the way I did it is bad practice but for the life of me I cant figure out an alternative that is less hard coded and uses less if statements.
  the class contains constants such as </p>
  
  <pre><code>private static string configUserName;
  private static string configPassword;
  private static string configUrl;
  private static string configDatabase;
  //etc
  </code></pre>
  
  <p>There are about 40 of these. The class loops through a spread sheet reading all the values checking which value it is like:</p>
  
  <pre><code>int i = 1;
  object isRow = currentWorksheet.Cells[i, 1].Value;
  while (isRow != null)
  {
  if (isRow.ToString().Trim().Equals("change_bank_details_policy"))
       {
          if (currentWorksheet.Cells[i, 2].Value != null)
          {
           change_bank_details_policy =c currentWorksheet.Cells[i,2].Value.ToString().Trim();
          }
       }
  else if //etc 40 more if statements
  </code></pre>
  
  <p>Then because the values are private there are 40 methods such as </p>
  
  <pre><code>public static string GetConfigUserName()
      {
          return configUserName;
      }
  </code></pre>
  
  <p>There must be a better way to do this?
  the spreadsheet looks like</p>
  
  <pre><code>change_bank_details_policy,11459676
  change_DD_date_policy,11441975
  [40 more rows....]
  </code></pre>