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.

123 lines
4.3 KiB

11 years ago
11 years ago
11 years ago
  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. routes.MapRoute(
  11. name: "404",
  12. url: "404",
  13. defaults: new { controller = "Base", action = "Error404" }
  14. );
  15. #region For Downloads
  16. routes.MapRoute(
  17. name: "EnglishResumeGrabber",
  18. url: "dovomin/resume/english/{userid}",
  19. defaults: new { controller = "Authorized", action = "GetResume", english = true, userid = UrlParameter.Optional }
  20. );
  21. routes.MapRoute(
  22. name: "PersianResumeGrabber",
  23. url: "dovomin/resume/persian/{userid}",
  24. defaults: new { controller = "Authorized", action = "GetResume", english = false, userid = UrlParameter.Optional }
  25. );
  26. #endregion
  27. #region For Account Controller
  28. routes.MapRoute(
  29. name: "Login",
  30. url: "login",
  31. defaults: new { controller = "Account", action = "Login" }
  32. );
  33. routes.MapRoute(
  34. name: "Logout",
  35. url: "logout",
  36. defaults: new { controller = "Account", action = "Logout" }
  37. );
  38. routes.MapRoute(
  39. name: "ConfirmEmail",
  40. url: "new-account/{code}",
  41. defaults: new { controller = "Account", action = "ConfirmEmail" }
  42. );
  43. routes.MapRoute(
  44. name: "Signup",
  45. url: "new-account",
  46. defaults: new { controller = "Account", action = "Signup" }
  47. );
  48. routes.MapRoute(
  49. name: "UsernameValidator",
  50. url: "check-username",
  51. defaults: new { controller = "Account", action = "CheckUsername" }
  52. );
  53. routes.MapRoute(
  54. name: "ProfileEditor",
  55. url: "my-profile",
  56. defaults: new { controller = "Account", action = "MyProfile" }
  57. );
  58. routes.MapRoute(
  59. name: "DovominProfile",
  60. url: "dovomin/id-{userId}",
  61. defaults: new { controller = "Account", action = "Dovomin" }
  62. );
  63. routes.MapRoute(
  64. name: "ForgotPassword",
  65. url: "forgot-password",
  66. defaults: new { controller = "Account", action = "Forgot" }
  67. );
  68. routes.MapRoute(
  69. name: "ResetPassword",
  70. url: "reset-password/{code}",
  71. defaults: new { controller = "Account", action = "ResetPassword" }
  72. );
  73. routes.MapRoute(
  74. name: "ChangePassword",
  75. url: "change-password",
  76. defaults: new { controller = "Account", action = "ChangePassword" }
  77. );
  78. #endregion
  79. #region For Jobs
  80. routes.MapRoute(
  81. name: "NewJob",
  82. url: "jobs/new-job",
  83. defaults: new { controller = "Job", action = "NewJob" }
  84. );
  85. routes.MapRoute(
  86. name: "EditJob",
  87. url: "jobs/edit-job/{id}",
  88. defaults: new { controller = "Job", action = "Edit" }
  89. );
  90. routes.MapRoute(
  91. name: "JobApply",
  92. url: "jobs/apply/{jobId}",
  93. defaults: new { controller = "Job", action = "Apply" }
  94. );
  95. routes.MapRoute(
  96. name: "RecentJobs",
  97. url: "jobs",
  98. defaults: new { controller = "Job", action = "RecentJobs" }
  99. );
  100. routes.MapRoute(
  101. name: "SingleJob",
  102. url: "jobs/{jobId}",
  103. defaults: new { controller = "Job", action = "SingleJob" }
  104. );
  105. #endregion
  106. routes.MapRoute(
  107. name: "Default",
  108. url: "{controller}/{action}/{id}",
  109. defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
  110. );
  111. }
  112. }
  113. }