Пример #1
0
 /// <summary>
 /// Sets up the logic object from a given team id.
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public async Task SetUpFromTeam(int id)
 {
     _TeamAssociated = await Service.GetTeam(id);
     _StudyToWorkOn = new StudyDTO
     {
         Team = _TeamAssociated
     };
     _Users = new List<UserDTO>();
     _Users.AddRange(await GetUserNames(_TeamAssociated.UserIDs));
 }
Пример #2
0
        /// <summary>
        /// Updates a study with a given ID through the studyconfigurationcontroller api
        /// </summary>
        /// <param name="id"></param>
        /// <param name="study"></param>
        /// <returns></returns>
        public static async Task UpdateStudy(int id, StudyDTO study)
        {
            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri("http://localhost:6735/");
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

                try
                {
                    var response = await client.PutAsJsonAsync("api/StudyConfiguration/" + id, study);
                    response.EnsureSuccessStatusCode(); // Throw if not a success code.
                }
                catch (HttpRequestException)
                {
                }
            }
        }
Пример #3
0
 /// <summary>
 /// Sets up the page from the logic object.
 /// </summary>
 /// <param name="study"></param>
 private void SetUpFromStudy(StudyDTO study)
 {
     _stageToWorkOn = new StageDTO();
     _stageToWorkOn.StudyID = _logic._StudyToWorkOn.Id;
     _users = new List<UserDTO>();
     _validators = new List<UserDTO>();
     _reviewers = new List<UserDTO>();
     _users.AddRange(_logic._Users);
     SetUpBoxes();
 }