Ejemplo n.º 1
0
 public ExercisesController(IWorkoutService workoutService, IExerciseService exerciseService,
                            IOwnedAuthService ownedAuthService)
 {
     _workoutService   = workoutService;
     _exerciseService  = exerciseService;
     _ownedAuthService = ownedAuthService;
 }
Ejemplo n.º 2
0
        public void Initialize()
        {
            var container = new UnityContainer();

            Bootstrapper.Register(container);
            _service = container.Resolve <IExerciseService>();
        }
Ejemplo n.º 3
0
 public ResultsController(IResultService results, IQuestionService questions, IExerciseService exercises, IStateService state)
 {
     _results   = results;
     _questions = questions;
     _exercises = exercises;
     _state     = state;
 }
Ejemplo n.º 4
0
 public EducationService(IExerciseService exerciseService, ICourseCategoryService courseService, IJournalEntryService journalEntryService, IUnitOfWorkFactory unitOfWorkFactory)
 {
     _exerciseService = exerciseService;
     _courseService = courseService;
     _journalEntryService = journalEntryService;
     _systemUnitOfWork = unitOfWorkFactory.CreateSystem();
 }
Ejemplo n.º 5
0
        public async Task <IActionResult> CreateExerciseSubmissionAsync([FromServices] IExerciseService exerciseService, int labId, int slotId, int exerciseId, int userId, DateTime submissionTime, bool passed, int weight)
        {
            try
            {
                // Create submission
                var submission = new ExerciseSubmission
                {
                    ExerciseId     = exerciseId,
                    UserId         = userId,
                    ExercisePassed = passed,
                    SubmissionTime = submissionTime,
                    Weight         = passed ? 1 : weight
                };
                await exerciseService.CreateExerciseSubmissionAsync(submission, HttpContext.RequestAborted);

                AddStatusMessage(_localizer["CreateExerciseSubmissionAsync:Success"], StatusMessageTypes.Success);
            }
            catch (InvalidOperationException ex)
            {
                _logger.LogError(ex, "Create exercise submission");
                AddStatusMessage(_localizer["CreateExerciseSubmissionAsync:UnknownError"], StatusMessageTypes.Error);
            }

            return(await RenderAsync(labId, slotId));
        }
Ejemplo n.º 6
0
 public ApiController(ILabService labService, IExerciseService exerciseService, IUserService userService, ILabExecutionService labExecutionService)
 {
     _labService          = labService ?? throw new ArgumentNullException(nameof(labService));
     _exerciseService     = exerciseService ?? throw new ArgumentNullException(nameof(exerciseService));
     _userService         = userService ?? throw new ArgumentNullException(nameof(userService));
     _labExecutionService = labExecutionService ?? throw new ArgumentNullException(nameof(labExecutionService));
 }
Ejemplo n.º 7
0
 public frmEditSchedule(Schedule schedule)
 {
     InitializeComponent();
     exerciseService = InstanceFactory.GetInstance <IExerciseService>();
     this.schedule   = schedule;
     BlockUnauthorizedViews();
 }
Ejemplo n.º 8
0
 public ExerciseController(IExerciseService exerciseService, IHubContext <ExerciseHub> exerciseHub, INotificationService notificationService, IAuthorizationService authorizationService)
 {
     _exerciseService      = exerciseService;
     _exerciseHub          = exerciseHub;
     _notificationService  = notificationService;
     _authorizationService = authorizationService;
 }
Ejemplo n.º 9
0
        public ExerciseHub(IExerciseService service, INotificationService notificationService)
        {
            _exerciseService     = service;
            _notificationService = notificationService;
            CancellationTokenSource source = new CancellationTokenSource();

            _ct = source.Token;
        }
Ejemplo n.º 10
0
 public ExerciseController(IHttpContextAccessor httpContextAccessor, IExerciseService exerciseService, IUserExerciseService userExerciseService, IUserGroupService roleService, IJwtHandler jwtHandler)
 {
     _httpContextAccessor = httpContextAccessor;
     _exerciseService     = exerciseService;
     _userExerciseService = userExerciseService;
     _roleService         = roleService;
     _jwtHandler          = jwtHandler;
 }
