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();
            }
        }
Ejemplo n.º 2
0
        public virtual void ShowEntities()
        {
            var categoryPage = new CategoriesPage();

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

            categoryPage.Init();
        }