using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Wyceny
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            // Report/Authors/2009/7
            routes.MapRoute(
                "Authors",                                                                                               // Route name
                "Report/Authors/{year}/{month}",                                                                         // URL with parameters
                new { controller = "Report", action = "Authors", year = DateTime.Now.Year, month = DateTime.Now.Month }  // Parameter defaults
            );

            // Report/AuthorsByMagazines/2009/7/1
            routes.MapRoute(
                "AuthorsByMagazinesByEmployment",                                                                                   // Route name
                "Report/AuthorsByMagazinesByEmployment/{year}/{month}/{employment}",                                                            // URL with parameters
                new { controller = "Report", action = "AuthorsByMagazinesByEmployment", year = DateTime.Now.Year, month = DateTime.Now.Month }  // Parameter defaults
            );

            // Report/AuthorsByMagazines/2009/7
            routes.MapRoute(
                "AuthorsByMagazines",                                                                                               // Route name
                "Report/AuthorsByMagazines/{year}/{month}",                                                                         // URL with parameters
                new { controller = "Report", action = "AuthorsByMagazines", year = DateTime.Now.Year, month = DateTime.Now.Month }  // Parameter defaults
            );
            
            routes.MapRoute(
                "AuthorCard",                                                                                                           // Route name
                "Report/AuthorCard/{year}/{month}/{author}",                                                                            // URL with parameters
                new { controller = "Report", action = "AuthorCard", year = DateTime.Now.Year, month = DateTime.Now.Month, author = 0 }  // Parameter defaults
            );

            routes.MapRoute(
                "All",                                                                                                            // Route name
                "Report/All/{year}/{month}/{user}",                                                                               // URL with parameters
                new { controller = "Report", action = "All", year = DateTime.Now.Year, month = DateTime.Now.Month, user = 0 }  // Parameter defaults
            );

            routes.MapRoute(
                "Default",                                              // Route name
                "{controller}/{action}/{id}",                           // URL with parameters
                new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
            );

        }

        protected void Application_Start()
        {
            RegisterRoutes(RouteTable.Routes);
        }
    }
}