You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.9 KiB

  1. using System.Web.Mvc;
  2. using System.Web.Routing;
  3. namespace Sevomin.WebFrontend
  4. {
  5. public class RouteConfig
  6. {
  7. public static void RegisterRoutes(RouteCollection routes)
  8. {
  9. routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  10. #region For Downloads
  11. routes.MapRoute(
  12. name: "EnglishResumeGrabber",
  13. url: "dovomin/resume/english/{userid}",
  14. defaults: new { controller = "Authorized", action = "GetResume", english = true, userid = UrlParameter.Optional }
  15. );
  16. routes.MapRoute(
  17. name: "PersianResumeGrabber",
  18. url: "dovomin/resume/persian/{userid}",
  19. defaults: new { controller = "Authorized", action = "GetResume", english = false, userid = UrlParameter.Optional }
  20. );
  21. #endregion
  22. #region For Account Controller
  23. routes.MapRoute(
  24. name: "Login",
  25. url: "login",
  26. defaults: new { controller = "Account", action = "Login" }
  27. );
  28. routes.MapRoute(
  29. name: "Logout",
  30. url: "logout",
  31. defaults: new { controller = "Account", action = "Logout" }
  32. );
  33. routes.MapRoute(
  34. name: "Signup",
  35. url: "new-account",
  36. defaults: new { controller = "Account", action = "Signup" }
  37. );
  38. routes.MapRoute(
  39. name: "UsernameValidator",
  40. url: "check-username",
  41. defaults: new { controller = "Account", action = "CheckUsername" }
  42. );
  43. routes.MapRoute(
  44. name: "ProfileEditor",
  45. url: "my-profile",
  46. defaults: new { controller = "Account", action = "MyProfile" }
  47. );
  48. #endregion
  49. #region For Jobs
  50. routes.MapRoute(
  51. name: "NewJob",
  52. url: "jobs/new-job",
  53. defaults: new { controller = "Job", action = "NewJob" }
  54. );
  55. routes.MapRoute(
  56. name: "EditJob",
  57. url: "jobs/edit-job/{id}",
  58. defaults: new { controller = "Job", action = "Edit" }
  59. );
  60. routes.MapRoute(
  61. name: "JobApply",
  62. url: "jobs/apply/{jobId}",
  63. defaults: new { controller = "Job", action = "Apply" }
  64. );
  65. routes.MapRoute(
  66. name: "SingleJob",
  67. url: "jobs/{jobId}",
  68. defaults: new { controller = "Job", action = "SingleJob" }
  69. );
  70. #endregion
  71. routes.MapRoute(
  72. name: "Default",
  73. url: "{controller}/{action}/{id}",
  74. defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
  75. );
  76. }
  77. }
  78. }