fork download
  1. using StudentList.Models;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Security.Policy;
  6. using System.Web;
  7. using System.Web.Mvc;
  8.  
  9.  
  10. namespace StudentList.Controllers
  11. {
  12. public class HomeController : Controller
  13. {
  14. private Models.StudentListEntities db = new Models.StudentListEntities();
  15.  
  16. public ActionResult Index()
  17. {
  18.  
  19. var students = db.Students;
  20. return View(students);
  21. }
  22.  
  23. public ActionResult Registration()
  24. {
  25. ViewBag.Message = "Tu możesz zarejestrować się";
  26.  
  27. return View();
  28. }
  29.  
  30. public ActionResult Edit()
  31. {
  32. ViewBag.Message = "Tu możesz edytować informację o Sobie";
  33.  
  34.  
  35. return View();
  36. }
  37. public void Form(string Name, string Surname, string Qualification, string Specialty, double Rating)
  38. {
  39. Student student = new Student
  40. {
  41. Name = Name,
  42. Surname = Surname,
  43. Qualification = Qualification,
  44. Specialty = Specialty,
  45. Rating = Rating
  46. };
  47. db.Students.Add(student);
  48. db.SaveChanges();
  49.  
  50. int studentId = db.Students.Max(item => item.Id);
  51. Response.Cookies["StudentCookies"].Value = studentId.ToString();
  52.  
  53. Response.Redirect("/");
  54. }
  55. public void EditForm(string Name, string Surname, string Qualification, string Specialty, double Rating)
  56. {
  57.  
  58. string cookieReq = Request.Cookies["StudentCookies"].Value;
  59.  
  60. if (cookieReq != null)
  61. {
  62. string studentId = cookieReq;
  63. int.Parse(studentId);
  64.  
  65. }
  66. }
  67. }
  68. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(1,19): error CS0234: The type or namespace name `Models' does not exist in the namespace `StudentList'. Are you missing an assembly reference?
prog.cs(7,18): error CS0234: The type or namespace name `Mvc' does not exist in the namespace `System.Web'. Are you missing an assembly reference?
prog.cs(12,35): error CS0246: The type or namespace name `Controller' could not be found. Are you missing an assembly reference?
prog.cs(14,17): error CS0246: The type or namespace name `Models' could not be found. Are you missing an assembly reference?
prog.cs(16,16): error CS0246: The type or namespace name `ActionResult' could not be found. Are you missing an assembly reference?
prog.cs(23,16): error CS0246: The type or namespace name `ActionResult' could not be found. Are you missing an assembly reference?
prog.cs(30,16): error CS0246: The type or namespace name `ActionResult' could not be found. Are you missing an assembly reference?
Compilation failed: 7 error(s), 0 warnings
stdout
Standard output is empty