public ActionResult Detalle(int id) { try { ViewBag.tarea = _generalService.Get(id); return(View("Detalle")); } catch (Exception e) { throw e; } }
// GET: Tareas public ActionResult Index() { try { int id; int.TryParse(Session["IdUsuario"].ToString(), out id); Usuario usuario = _generalUserService.Get(id); List <Carpeta> carpetas = usuario.Carpeta.OrderBy(x => x.Nombre).ToList(); List <Tarea> tareas = usuario.Tarea.OrderByDescending(x => x.FechaCreacion).ToList(); List <TareaListar> ListaTl = new List <TareaListar>(); foreach (Tarea x in tareas) { TareaListar Tl = new TareaListar(); Tl.IdCarpeta = x.IdCarpeta; Tl.IdTarea = x.IdTarea; Tl.Nombre = x.Nombre; Tl.Prioridad = x.Prioridad; Tl.EstimadoHoras = x.EstimadoHoras; Tl.Completada = x.Completada; Tl.FechaCreacion = x.FechaCreacion; Tl.FechaFin = x.FechaFin; foreach (Carpeta y in carpetas) { if (y.IdCarpeta == x.IdCarpeta) { Tl.NombreCarpeta = y.Nombre; } } ListaTl.Add(Tl); } ViewBag.tareas = ListaTl; return(View("Index")); } catch (Exception e) { throw e; } }
public ActionResult Index() { try { int id; int.TryParse(Session["IdUsuario"].ToString(), out id); Usuario usuario = _generalUserService.Get(id); ViewBag.carpetas = usuario.Carpeta.OrderBy(x => x.Nombre).ToList(); return View("Index"); } catch (Exception e) { throw e; } }
// GET: Home public ActionResult Index() { try { int id; if (Session["Nombre"].Equals(String.Empty)) { return(View()); } else { int.TryParse(Session["IdUsuario"].ToString(), out id); Usuario usuario = _generalService.Get(id); List <Carpeta> carpetas = usuario.Carpeta.OrderBy(x => x.Nombre).ToList(); List <Tarea> tareas = usuario.Tarea.Where(x => x.Completada == 0).OrderBy(x => x.Prioridad).ThenBy(x => x.FechaFin).ToList(); List <TareaListar> ListaTl = new List <TareaListar>(); foreach (Tarea x in tareas) { TareaListar Tl = new TareaListar(); Tl.IdTarea = x.IdTarea; Tl.Nombre = x.Nombre; Tl.Prioridad = x.Prioridad; Tl.EstimadoHoras = x.EstimadoHoras; Tl.Completada = x.Completada; foreach (Carpeta y in carpetas) { if (y.IdCarpeta == x.IdCarpeta) { Tl.NombreCarpeta = y.Nombre; } } ListaTl.Add(Tl); } ViewBag.carpetas = carpetas; ViewBag.tareas = ListaTl; return(View("Index")); } } catch (Exception e) { throw e; } }