public static int getCustomerId(string firstName, string lastName, string phone) { int customerId = 4; DataTable table; adapter = getNewAdapter(); table = adapter.GetDataBy(lastName, firstName, phone); adapter.Dispose(); customerId = (int)table.Select()[0].ItemArray[0]; return(customerId); }
public static bool hasCustomer(string firstName, string lastName, string phone) { bool hasId; DataTable table; adapter = getNewAdapter(); table = adapter.GetDataBy(lastName, firstName, phone); adapter.Dispose(); hasId = table.Select().Length > 0; return(hasId); }