public ActionResult Evaluate(IFormCollection formCollection, RetroViewModel retroViewModel) { foreach (var key in formCollection.AsParallel()) { string retroDate = formCollection["RetroDate"]; var skillIDs = formCollection["SkillID"].ToList(); var levels = formCollection["Level"].ToList(); for (int i = 0; i < skillIDs.Count(); i++) { Console.WriteLine(i); int skillID = ConvertToInt(skillIDs[i]); Level levelID = ConvertToLevel(levels[i]); var retro = new Retro() { RetroDate = Convert.ToDateTime(retroDate), Level = (Level)levelID, SkillID = skillID }; PostARetroItem(retro); } ModelState.AddModelError(string.Empty, "Server Error. Please contact administrator."); return(RedirectToAction("Report")); } return(View(retroViewModel)); }
public async Task Initialize() { var progressDialog = await m_dialogCoordinator.ShowProgressAsync(this, "Initializing Retrospecive Client", "Initializing Retrospecive Client..."); progressDialog.SetProgress(0); try { progressDialog.SetMessage("Initializing User Configuration"); UserConfigurationViewModel.Initialize(LogViewModel); progressDialog.SetProgress(0.33); RaisePropertyChanged(() => UserConfigurationViewModel); RaisePropertyChanged(() => ZoomViewModel); progressDialog.SetMessage("Checking User Configuration"); if (!UserConfigurationViewModel.UserConfiguration.IsAllRequiredSet) { UserConfigurationViewModel.OpenConfigurationCommand.Execute(null); } progressDialog.SetProgress(0.66); progressDialog.SetMessage("Preparing retrospective"); RetroViewModel.Initialize(this, LogViewModel); RaisePropertyChanged(() => RetroViewModel); progressDialog.SetProgress(1); } catch (Exception e) { LogViewModel.Log <Error>(e); } await progressDialog.CloseAsync(); }
public ActionResult Edit(RetroViewModel retroViewModel) { using (var client = new HttpClient()) { client.BaseAddress = new Uri(Startup.APIURL + "retros"); //HTTP POST var putTask = client.PutAsJsonAsync <RetroViewModel>("retros", retroViewModel); putTask.Wait(); var result = putTask.Result; if (result.IsSuccessStatusCode) { return(RedirectToAction("Report")); } } return(View(retroViewModel)); }
public ActionResult Edit(int?id) { RetroViewModel model = null; try { IEnumerable <SkillListModel> skillsList = null; skillsList = GetSkillsList(); if (skillsList != null) { ViewBag.skillsList = skillsList; } using (var client = new HttpClient()) { client.BaseAddress = new Uri(Startup.APIURL + "retros"); //HTTP GET var retroResposeTask = client.GetAsync("retros?id=" + id.ToString()); retroResposeTask.Wait(); var retroResult = retroResposeTask.Result; if (retroResult.IsSuccessStatusCode) { var readRetroData = retroResult.Content.ReadAsAsync <RetroViewModel>(); readRetroData.Wait(); model.Skills = skillsList; model = readRetroData.Result; } } } catch (Exception e) { ModelState.AddModelError(string.Empty, "Server error. Please contact administrator."); e.Message.ToString(); } return(View(model)); }
public ActionResult Evaluate1(RetroViewModel retroViewModel) { using (var client = new HttpClient()) { client.BaseAddress = new Uri(Startup.APIURL); var postTask = client.PostAsJsonAsync <RetroViewModel>("retros", retroViewModel); postTask.Wait(); var result = postTask.Result; if (result.IsSuccessStatusCode) { return(RedirectToAction("Report")); } } ModelState.AddModelError(string.Empty, "Server Error. Please contact administrator."); return(View(retroViewModel)); }
public void OnRetroFinished() { RetroViewModel.Initialize(this, LogViewModel); RaisePropertyChanged(string.Empty); }