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.

97 lines
3.3 KiB

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. #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. routes.MapRoute(
  49. name: "DovominProfile",
  50. url: "dovomin/id-{userId}",
  51. defaults: new { controller = "Account", action = "Dovomin" }
  52. );
  53. #endregion
  54. #region For Jobs
  55. routes.MapRoute(
  56. name: "NewJob",
  57. url: "jobs/new-job",
  58. defaults: new { controller = "Job", action = "NewJob" }
  59. );
  60. routes.MapRoute(
  61. name: "EditJob",
  62. url: "jobs/edit-job/{id}",
  63. defaults: new { controller = "Job", action = "Edit" }
  64. );
  65. routes.MapRoute(
  66. name: "JobApply",
  67. url: "jobs/apply/{jobId}",
  68. defaults: new { controller = "Job", action = "Apply" }
  69. );
  70. routes.MapRoute(
  71. name: "RecentJobs",
  72. url: "jobs",
  73. defaults: new { controller = "Job", action = "RecentJobs" }
  74. );
  75. routes.MapRoute(
  76. name: "SingleJob",
  77. url: "jobs/{jobId}",
  78. defaults: new { controller = "Job", action = "SingleJob" }
  79. );
  80. #endregion
  81. routes.MapRoute(
  82. name: "Default",
  83. url: "{controller}/{action}/{id}",
  84. defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
  85. );
  86. }
  87. }
  88. }