示例#1
0
        /// <summary>
        /// Get the name of customer from an order file
        /// </summary>
        /// <returns>Name of customer or <see cref="null"/></returns>
        public int GetCustomerId()
        {
            // Load the customers
            CustomersHandler customers = IoC.Customers();

            customers.LoadCustomers();

            // Check if any of the lines contain a customer name
            foreach (string line in Lines)
            {
                if (customers.HasCustomerOrderName(line))
                {
                    return(customers.GetCustomerByOrderName(line).Id);
                }
            }

            // If nothing was found, return -1
            return(-1);
        }
示例#2
0
        /// <summary>
        /// Get the name of customer from an order file
        /// </summary>
        /// <returns>Name of customer or <see cref="null"/></returns>
        public int GetCustomerId()
        {
            // Load the customers
            CustomersHandler customers = IoC.Customers();

            customers.LoadCustomers();

            foreach (DataTable table in ExcelData.Tables)
            {
                string CellA1 = table.Rows[0][0].ToString();
                string CellB1 = table.Rows[0][1].ToString();

                if (customers.HasCustomerOrderName(CellA1 + CellB1))
                {
                    return(customers.GetCustomerByOrderName(CellA1 + CellB1).Id);
                }
            }
            return(-1);
        }