public void ClearSearch(string type)
        {
            switch (type)
            {
            case "checklist":
                SearchChecklistText = string.Empty;
                Checklists.Clear();
                _checklistRepository.All().ForEach(c => Checklists.Add(c));
                break;

            case "customer":
                SearchCustomerText = string.Empty;
                Customers.Clear();
                _customerRepository.All().ForEach(c => Customers.Add(c));
                break;

            case "parkinglot":
                SearchLocationText = string.Empty;
                ParkingLots.Clear();
                _parkingLotRepository.All().ForEach(p => ParkingLots.Add(p));
                break;
            }

            SelectFirstComboBoxItem();
        }
Beispiel #2
0
        public void Add()
        {
            var checklist = ChecklistRepository.Add(ChecklistName);

            Checklists.Add(checklist);
            // After creation, hide checklist selection screen and show actual checklist and map.
        }
Beispiel #3
0
        public async void AddCheckList(Checklist c)
        {
            var r = await toDoService.AddToDoGroupAsync(c);

            if (r)
            {
                Checklists.Add(c);
            }
        }
 public void Search(string listType)
 {
     if (listType == "checklist")
     {
         Checklists.Clear();
         _checklistRepository.All()
         .Where(c =>
                c.Name.ToLower().Contains(SearchChecklistText.ToLower()) ||
                c.Remarks.ToLower().Contains(SearchChecklistText.ToLower())
                ).ToList().ForEach(c => Checklists.Add(c));
     }
     else if (listType == "parkinglot")
     {
         ParkingLots.Clear();
         _parkingLotRepository.All()
         .Where(p =>
                p.Address.City.ToLower().Contains(SearchLocationText.ToLower()) ||
                p.Address.Country.ToLower().Contains(SearchLocationText.ToLower()) ||
                p.Address.ZipCode.ToLower().Contains(SearchLocationText.ToLower()) ||
                p.Address.Street.ToLower().Contains(SearchLocationText.ToLower())
                ).ToList().ForEach(p => ParkingLots.Add(p));
         SelectFirstComboBoxItem();
     }
     else if (listType == "customer")
     {
         Customers.Clear();
         _customerRepository.All()
         .Where(c =>
                c.Name.ToLower().Contains(SearchCustomerText.ToLower()) ||
                c.Email.ToLower().Contains(SearchCustomerText.ToLower()) ||
                c.Contact.ToLower().Contains(SearchCustomerText.ToLower()) ||
                c.PhoneNumber.ToLower().Contains(SearchCustomerText.ToLower()) ||
                c.Address.Street.ToLower().Contains(SearchCustomerText.ToLower()) ||
                c.Address.ZipCode.ToLower().Contains(SearchCustomerText.ToLower()) ||
                c.Address.City.ToLower().Contains(SearchCustomerText.ToLower()) ||
                c.Address.Country.ToLower().Contains(SearchCustomerText.ToLower())
                ).ToList().ForEach(c => Customers.Add(c));
     }
     SelectFirstComboBoxItem();
 }
 public async void AddChecklist(Checklist checklist)
 {
     await _toDoService.AddToDoGroupAsync(checklist);
     Checklists.Add(checklist);
 }