//tutaj private static string builderLine(DataCustomer data, ArrayList fields) { string flagS = "none"; float flag = -1; StringBuilder sb = new StringBuilder(); for (int i = 0; i < fields.Count; i++) { switch (fields[i]) { case "Customer": if (data.getCustomer() != flagS) { sb.Append(data.getCustomer() + ","); } else { sb.Append(","); } break; case "Product": if (data.getProduct() != flagS) { sb.Append(data.getProduct() + ","); } else { sb.Append(","); } break; case "Price": if (data.getPrice() != flag) { sb.Append(data.getPrice() + ","); } else { sb.Append(","); } break; case "Quantity": if (data.getQuantity() != flag) { sb.Append(data.getQuantity() + ","); } else { sb.Append(","); } break; case "Cost": if (data.getCost() != flag) { sb.Append(data.getCost() + ","); } else { sb.Append(","); } break; case "Total Amount": if (data.getAmount() != flag) { sb.Append(data.getAmount() + ","); } else { sb.Append(","); } break; case "Invoice Number": if (data.getInvoice() != flag) { sb.Append(data.getInvoice() + ","); } else { sb.Append(","); } break; default: Console.WriteLine("BUilder line Unknown field" + fields[i]); break; } } return(sb.ToString()); }
public Customer GetCustomer(int id) { DataCustomer customerDb = new DataCustomer(); return(customerDb.getCustomer(id)); }