public static int GetCustomerID(string customerName, LoadCustomerNameFromDBDelegate loadCustomerNameFromDBDelegate)
        {
            SqlConnection connection = new SqlConnection(ConnectionString);

            connection.Open();

            int result = loadCustomerNameFromDBDelegate(connection, customerName);

            connection.Close();
            return(result);
        }
示例#2
0
        public int GetCustomerID(string customerName)
        {
            LoadCustomerNameFromDBDelegate delegateInstance = new LoadCustomerNameFromDBDelegate(PerformGetCustomerByID);

            return(CustomerRepository.GetCustomerID(customerName, delegateInstance));
        }