Esempio n. 1
0
        public virtual void AddNewEntity()
        {
            Console.Clear();

            ShowMessage("Creating new entity");

            var role = new Role();

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

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

            rolePage.Init();
        }
Esempio n. 3
0
        public void ShowRoles()
        {
            var rolePage = new RolesPage();

            rolePage.Init();
        }