public ActionResult EditarNota(int id) { if (User.Identity.IsAuthenticated) { var outreachNote = db.UserNotes.Find(id); if ((Int32.Parse(User.Identity.Name.Split(',')[0]) == outreachNote.UserID && Boolean.Parse(User.Identity.Name.Split(',')[2])) || Int32.Parse(User.Identity.Name.Split(',')[1]) == 1) { EscuelasController controller = new EscuelasController(); UserViewModel outreachViewModel = new UserViewModel { Note = outreachNote }; return(PartialView("EditarNota", outreachViewModel)); } } return(RedirectToAction("AccesoDenegado", "Home")); }
public ActionResult CrearNota(int id) { if (User.Identity.IsAuthenticated) { if (Boolean.Parse(User.Identity.Name.Split(',')[2]) || Int32.Parse(User.Identity.Name.Split(',')[1]) == 1) { EscuelasController controller = new EscuelasController(); UserViewModel outreachViewModel = new UserViewModel { Note = new UserNote { SubjectID = id } }; return(PartialView("CrearNota", outreachViewModel)); } } return(RedirectToAction("AccesoDenegado", "Home")); }
public ActionResult FormularioReportes(string requested) { if (User.Identity.IsAuthenticated) { if (Int32.Parse(User.Identity.Name.Split(',')[1]) == 1 && Boolean.Parse(requested)) { EscuelasController controller = new EscuelasController(); ReportViewModel reportViewModel = new ReportViewModel { Semesters = getSemesters(), ActivityTypes = getActivityTypes(), ActivityMajors = getActivityMajors(), ActivityDynamics = getActivityDynamics(), TargetPopulations = getTargetPopulations(), SchoolRegions = new List <SelectListItem>() }; reportViewModel.ActivityTypes.Add(new SelectListItem { Text = "Todos", Value = "0" }); reportViewModel.ActivityMajors.Add(new SelectListItem { Text = "Todas", Value = "0" }); reportViewModel.ActivityDynamics.Add(new SelectListItem { Text = "Todas", Value = "0" }); reportViewModel.TargetPopulations.Add(new SelectListItem { Text = "Todas", Value = "0" }); reportViewModel.SchoolRegions.Add(new SelectListItem { Text = "", Value = "0" }); reportViewModel.SchoolRegions.AddRange(controller.getSchoolRegions()); reportViewModel.SchoolRegions.Add(new SelectListItem { Text = "Todas", Value = "0" }); return(PartialView("FormularioReportes", reportViewModel)); } } return(RedirectToAction("AccesoDenegado")); }