Ejemplo n.º 11
0
 public frmAddExercise(Schedule schedule, Exercise exercise = null)
 {
     InitializeComponent();
     this.exercise   = exercise;
     this.schedule   = schedule;
     exerciseService = InstanceFactory.GetInstance <IExerciseService>();
     partService     = InstanceFactory.GetInstance <IPartService>();
 }
Ejemplo n.º 12
0
 public ManagerController(IMapper mapper, IExerciseService exerciseService, IWorkoutInformationService workoutInformationService, IWeekScheduleService weekScheduleService, IModelViewFactory modelViewFactory)
 {
     this.mapper                    = mapper ?? throw new ArgumentException("Mapper cannot be null");
     this.exerciseService           = exerciseService ?? throw new ArgumentException("exerciseService cannot be null");
     this.workoutInformationService = workoutInformationService ?? throw new ArgumentException("workoutInformationService cannot be null");
     this.weekScheduleService       = weekScheduleService ?? throw new ArgumentException("weekScheduleService cannot be null");
     this.modelViewFactory          = modelViewFactory ?? throw new ArgumentException("modelViewFactory cannot be null");
 }
Ejemplo n.º 13
0
 public AdminExercisesController(IUserService userService, IStringLocalizer <AdminExercisesController> localizer, ILogger <AdminExercisesController> logger, IExerciseService exerciseService, ILabService labService)
     : base("~/Views/AdminExercises.cshtml", userService)
 {
     _localizer       = localizer ?? throw new ArgumentNullException(nameof(localizer));
     _logger          = logger ?? throw new ArgumentNullException(nameof(logger));
     _exerciseService = exerciseService ?? throw new ArgumentNullException(nameof(exerciseService));
     _labService      = labService ?? throw new ArgumentNullException(nameof(labService));
 }
Ejemplo n.º 14
0
 public HomeController(IExerciseService exerciseService, IExerciseTypeService exerciseTypeService, SignInManager <CustomIdentityUser> signInManager, ITrainerService trainerService, IBlogPostService blogPostService)
 {
     _exerciseService     = exerciseService;
     _exerciseTypeService = exerciseTypeService;
     _signInManager       = signInManager;
     _trainerService      = trainerService;
     _blogPostService     = blogPostService;
 }
Ejemplo n.º 15
0
 public ExercisesController(
     IExerciseService ExerciseService,
     IMapper mapper,
     IOptions <AppSettings> appSettings)
 {
     _ExerciseService = ExerciseService;
     _mapper          = mapper;
     _appSettings     = appSettings.Value;
 }
Ejemplo n.º 16
0
        public ExerciseController(IExerciseService svc)
        {
            if (svc == null)
            {
                throw new ArgumentNullException("svc");
            }

            _exerciseService = svc;
        }
Ejemplo n.º 17
0
        public SummaryController(ISummaryService summaryService,
                                 IExerciseService exerciseService,
                                 ITrainingService trainingService)

        {
            _summaryService  = summaryService;
            _exerciseService = exerciseService;
            _trainingService = trainingService;
        }
Ejemplo n.º 18
0
 public WorkoutsController(
     ICurrentUserService currentUser,
     IBus publisher,
     IExerciseService exerciseService)
 {
     this.currentUser     = currentUser;
     this.publisher       = publisher;
     this.exerciseService = exerciseService;
 }
Ejemplo n.º 19
0
        private void CreateExerciseService(BaseBundle savedInstance)
        {
            var exerciseState = savedInstance?.GetString(SavedExerciseStateKey, string.Empty);

            // Create the exercise service
            mExerciseService = ExerciseService.ExerciseServiceFromString(exerciseState, new ExerciseConfiguration(), new TimerService(), mExerciseTrackerService);

            mExerciseService.ExerciseChanged          += ExerciseServiceOnExerciseChanged;
            mExerciseService.ActiveSubExerciseChanged += ExerciseServiceOnActiveSubExerciseChanged;
            mExerciseService.StateChanged             += ExerciseServiceOnStateChanged;
        }
Ejemplo n.º 20
0
 public TaskController(
     IExerciseService exerciseService,
     ILevelService levelService,
     IQuestionService questionService,
     UserManager <ApplicationUser> userManager)
 {
     _exerciseService = exerciseService;
     _levelService    = levelService;
     _questionService = questionService;
     _userManager     = userManager;
 }
