Example #1
0
 public void RenameCategoryAction(CategoryDto category)
 {
     if (!category.Renaming)
     {
         category.Renaming = true;
         category.OldName  = category.Name;
     }
     else
     {
         category.Renaming = false;
         NavigationViewItems.RenameMenuItem(category.OldName, category.Name);
         RestClient.UpdateCategory(category);
     }
 }
Example #2
0
 private void InitializeSessions(bool show, IList <ISessionService> items)
 {
     for (int i = 0; i < NavigationViewItems.Count; i++)
     {
         if (NavigationViewItems[i] is ISessionService)
         {
             NavigationViewItems.RemoveAt(i);
             i--;
         }
         else if (NavigationViewItems[i] is Controls.NavigationViewItem viewItem && string.Equals(viewItem.Name, NavigationAdd))
         {
             NavigationViewItems.RemoveAt(i);
             i--;
         }
Example #3
0
        private void InitializeUser(MainViewModel viewModel)
        {
            for (int i = 0; i < NavigationViewItems.Count; i++)
            {
                if (NavigationViewItems[i] is MainViewModel)
                {
                    NavigationViewItems.RemoveAt(i);
                    i--;
                }
            }

            if (viewModel != null)
            {
                NavigationViewItems.Insert(0, viewModel);
            }
        }
Example #4
0
        // Deze functie zorgt ervoor dat bij navigeren steeds het juiste incoontje geselecteerd is
        private void AdjustSelectedItem()
        {
            var current = CurrentData.GetType().ToString().ToLower();

            if (current.Contains("establishment"))
            {
                current = "merchants";
            }
            else if (current.Contains("login") || current.Contains("registration"))
            {
                current = "account";
            }
            else if (current.Contains("panel") || current.Contains("add") || current.Contains("edit"))
            {
                current = "panel";
            }

            SelectedItem = NavigationViewItems.SingleOrDefault(n => current.Contains(n.Tag.ToString().ToLower()));
        }
Example #5
0
        public void AddCategoryAction()
        {
            int id          = Categories.Last().Id + 1;
            var newCategory = new CategoryDto {
                Id = id, Name = NewCategory.Name, Description = NewCategory.Description, StateType = NewCategory.StateType
            };

            RestClient.AddCategory(newCategory);
            Categories.Add(newCategory);
            NavigationViewItems.AddMenuItem(newCategory);


            int taskId  = AllTasks.Last().Id + 1;
            var newTask = new TaskDto {
                Id = taskId, Name = "TO-DO 1", Description = "", State = 0, DeadlineDate = DateTime.Now, ScheduledDate = DateTime.Now, ParentId = newCategory.Id
            };

            RestClient.AddTask(newTask);
            AllTasks.Add(newTask);
            Categories.Where(n => n.Id == newCategory.Id).First().Tasks.Add(newTask);

            taskId  = AllTasks.Last().Id + 1;
            newTask = new TaskDto {
                Id = taskId, Name = "TO-DO 2", Description = "", State = 0, DeadlineDate = DateTime.Now, ScheduledDate = DateTime.Now, ParentId = newCategory.Id
            };
            RestClient.AddTask(newTask);
            AllTasks.Add(newTask);
            Categories.Where(n => n.Id == newCategory.Id).First().Tasks.Add(newTask);

            taskId  = AllTasks.Last().Id + 1;
            newTask = new TaskDto {
                Id = taskId, Name = "TO-DO 3", Description = "", State = 0, DeadlineDate = DateTime.Now, ScheduledDate = DateTime.Now, ParentId = newCategory.Id
            };
            RestClient.AddTask(newTask);
            AllTasks.Add(newTask);
            Categories.Where(n => n.Id == newCategory.Id).First().Tasks.Add(newTask);


            NewCategory.Name        = String.Empty;
            NewCategory.Description = String.Empty;
        }
Example #6
0
 // Verwijderen van het handelaar paneel icoontje in de navigatiebalk
 public void RemoveMerchantPanelNavigationViewItem() => NavigationViewItems.Remove(NavigationViewItems.SingleOrDefault(n => n.Tag.ToString() == "Panel"));
Example #7
0
 // Toevoegen van het handelaar paneel icoontje aan de navigatiebalk
 public void AddMerchantPanelNavigationViewItem() => NavigationViewItems.Add(new NavigationViewItem()
 {
     Icon = new SymbolIcon(Symbol.PreviewLink), Content = "Mijn overzicht", Tag = "Panel"
 });
Example #8
0
 // Verwijderen van het abonnement icoontje in de navigatiebalk
 public void RemoveSubscriptionNavigationViewItem() => NavigationViewItems.Remove(NavigationViewItems.SingleOrDefault(n => n.Tag.ToString() == "Subscription"));
Example #9
0
 // Toevoegen van het abonnement icoontje aan de navigatiebalk
 public void AddSubscriptionNavigationViewItem() => NavigationViewItems.Add(new NavigationViewItem()
 {
     Icon = new SymbolIcon(Symbol.Read), Content = "Abonnementen", Tag = "Subscription"
 });
Example #10
0
 public void HideCategory(bool hide, string name)
 {
     NavigationViewItems.HideMenuItem(hide, name);
 }
Example #11
0
 public void SaveCategoryAction(CategoryDto category)
 {
     RestClient.UpdateCategory(category);
     NavigationViewItems.ChangeTag(category.Name, category.StateType.ToString());
 }
Example #12
0
 public void DeleteCategoryAction(CategoryDto category)
 {
     RestClient.DeleteCategory(category);
     Categories.Remove(category);
     NavigationViewItems.DeleteMenuItem(category.Name);
 }