Ejemplo n.º 1
0
 public HotelDataSet.CustomerRow getCustomerByName(String name)
 {
     HotelDataSet.CustomerDataTable table = customerTableAdapter.GetCustomerByName(name);
     if (table.Rows.Count == 1)
     {
         return(table[0]);
     }
     return(null);
 }
Ejemplo n.º 2
0
        public List <String> getCustomersWithBalance(String filter)
        {
            filter = filter.ToLower();
            List <String> customers = new List <String>();

            HotelDataSet.CustomerDataTable table = customerTableAdapter.GetWithOutstandingBalance();
            foreach (HotelDataSet.CustomerRow row in table.Rows)
            {
                if (filter.Length == 0)
                {
                    customers.Add(row.Name);
                }
                else
                {
                    if (row.Name.ToLower().Contains(filter))
                    {
                        customers.Add(row.Name);
                    }
                }
            }
            return(customers);
        }
Ejemplo n.º 3
0
        public List <String> getCustomerNames(String filter)
        {
            List <String> names = new List <String>();

            if (filter.Length > 0)
            {
                HotelDataSet.CustomerDataTable table = customerTableAdapter.GetCustomerByName("%" + filter + "%");
                foreach (HotelDataSet.CustomerRow row in table.Rows)
                {
                    names.Add(row.Name);
                }
            }
            else
            {
                HotelDataSet.CustomerDataTable table = customerTableAdapter.GetData();
                foreach (HotelDataSet.CustomerRow row in table.Rows)
                {
                    names.Add(row.Name);
                }
            }
            return(names);
        }