Ejemplo n.º 21
0
        public ServiceFactory(IRepositoryFactory repositoryFactory, IMapperFactory mapperFactory, IUserProvider userProvider)
        {
            _userProvider = userProvider;
            var account = _userProvider.Account;

            Account                = new ApplicationUserService(repositoryFactory, mapperFactory);
            Muscle                 = new MuscleService(repositoryFactory, mapperFactory, account);
            Workout                = new WorkoutService(repositoryFactory, mapperFactory, account);
            WorkoutSession         = new WorkoutSessionService(repositoryFactory, mapperFactory, account);
            WorkoutSessionExercise = new WorkoutSessionExerciseService(repositoryFactory, mapperFactory, account);
            Exercise               = new ExerciseService(repositoryFactory, mapperFactory, Muscle, account);
        }
Ejemplo n.º 22
0
        public Base()
        {
            var assembly = Assembly.Load("Sfiss.ExerciseApiService");

            Assert.That(assembly, Is.Not.Null);
            UnityContainer = new UnityContainer();
            RegisterServices(UnityContainer, assembly);

            UnityContainer.RegisterInstance(typeof(IConnectionStringConfiguration), new ConnectionStringResolver());

            ExerciseService = UnityContainer.Resolve <IExerciseService>();
        }
Ejemplo n.º 23
0
        public ExerciseManagementViewModel(IExerciseService exerciseService,
                                           IDialogViewService dialogService)
        {
            this.exerciseService = exerciseService ?? throw new ArgumentNullException("Service must be provided.");
            this.dialogService   = dialogService ?? throw new ArgumentNullException("Dialog service must be provided.");

            AddExerciseCommand      = new RelayCommand(AddExercise, () => true);
            DeleteExerciseCommand   = new RelayCommand(DeleteExercise, () => SelectedExercise != null);
            EditExerciseCommand     = new RelayCommand(EditExercise, () => SelectedExercise != null);
            SelectExerciseCommand   = new RelayCommand(SelectExercise, () => SelectedExercise != null);
            FindCommand             = new RelayCommand(Find, true);
            PracticeExerciseCommand = new RelayCommand(() => PracticeExercise(), () => true);
        }
Ejemplo n.º 24
0
 public AdminController(IExerciseService exerciseService, IExerciseTypeService exerciseTypeService, IHostingEnvironment hostingEnvironment, ISupplementCategoryService supplementCategoryService, ISupplementService supplementService, ISupplementSubCategoryService supplementSubCategoryService, ITrainerService trainerService, IBlogPostService blogPostService, UserManager <CustomIdentityUser> userManager, CustomIdentityContext customIdentityContext, IOrderLineService orderLineService)
 {
     _exerciseService              = exerciseService;
     _exerciseTypeService          = exerciseTypeService;
     _hostingEnvironment           = hostingEnvironment;
     _supplementCategoryService    = supplementCategoryService;
     _supplementService            = supplementService;
     _supplementSubCategoryService = supplementSubCategoryService;
     _trainerService        = trainerService;
     _blogPostService       = blogPostService;
     _userManager           = userManager;
     _customIdentityContext = customIdentityContext;
     _orderLineService      = orderLineService;
 }
Ejemplo n.º 25
0
 public ApiController(
     IAnswerService answerService, 
     IExerciseService exerciseService, 
     IObjectiveService objectiveService, 
     IStudentService studentService,
     IStudentAnswerService studentAnswerService,
     IStudentDeviationsService studentDeviationService)
 {
     _answerService = answerService;
     _exerciseService = exerciseService;
     _objectiveService = objectiveService;
     _studentService = studentService;
     _studentAnswerService = studentAnswerService;
     _studentDeviationService = studentDeviationService;
 }
        public UpdateTrainingExercisesRequestValidator(IExerciseService exerciseService)
        {
            RuleForEach(x => x.Exercises)
            .GreaterThan(0);

            RuleFor(x => x.Exercises)
            .ForEach(arrayRule => {
                arrayRule.Must(element => element > 0).WithMessage("Podano błędną listę ćwiczeń");
            })
            .DependentRules(() => {
                RuleFor(x => x.Exercises)
                .Must(ids => exerciseService.AllExercisesExists(ids))
                .WithMessage("Podano błędną listę ćwiczeń");
            });
        }
