public ActionResult CreateDiscipline(string Name) { ViewData["links"] = getLinks(); ViewData["functions"] = getFunctions(); ModelContainer data = new ModelContainer(); DisciplineDAO disciplineDAO = new DisciplineDAO(); UserDAO userDAO = new UserDAO(); IEnumerable<aspnet_Users> users = (IEnumerable<aspnet_Users>)userDAO.ReadAll(x => (x.LoweredUserName == User.Identity.Name.ToLower()), data).Value; Res result = disciplineDAO.CreateDiscipline(Name, users.First(x => (x.LoweredUserName == User.Identity.Name.ToLower())), data); return RedirectToAction("Disciplines", "Lector"); }
public ActionResult CreateStudentRequest(string GroupName) { ModelContainer data = new ModelContainer(); StudentRequestDAO studentrequestdao = new StudentRequestDAO(); UserDAO userdao = new UserDAO(); GroupDAO groupdao = new GroupDAO(); IEnumerable<aspnet_Users> users = (IEnumerable<aspnet_Users>)(userdao.ReadAll(x => (x.LoweredUserName == User.Identity.Name.ToLower()), data).Value); IEnumerable<Group> groups = (IEnumerable<Group>)(groupdao.ReadAll(x => (x.GroupName == GroupName), data).Value); Res result = studentrequestdao.CreateRequest(users.First(x => true), groups.First(x => true), data); return RedirectToAction("CreateStudentRequestView", "Student"); }
public ActionResult CreateRequest(string message, string role) { ViewData["links"] = getLinks(); ViewData["functions"] = getFunctions(); RequestDAO requestDAO = new RequestDAO(); UserDAO userdao = new UserDAO(); Test.Models.ModelContainer data = new ModelContainer(); IEnumerable<aspnet_Users> users = (IEnumerable<aspnet_Users>)userdao.ReadAll(x => (x.LoweredUserName == User.Identity.Name.ToLower()), data).Value; aspnet_Users user = users.First(x => true); requestDAO.CreateRequest(user , role, message, data); return RedirectToAction("Index", "Home"); }
public ActionResult GetStatistics() { ViewData["links"] = getLinks(); ViewData["functions"] = getFunctions(); ModelContainer data = new ModelContainer(); UserDAO udao = new UserDAO(); Test.Models.DAO.TestDAO tdao = new Models.DAO.TestDAO(); IEnumerable<aspnet_Users> users = (udao.ReadAll(x => x.LoweredUserName == User.Identity.Name.ToLower(), data).Value as IEnumerable<aspnet_Users>); IEnumerable<Test.Models.Test> tests = (tdao.ReadTests(test => test.Discipline.aspnet_Users_UserId == users.First().UserId, data).Value as IEnumerable<Test.Models.Test>); Object results = (tdao.ReadAllResults(result => tests.Contains(result.Test), data)).Value; return View(results); }
public ActionResult Tests() { ViewData["links"] = getLinks(); ViewData["functions"] = getFunctions(); ModelContainer data = new Models.ModelContainer(); GroupDAO gdao = new GroupDAO(); Test.Models.DAO.TestDAO tdao = new Models.DAO.TestDAO(); UserDAO udao = new UserDAO(); IEnumerable<aspnet_Users> users = (udao.ReadAll(x => x.LoweredUserName == User.Identity.Name.ToLower(), data).Value as IEnumerable<aspnet_Users>); IEnumerable<Group> groups = (gdao.ReadAll(x => x.aspnet_Users.Contains(users.First()), data).Value as IEnumerable<Group>); IEnumerable<Test.Models.Test> tests = (tdao.ReadTests(x => x.Groups.Contains(groups.First()), data).Value as IEnumerable<Models.Test>); return View(tests); }
public ActionResult SendTest() { ModelContainer data = new ModelContainer(); Test.Models.DAO.TestDAO tdao = new Models.DAO.TestDAO(); UserDAO udao = new UserDAO(); IEnumerable<aspnet_Users> users = (udao.ReadAll(x => x.LoweredUserName == User.Identity.Name.ToLower(), data).Value as IEnumerable<aspnet_Users>); Res r = tdao.Check((Session["test"] as Test.Models.Test), data, users.First()); return View(r.Value); }