public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Shared = this; CommentService.GetInstance().Init(); ParticipantService.GetInstance().Init(); UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false); _window = new UIWindow(UIScreen.MainScreen.Bounds); //UINavigationBar.Appearance.SetTitleTextAttributes (new UITextAttributes { // TextColor = UIColor.Blue //}); var loginViewController = new LoginViewController(); _navigation = new UINavigationController(loginViewController); _navigation.NavigationBar.TintColor = UIColor.Blue; _navigation.NavigationBar.BarTintColor = UIColor.White; _navigation.NavigationBar.Translucent = false; _window.RootViewController = _navigation; _window.MakeKeyAndVisible(); return(true); }
public RaceController(RaceService raceService, GroupService groupService, ParticipantService participantService, TimingValueService timingValueService) { _raceService = raceService; _groupService = groupService; _participantService = participantService; _timingValueService = timingValueService; }
private async Task PopulateGridAsync() { var service = new ParticipantService(new ParticipantRepository()); var items = await service.GetAsync(); Application.Current.Dispatcher.Invoke(() => { ParticipantsGrid.ItemsSource = items; }); }
public void GetQueryable() { ParticipantService participantService = new ParticipantService(fixture.context); IQueryable <Participant> participantQueryable = participantService.GetAll(); Assert.True(participantQueryable.Count() > 0); }
public void CreateFollowUpAnswers() { ParticipantService participantService = new ParticipantService(fixture.context); QuestionService questionService = new QuestionService(fixture.context); AnswerService answerService = new AnswerService(fixture.context); ProjectService projectService = new ProjectService(fixture.context); Project project = projectService.Create("AnswerService_GetFromQuestionExists"); EvaluationService evaluationService = new EvaluationService(fixture.context); Evaluation evaluation = evaluationService.Create("AnswerService_GetFromQuestionExists", project, ""); Participant participant = participantService.Create("CreateFollowUpAnswers_id", evaluation, Organization.All, Role.Facilitator); QuestionTemplateService qts = new QuestionTemplateService(fixture.context); List <Question> questions = questionService.CreateBulk(qts.GetAll().ToList(), evaluation); answerService.Create(participant, questions[0], Severity.High, "test_answer_0", Progression.Workshop); answerService.Create(participant, questions[1], Severity.High, "test_answer_1", Progression.Workshop); answerService.Create(participant, questions[2], Severity.High, "test_answer_2", Progression.Workshop); int nAnswersFollowupBefore = answerService.GetAll().Where(a => (a.Progression.Equals(Progression.FollowUp) && a.Question.Evaluation.Equals(evaluation))).Count(); int nAnswersWorkshop = answerService.GetAll().Where(a => (a.Progression.Equals(Progression.Workshop) && a.Question.Evaluation.Equals(evaluation))).Count(); answerService.CreateFollowUpAnswers(evaluation); int nAnswersFollowup = answerService.GetAll().Where(a => (a.Progression.Equals(Progression.FollowUp) && a.Question.Evaluation.Equals(evaluation))).Count(); Assert.Equal(nAnswersFollowupBefore + nAnswersWorkshop, nAnswersFollowup); }
//private readonly IParticipantService _participantService; //public ParticipantController(IParticipantService participantService) //{ // this._participantService = participantService; //} //public ParticipantController() // : this(new ParticipantService(new ParticipantRepository())) //{ // CacheManager.SetProvider(new CacheProvider()); //} public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context) { context.OwinContext.Response.Headers.Add("Access-Control-Allow-Origin", new[] { "*" }); IParticipantService _participantService = new ParticipantService(new ParticipantRepository()); Participant participantModel = new Participant(); Hash baseCrypt = new Hash(); var user = _participantService.GetParticipant(context.UserName, context.UserName); string password = baseCrypt.GetHash(context.Password, user.Salt, CypherType.SHA512); var participant = _participantService.Authenticate(context.UserName, password, user.Salt); if (participant == null) { context.SetError("invalid_grant", "The user name or password is incorrect."); return; } var identity = new ClaimsIdentity(context.Options.AuthenticationType); identity.AddClaim(new Claim(ClaimTypes.Sid, participant.Id.ToString())); identity.AddClaim(new Claim("sub", context.UserName)); identity.AddClaim(new Claim("role", "user")); identity.AddClaim(new Claim("participant_Id", participant.Id.ToString())); context.Validated(identity); }
public async void List() { var service = new ParticipantService(_config); var result = await service.List(); Assert.NotNull(result); }
private static void ShowParticipants() { var service = new ParticipantService(new ParticipantRepository()); foreach (var item in service.Get(0, 5)) { Console.WriteLine($"{item.Id};{item.FIO};{item.Birthdate.ToShortDateString()};{item.Email};{item.Phone}"); } }
private static async Task ShowParticipantsAsync() { var service = new ParticipantService(new ParticipantRepository()); foreach (ParticipantDTO item in await service.GetAsync(0, 5)) { Console.WriteLine($"{item.Id};{item.FIO};{item.Birthdate.ToShortDateString()};{item.Email};{item.Phone}"); } }
public ServerImpl(AgeCategoryService ageCategoryService, TrialService trialService, UserService userService, ParticipantService participantService) { this._ageCategoryService = ageCategoryService; this._trialService = trialService; this._userService = userService; this._participantService = participantService; this._loggedClients = new Dictionary <string, IServerStreamWriter <Response> >(); }
public IActionResult Info(int id) { var participant = ParticipantService .Include(t => t.User) .Include(t => t.SkillWorkers) .FindById(id); return(View(participant)); }
private void LoadData() { Participant faculty = new Participant() { }; IParticipant facultyObj = new ParticipantService(new Data.WpfDbContext()); ParticipantDetails = new ObservableCollection <Participant>(facultyObj.GetDetails()); }
/// <summary> /// Все участники /// </summary> /// <returns></returns> public IActionResult All() { var model = ParticipantService .Include(t => t.SkillWorkers) .Include(t => t.Projects) .Include(t => t.User) .FindAll(); return(View(model.ToList())); }
public void AddParticipant(object parameter) { Participant participant = new Participant() { Id = id, Name = name, DateOfBirth = dob, Batchid = batchId, CourseRegistered = course, DateOfRegistration = registration }; IParticipant participantObj = new ParticipantService(new Data.WpfDbContext()); participantObj.AddParticipant(participant); }
public AuthService( IHttpContextAccessor contextAccessor, ParticipantService participantService, EvaluationService evaluationService ) { _contextAccessor = contextAccessor; _participantService = participantService; _evaluationService = evaluationService; }
public void GetAzureIdNotExists() { EvaluationService evaluationService = new EvaluationService(_context); Evaluation evaluation = evaluationService.GetAll().First(); ParticipantService participantService = new ParticipantService(_context); string azureUniqueId = "get_azure_unique_id_not_exists"; Assert.Throws <NotFoundInDBException>(() => participantService.GetParticipant(azureUniqueId, evaluation)); }
public Console(IConfiguration configuration, SaveLoad repo, TimingValueService timingValueService, RaceService raceService, ParticipantService participantService, GroupService groupService, CategoryService categoryService, ClassService classService) { _configuration = configuration; _repo = repo; _timingValueService = timingValueService; _raceService = raceService; _participantService = participantService; _groupService = groupService; _categoryService = categoryService; _classService = classService; }
public async Task <List <MeetingDto> > GetMeetingsForParticipant(int participantId) { try { return(await ParticipantService.GetMeetingsForParticipant(participantId)); } catch (Exception e) { Console.WriteLine(e); throw; } }
public void CreateGetsCorrectEvaluationId() { ParticipantService participantService = new ParticipantService(_context); EvaluationService evaluationService = new EvaluationService(_context); Evaluation evaluation = evaluationService.GetAll().First(); string evaluationIdBefore = evaluation.Id; Participant participant = participantService.Create("CreateGetsCorrectEvaluationId_id", evaluation, Organization.Engineering, Role.Participant); string evaluationIdAfter = participant.Evaluation.Id; Assert.Equal(evaluationIdBefore, evaluationIdAfter); }
public void GetExist() { EvaluationService evaluationService = new EvaluationService(_context); Evaluation evaluation = evaluationService.GetAll().First(); ParticipantService participantService = new ParticipantService(_context); Participant participantCreate = participantService.Create("GetExist_id", evaluation, Organization.Engineering, Role.Participant); Participant participantGet = participantService.GetParticipant(participantCreate.Id); Assert.Equal(participantCreate, participantGet); }
public void Delete() { EvaluationService evaluationService = new EvaluationService(_context); Evaluation evaluation = evaluationService.GetAll().First(); ParticipantService participantService = new ParticipantService(_context); Participant participantCreate = participantService.Create("Delete_id", evaluation, Organization.Engineering, Role.Participant); participantService.Remove(participantCreate.Id); Assert.Throws <NotFoundInDBException>(() => participantService.GetParticipant(participantCreate.Id)); }
public void GetAzureId() { EvaluationService evaluationService = new EvaluationService(_context); Evaluation evaluation = evaluationService.GetAll().First(); ParticipantService participantService = new ParticipantService(_context); string azureUniqueId = "GetAzureId_id"; Participant participantCreated = participantService.Create(azureUniqueId, evaluation, Organization.Engineering, Role.Participant); Participant participantGet = participantService.GetParticipant(azureUniqueId, evaluation); Assert.Equal(participantCreated, participantGet); }
public RegisterController( UserManager <IdentityUser> userManager, SignInManager <IdentityUser> signInManager, ILogger <RegisterController> logger, ParticipantService participantService, TeamService teamService) { _userManager = userManager; _signInManager = signInManager; _logger = logger; _participantService = participantService; _teamService = teamService; }
public void ParticipantAddedToEvaluation() { EvaluationService evaluationService = new EvaluationService(_context); Evaluation evaluation = evaluationService.GetAll().First(); ParticipantService participantService = new ParticipantService(_context); int participantsBefore = evaluation.Participants.Count; participantService.Create("ParticipantAddedToEvaluation_id", evaluation, Organization.Engineering, Role.Participant); int participantsAfter = evaluation.Participants.Count; Assert.Equal(participantsBefore + 1, participantsAfter); }
public void Create() { EvaluationService evaluationService = new EvaluationService(_context); Evaluation evaluation = evaluationService.GetAll().First(); ParticipantService participantService = new ParticipantService(_context); int nParticipantsBefore = participantService.GetAll().Count(); participantService.Create("Create_id", evaluation, Organization.Engineering, Role.Participant); int nParticipantsAfter = participantService.GetAll().Count(); Assert.Equal(nParticipantsBefore + 1, nParticipantsAfter); }
public void GetExists() { ClosingRemarkService closingRemarkService = new ClosingRemarkService(fixture.context); ParticipantService participantService = new ParticipantService(fixture.context); Participant participant = participantService.GetAll().First(); ActionService actionService = new ActionService(fixture.context); Action action = actionService.GetAll().First(); ClosingRemark ClosingRemarkCreate = closingRemarkService.Create(participant, "text", action); ClosingRemark ClosingRemarkGet = closingRemarkService.GetClosingRemark(ClosingRemarkCreate.Id); Assert.Equal(ClosingRemarkCreate, ClosingRemarkGet); }
public void ParticipantAddedToProject() { ProjectService projectService = new ProjectService(_context); Project project = projectService.GetAll().First(); Evaluation evaluation = project.Evaluations.First(); ParticipantService participantService = new ParticipantService(_context); int participantsBefore = project.Evaluations.First().Participants.Count; participantService.Create("ParticipantAddedToProject", evaluation, Organization.Engineering, Role.Participant); int participantsAfter = project.Evaluations.First().Participants.Count; Assert.Equal(participantsBefore + 1, participantsAfter); }
public async Task Get_DontExist_ShouldReturnNull() { // Arrange var options = BuildContextOptions(); using (var context = new BorrowBuddyContext(options)) { var service = new ParticipantService(context); // Act var result = await service.GetAsync(Guid.NewGuid()); // Assert Assert.Null(result); } }
public void GetExists() { ActionService actionService = new ActionService(_context); ParticipantService participantService = new ParticipantService(_context); Participant participant = participantService.GetAll().First(); QuestionService questionService = new QuestionService(_context); Question question = questionService.GetAll().First(); Action actionCreate = actionService.Create(participant, participant, "description", DateTimeOffset.UtcNow, "title", Priority.High, question); Action actionGet = actionService.GetAction(actionCreate.Id).First(); Assert.Equal(actionCreate, actionGet); }
public void GetExists() { NoteService noteService = new NoteService(fixture.context); ParticipantService participantService = new ParticipantService(fixture.context); Participant participant = participantService.GetAll().First(); ActionService actionService = new ActionService(fixture.context); Action action = actionService.GetAll().First(); Note NoteCreate = noteService.Create(participant, "text", action); Note NoteGet = noteService.GetNote(NoteCreate.Id); Assert.Equal(NoteCreate, NoteGet); }