Ejemplo n.º 27
0
        public void AddExercise()
        {
            var options = new DbContextOptionsBuilder <ExerciseContext>()
                          .UseInMemoryDatabase(databaseName: "Add_writes_to_database")
                          .Options;

            using (var context = new ExerciseContext(options))
            {
                _exerciseService = new ExerciseService(context);
                Assert.AreEqual(1, _exerciseService.InsertExercise(new Exercise()
                {
                    Name = "test"
                }));
            }
        }
Ejemplo n.º 28
0
 public EprService(
     IVitalSignsService vitalSignsService,
     IPhysicalExamService physicalExamService,
     IDietService dietService,
     IExerciseService exerciseService,
     ITreatmentService treatmentService,
     IMedicalRecordService medicalRecordService)
 {
     _vitalSignsService    = vitalSignsService;
     _physicalExamService  = physicalExamService;
     _dietService          = dietService;
     _exerciseService      = exerciseService;
     _treatmentService     = treatmentService;
     _medicalRecordService = medicalRecordService;
 }
        public PhpBotController(IChatBotService chatBotService, IChatSessionService chatSessionService, IExerciseService exerciseService) : base(chatBotService, chatSessionService)
        {
            _ruleSet = RuleSetFactory.GetRuleSet("phpCourseRuleSet");

            _chatBotName     = "PhpChatBot";
            _relativeRoute   = "/api/php-bot";
            _exerciseService = exerciseService;

            AddRuleSet(RuleSetFactory.GetRuleSet("jokeRuleSet"));
            AddRuleSet(RuleSetFactory.GetRuleSet("greetingsRuleSet"));
            AddRuleSet(RuleSetFactory.GetRuleSet("goodbyeRuleSet"));

            _chatBot = new RestChatBot(_ruleSet.Rules);
            _chatBot.AddExerciseService(_exerciseService);
        }
 public WorkoutController(ILoggerFactory logger,
                          IMapper mapper,
                          IWorkoutService workoutService,
                          IExerciseService exerciseService,
                          UserManager <User> userManager,
                          IWorkoutRepository workoutRepository,
                          IChallengeService challengeService)
 {
     _logger            = logger.CreateLogger <WorkoutController>();
     _mapper            = mapper;
     _workoutService    = workoutService;
     _exerciseService   = exerciseService;
     _userManager       = userManager;
     _workoutRepository = workoutRepository;
     _challengeService  = challengeService;
 }
Ejemplo n.º 31
0
        public async Task <IActionResult> DeleteExerciseSubmissionsAsync([FromServices] IExerciseService exerciseService, int labId, int slotId, List <int> submissionIds)
        {
            try
            {
                // Delete submissions
                await exerciseService.DeleteExerciseSubmissionsAsync(submissionIds, HttpContext.RequestAborted);

                AddStatusMessage(_localizer["DeleteExerciseSubmissionsAsync:Success"], StatusMessageTypes.Success);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Delete exercise submissions");
                AddStatusMessage(_localizer["DeleteExerciseSubmissionsAsync:UnknownError"], StatusMessageTypes.Error);
            }

            return(await RenderAsync(labId, slotId));
        }
Ejemplo n.º 32
0
 public OpdRecordController(
     IVitalSignsService vitalSignsService,
     IPhysicalExamService physicalExamService,
     IDietService dietService,
     IExerciseService exerciseService,
     ITreatmentService treatmentService,
     IEprService eprService,
     IPatientInfoService patientInfoService,
     IMedicalRecordService medicalRecordService)
 {
     _vitalSignsService    = vitalSignsService;
     _physicalExamService  = physicalExamService;
     _dietService          = dietService;
     _exerciseService      = exerciseService;
     _treatmentService     = treatmentService;
     _eprService           = eprService;
     _patientInfoService   = patientInfoService;
     _medicalRecordService = medicalRecordService;
 }
Ejemplo n.º 33
0
 public ExerciseController(IExerciseService exerciseService)
 {
     _exerciseService = exerciseService;
 }
 public DashboardController(IExerciseService exerciseService)
 {
     this.exerciseService = exerciseService;
 }