public virtual void AddNewEntity()
        {
            Console.Clear();

            ShowMessage("Creating new entity");

            var category = new Category();

            try
            {
                Console.WriteLine("Name:");
                category.Name = Console.ReadLine();

                Console.WriteLine("IsActive:");
                category.IsActive = Convert.ToBoolean(Console.ReadLine());

                Console.WriteLine("CategoryGroupId:");
                category.CategoryGroupId = Convert.ToInt32(Console.ReadLine());

                _unitOfWork.CategoryRepository.Add(category);
                _unitOfWork.SaveChanges();
                ShowSuccessMessage("Entity created successfully");
            }
            catch (Exception)
            {
                ShowErrorMessage("Something wrong with data");
            }
            finally
            {
                var entitiesPage = new CategoriesPage();
                entitiesPage.Init();
            }
        }
Esempio n. 2
0
        public virtual void ShowEntities()
        {
            var categoryPage = new CategoriesPage();

            categoryPage.Init();
        }
Esempio n. 3
0
        public void ShowCategories()
        {
            var categoryPage = new CategoriesPage();

            categoryPage.Init();
        }