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.
 
 
 
 

166 lines
5.7 KiB

using System.Web.Mvc;
using System.Web.Routing;
namespace Sevomin.WebFrontend
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "404",
url: "404",
defaults: new { controller = "Base", action = "Error404" }
);
routes.MapRoute(
name: "Ads",
url: "ad/{id}",
defaults: new { controller = "Home", action = "Ads" }
);
#region For Help
routes.MapRoute(
name: "ExportScript",
url: "help/export/javascript",
defaults: new { controller = "Help", action = "ExportScript" }
);
routes.MapRoute(
name: "ExportRss",
url: "help/export/rss",
defaults: new { controller = "Help", action = "ExportRss" }
);
#endregion
#region For Downloads
routes.MapRoute(
name: "EnglishResumeGrabber",
url: "dovomin/resume/english/{userid}",
defaults: new { controller = "Authorized", action = "GetResume", english = true, userid = UrlParameter.Optional }
);
routes.MapRoute(
name: "PersianResumeGrabber",
url: "dovomin/resume/persian/{userid}",
defaults: new { controller = "Authorized", action = "GetResume", english = false, userid = UrlParameter.Optional }
);
#endregion
#region For Account Controller
routes.MapRoute(
name: "Login",
url: "login",
defaults: new { controller = "Account", action = "Login" }
);
routes.MapRoute(
name: "Logout",
url: "logout",
defaults: new { controller = "Account", action = "Logout" }
);
routes.MapRoute(
name: "ConfirmEmail",
url: "new-account/{code}",
defaults: new { controller = "Account", action = "ConfirmEmail" }
);
routes.MapRoute(
name: "Signup",
url: "new-account",
defaults: new { controller = "Account", action = "Signup" }
);
routes.MapRoute(
name: "UsernameValidator",
url: "check-username",
defaults: new { controller = "Account", action = "CheckUsername" }
);
routes.MapRoute(
name: "ProfileEditor",
url: "my-profile",
defaults: new { controller = "Account", action = "MyProfile" }
);
routes.MapRoute(
name: "DovominProfile",
url: "dovomin/id-{userId}",
defaults: new { controller = "Account", action = "Dovomin" }
);
routes.MapRoute(
name: "ForgotPassword",
url: "forgot-password",
defaults: new { controller = "Account", action = "Forgot" }
);
routes.MapRoute(
name: "ResetPassword",
url: "reset-password/{code}",
defaults: new { controller = "Account", action = "ResetPassword" }
);
routes.MapRoute(
name: "ChangePassword",
url: "change-password",
defaults: new { controller = "Account", action = "ChangePassword" }
);
#endregion
#region For Jobs
routes.MapRoute(
name: "RecentJobsRss",
url: "jobs/export/rss",
defaults: new { controller = "Job", action = "RecentJobsRss" }
);
routes.MapRoute(
name: "RecentJobsJavascript",
url: "jobs/export/js",
defaults: new { controller = "Job", action = "RecentJobsJavascript" }
);
routes.MapRoute(
name: "NewJob",
url: "jobs/new-job",
defaults: new { controller = "Job", action = "NewJob" }
);
routes.MapRoute(
name: "EditJob",
url: "jobs/edit-job/{id}",
defaults: new { controller = "Job", action = "Edit" }
);
routes.MapRoute(
name: "JobApply",
url: "jobs/apply/{jobId}",
defaults: new { controller = "Job", action = "Apply" }
);
routes.MapRoute(
name: "RecentJobs",
url: "jobs",
defaults: new { controller = "Job", action = "RecentJobs" }
);
routes.MapRoute(
name: "SingleJob",
url: "jobs/{jobId}",
defaults: new { controller = "Job", action = "SingleJob" }
);
#endregion
#region God Mode
routes.MapRoute(
name: "TurnOnGodMode",
url: "god-mode/{action}",
defaults: new {controller = "God", action = "Index"}
);
#endregion
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}