Exemple #1
0
        public ActionResult ResolverTarefa(int idTarefa)
        {
            using (var client = new WebClient()) {
                try {
                    var obj        = client.DownloadString(APIUrl.TarefaPorId(idTarefa, Convert.ToInt32(User.Identity.Name)));
                    var resolucoes = JsonConvert.DeserializeObject(obj, typeof(Interface.Resolucao));

                    var viewModel = Mapper.Map <ResolucaoViewModel>(resolucoes);

                    return(View(viewModel));
                } catch (WebException ex) {
                    ModelState.AddModelError(string.Empty, ex.Message);
                    return(View());
                }
            }
        }