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();
        }
Exemple #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.
        }
Exemple #3
0
 public void Delete()
 {
     SelectedChecklist.IsDeleted   = true;
     SelectedChecklist.DateDeleted = DateTime.Now;
     Checklists.Remove(SelectedChecklist);
     SelectedChecklist = null;
     // Save changes to database
     // Don't allow switching from this screen until another checklist is selected
 }
        public async void AddCheckList(Checklist c)
        {
            var r = await toDoService.AddToDoGroupAsync(c);

            if (r)
            {
                Checklists.Add(c);
            }
        }
        public override void OnEnter()
        {
            if (Settings.IsOfflineMode)
            {
                MessageBox.Show("Dit scherm is niet beschikbaar in offline mode.");

                _router.GoBack();
                return;
            }

            if (_isEditing)
            {
                _isEditing = false;
                return;
            }

            if (ViewBag?.Task != null)
            {
                SelectedTask = ViewBag.Task;
            }
            else
            {
                SelectedTask = new Task
                {
                    Inspections   = new List <Inspection>(),
                    TaskSchedules = new List <TaskSchedule>(),
                    DateTimeStart = DateTime.Today,
                    Hash          = MD5.Crypt($"{DateTime.Now.ToLongDateString()}-{SelectedTask?.GetHashCode()}")
                };

                EndDate          = DateTime.Today.AddDays(1);
                IsRepeating      = false;
                CanEditStartDate = true;
            }

            if (SelectedTask.Remarks == null)
            {
                SelectedTask.Remarks = "";
            }

            SelectedTask.TaskSchedules.ToList().ForEach(t => TaskSchedules.Add(t));

            Customers.Clear();
            ParkingLots.Clear();
            Checklists.Clear();

            StartDate = DateTime.Today;
            EndDate   = DateTime.Today.AddDays(1);

            _customerRepository.All().ForEach(Customers.Add);
            _checklistRepository.All().ForEach(Checklists.Add);
            _parkingLotRepository.All().ForEach(ParkingLots.Add);

            CalculateInspectionDates();
            SelectFirstComboBoxItem();
        }
Exemple #6
0
 public bool DeepEquals(DestinyCharacterProgressionComponent?other)
 {
     return(other is not null &&
            Progressions.DeepEqualsDictionary(other.Progressions) &&
            Factions.DeepEqualsDictionary(other.Factions) &&
            Milestones.DeepEqualsDictionary(other.Milestones) &&
            Quests.DeepEqualsList(other.Quests) &&
            UninstancedItemObjectives.DeepEqualsDictionaryNaive(other.UninstancedItemObjectives) &&
            UninstancedItemPerks.DeepEqualsDictionary(other.UninstancedItemPerks) &&
            Checklists.DeepEqualsDictionaryNaive(other.Checklists) &&
            (SeasonalArtifact is not null ? SeasonalArtifact.DeepEquals(other.SeasonalArtifact) : other.SeasonalArtifact is null));
 }
        /// <inheritdoc />
        /// <summary>
        /// CTOR - Initialize window/dialog and loads the checklists from solution directory
        /// Sets the DataContext to <see cref="P:net.adamec.dev.vs.extension.radprojects.ui.checklists.ChecklistsDialogWindow.Checklists" />, starts the command prompt in console and
        /// retrieves the initial version/git information
        /// </summary>
        /// <param name="solutionInfo">Solution information</param>
        public ChecklistsDialogWindow(SolutionInfo solutionInfo)
        {
            SolutionInfo = solutionInfo;
            Checklists   = Checklists.Load(solutionInfo.SolutionDir);

            InitializeComponent();

            DataContext            = Checklists;
            Console.OnProcessExit += Console_OnProcessExit;
            StartCmd();
            RefreshInfo();
        }
        public void Apply(OnAssesmentChecklistAdded aggregateEvent)
        {
            if (Checklists == null)
            {
                Checklists = new List <AssesmentChecklist>();
            }

            var list = Checklists.ToList();

            list.Add(aggregateEvent.AssesmentChecklist);

            Checklists = list;
        }
Exemple #9
0
        public Trello(string key)
        {
            _restClient = new TrelloRestClient(key);

            Members       = new Members(_restClient);
            Boards        = new Boards(_restClient);
            Lists         = new Lists(_restClient);
            Cards         = new Cards(_restClient);
            Checklists    = new Checklists(_restClient);
            Organizations = new Organizations(_restClient);
            Notifications = new Notifications(_restClient);
            Tokens        = new Tokens(_restClient);
            Async         = new AsyncTrello(_restClient);
            Actions       = new Actions(_restClient);
        }
Exemple #10
0
        private void Search()
        {
            Checklists.Clear();

            var search = _repository.All().Select(x => new TemplateChecklistViewModel(x));

            if (!string.IsNullOrWhiteSpace(SearchString))
            {
                search.Where(t => t.Checklist.Name.ToLower().Contains(SearchString.ToLower())).ToList().ForEach(Checklists.Add);
                return;
            }

            search.ToList().ForEach(Checklists.Add);
            RaisePropertyChanged(nameof(Checklists));
        }
Exemple #11
0
 /// <summary>
 /// Create a new generic default checklist named "New checklist".
 /// </summary>
 public void CreateChecklist()
 {
     try
     {
         var newDefaultChecklist = new Checklists()
         {
             Name = "New checklist"
         };
         _dbContext.Checklists.Add(newDefaultChecklist);
         _dbContext.SaveChanges();
     }
     catch
     {
         throw new ArgumentException("Unable to access dbContext.");
     }
 }
