Пример #1
0
        public UsersPage()
        {
            _unitOfWork = DependencyInjectorDAL.Resolve <IUnitOfWork>();
            users       = _unitOfWork.UserRepository.GetAllAsync().Result;

            foreach (var user in users)
            {
                buttons.Add(new Button
                {
                    Text            = ToString(user),
                    Entity          = user,
                    ButtonAction    = ShowEntity,
                    AbilityToChange = false,
                    BackgroundColor = ConsoleColor.DarkYellow
                });
            }

            buttons.Add(new Button
            {
                Text            = "Add new entity",
                ButtonAction    = AddNewEntity,
                AbilityToChange = false,
                BackgroundColor = ConsoleColor.DarkYellow
            });
            buttons.Add(new Button
            {
                Text            = "<-- back to Tables' Page",
                ButtonAction    = BackToTablesPage,
                AbilityToChange = false,
                BackgroundColor = ConsoleColor.DarkYellow
            });
        }
        public CategoryGroupsPage()
        {
            _unitOfWork = DependencyInjectorDAL.Resolve <IUnitOfWork>();
            categories  = _unitOfWork.CategoryRepository.GetAllAsync().Result;

            foreach (var category in categories)
            {
                buttons.Add(new Button
                {
                    Text            = ToString(category),
                    Entity          = category,
                    ButtonAction    = ShowEntity,
                    AbilityToChange = false,
                    BackgroundColor = ConsoleColor.DarkYellow
                });
            }

            buttons.Add(new Button
            {
                Text            = "Add new entity",
                ButtonAction    = AddNewEntity,
                AbilityToChange = false,
                BackgroundColor = ConsoleColor.DarkYellow
            });
            buttons.Add(new Button
            {
                Text            = "<-- back to Tables' Page",
                ButtonAction    = BackToTablesPage,
                AbilityToChange = false,
                BackgroundColor = ConsoleColor.DarkYellow
            });
        }
Пример #3
0
        public RolePage(Role role)
        {
            this.role   = role;
            _unitOfWork = DependencyInjectorDAL.Resolve <IUnitOfWork>();


            buttons.Add(new Button {
                Text = role.ConvertToString(), ButtonAction = NullAction
            });
            buttons.Add(new Button {
                Text = "Edit entity", ButtonAction = EditEntity
            });
            buttons.Add(new Button {
                Text = "Delete entity", ButtonAction = DeleteEntity
            });
            buttons.Add(new Button {
                Text = "<-- back to entities", ButtonAction = ShowEntities
            });
        }
Пример #4
0
        public UserPage(User user)
        {
            this.user   = user;
            _unitOfWork = DependencyInjectorDAL.Resolve <IUnitOfWork>();


            buttons.Add(new Button {
                Text = user.ConvertToString(), ButtonAction = NullAction
            });
            buttons.Add(new Button {
                Text = "Edit entity", ButtonAction = EditEntity
            });
            buttons.Add(new Button {
                Text = "Delete entity", ButtonAction = DeleteEntity
            });
            buttons.Add(new Button {
                Text = "<-- back to entities", ButtonAction = ShowEntities
            });
        }
Пример #5
0
        public CategoryPage(Category category)
        {
            this.category = category;
            _unitOfWork   = DependencyInjectorDAL.Resolve <IUnitOfWork>();


            buttons.Add(new Button {
                Text = category.ConvertToString(), ButtonAction = NullAction
            });
            buttons.Add(new Button {
                Text = "Edit entity", ButtonAction = EditEntity
            });
            buttons.Add(new Button {
                Text = "Delete entity", ButtonAction = DeleteEntity
            });
            buttons.Add(new Button {
                Text = "<-- back to entities", ButtonAction = ShowEntities
            });
        }