private static void selectFunction(string field, string value, DataCustomer data) { int precision = 10; switch (field) { case "Customer": data.setCustomer(value.Trim()); break; case "Product": data.setProduct(value.Trim()); break; case "Price": data.setPrice(roundDigits(value, precision)); break; case "Quantity": data.setQuantity(Int32.Parse(value)); break; case "Cost": data.setCost(roundDigits(value, precision)); break; case "Total Amount": data.setAmount(roundDigits(value, precision)); break; case "Invoice Number": data.setInvoice(Int32.Parse(value)); break; default: Console.WriteLine("Unknown field"); break; } }