Exemple #12
0
 public void Update(DestinyCharacterProgressionComponent?other)
 {
     if (other is null)
     {
         return;
     }
     if (!Progressions.DeepEqualsDictionary(other.Progressions))
     {
         Progressions = other.Progressions;
         OnPropertyChanged(nameof(Progressions));
     }
     if (!Factions.DeepEqualsDictionary(other.Factions))
     {
         Factions = other.Factions;
         OnPropertyChanged(nameof(Factions));
     }
     if (!Milestones.DeepEqualsDictionary(other.Milestones))
     {
         Milestones = other.Milestones;
         OnPropertyChanged(nameof(Milestones));
     }
     if (!Quests.DeepEqualsList(other.Quests))
     {
         Quests = other.Quests;
         OnPropertyChanged(nameof(Quests));
     }
     if (!UninstancedItemObjectives.DeepEqualsDictionary(other.UninstancedItemObjectives))
     {
         UninstancedItemObjectives = other.UninstancedItemObjectives;
         OnPropertyChanged(nameof(UninstancedItemObjectives));
     }
     if (!UninstancedItemPerks.DeepEqualsDictionary(other.UninstancedItemPerks))
     {
         UninstancedItemPerks = other.UninstancedItemPerks;
         OnPropertyChanged(nameof(UninstancedItemPerks));
     }
     if (!Checklists.DeepEqualsDictionary(other.Checklists))
     {
         Checklists = other.Checklists;
         OnPropertyChanged(nameof(Checklists));
     }
     if (!SeasonalArtifact.DeepEquals(other.SeasonalArtifact))
     {
         SeasonalArtifact.Update(other.SeasonalArtifact);
         OnPropertyChanged(nameof(SeasonalArtifact));
     }
 }
Exemple #13
0
        public bool Equals(DestinyProfileProgressionComponent input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Checklists == input.Checklists ||
                     (Checklists != null && Checklists.SequenceEqual(input.Checklists))
                     ) &&
                 (
                     SeasonalArtifact == input.SeasonalArtifact ||
                     (SeasonalArtifact != null && SeasonalArtifact.Equals(input.SeasonalArtifact))
                 ));
        }
 public void Update(DestinyProfileProgressionComponent?other)
 {
     if (other is null)
     {
         return;
     }
     if (!Checklists.DeepEqualsDictionary(other.Checklists))
     {
         Checklists = other.Checklists;
         OnPropertyChanged(nameof(Checklists));
     }
     if (!SeasonalArtifact.DeepEquals(other.SeasonalArtifact))
     {
         SeasonalArtifact.Update(other.SeasonalArtifact);
         OnPropertyChanged(nameof(SeasonalArtifact));
     }
 }
Exemple #15
0
        public Trello(string key, bool createEmptyProxy = false)
        {
            _restClient = new TrelloRestClient(key, createEmptyProxy);

            Members       = new Members(_restClient);
            Boards        = new Boards(_restClient);
            Lists         = new Lists(_restClient);
            Cards         = new Cards(_restClient);
            Checklists    = new Checklists(_restClient);
            Organizations = new Organizations(_restClient);
            Notifications = new Notifications(_restClient);
            Tokens        = new Tokens(_restClient);
            Async         = new AsyncTrello(_restClient);
            Actions       = new Actions(_restClient);
            Advanced      = new Advanced(_restClient);
            Webhooks      = new Webhooks(_restClient);
        }
        public bool Equals(DestinyCharacterProgressionComponent input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Progressions == input.Progressions ||
                     (Progressions != null && Progressions.SequenceEqual(input.Progressions))
                     ) &&
                 (
                     Factions == input.Factions ||
                     (Factions != null && Factions.SequenceEqual(input.Factions))
                 ) &&
                 (
                     Milestones == input.Milestones ||
                     (Milestones != null && Milestones.SequenceEqual(input.Milestones))
                 ) &&
                 (
                     Quests == input.Quests ||
                     (Quests != null && Quests.SequenceEqual(input.Quests))
                 ) &&
                 (
                     UninstancedItemObjectives == input.UninstancedItemObjectives ||
                     (UninstancedItemObjectives != null && UninstancedItemObjectives.SequenceEqual(input.UninstancedItemObjectives))
                 ) &&
                 (
                     UninstancedItemPerks == input.UninstancedItemPerks ||
                     (UninstancedItemPerks != null && UninstancedItemPerks.SequenceEqual(input.UninstancedItemPerks))
                 ) &&
                 (
                     Checklists == input.Checklists ||
                     (Checklists != null && Checklists.SequenceEqual(input.Checklists))
                 ) &&
                 (
                     SeasonalArtifact == input.SeasonalArtifact ||
                     (SeasonalArtifact != null && SeasonalArtifact.Equals(input.SeasonalArtifact))
                 ));
        }
 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();
 }
Exemple #18
0
 /// <summary>
 /// Add a new checklist into the database by passing an already
 /// instantiated checklist in.
 /// </summary>
 /// <param name="checklist">Checklist to pass in</param>
 public void CreateChecklist(Checklists checklist)
 {
     throw new NotImplementedException();
 }
 public bool DeepEquals(DestinyProfileProgressionComponent?other)
 {
     return(other is not null &&
            Checklists.DeepEqualsDictionaryNaive(other.Checklists) &&
            (SeasonalArtifact is not null ? SeasonalArtifact.DeepEquals(other.SeasonalArtifact) : other.SeasonalArtifact is null));
 }
 public async void AddChecklist(Checklist checklist)
 {
     await _toDoService.AddToDoGroupAsync(checklist);
     Checklists.Add(checklist);
 }