コード例 #1
0
ファイル: Global.asax.cs プロジェクト: frankwus/Ensco.App
        protected void Application_Start()
        {
            // Load Web.Config AppSettings
            LoadConfigSettings();

            // Initialize Utilities
            UtilitySystem.Initialize();

            // Initialize Services
            ServiceSystem.Initialize();
            ServiceSystem.InitializeApplication();

            // Initialize Irma Services
            IrmaServiceSystem.Initialize();

            // Initialize Tlc LookupLists
            TlcManageLookupLists.InitLookupLists();

            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // DevExpress Model Binder
            System.Web.Mvc.ModelBinders.Binders.DefaultBinder = new DevExpress.Web.Mvc.DevExpressEditorsBinder();
            //DevExpress.Web.BinaryStorageConfigurator.Mode = DevExpress.Web.BinaryStorageMode.Session;

            //Localization
            ModelMetadataProviders.Current = new EnscoLocalizationProvider();
            ASPxWebControl.CallbackError  += Application_Error;
        }
コード例 #2
0
        // GET: Common/Common
        public ActionResult Index(string returnUrl)
        {
            // Initialize application, this is the first place that we have the application id from query string
            ServiceSystem.InitializeApplication();

            // TEST CODE TO AUTOLOGIN
            LoginTest();
            // TEST CODE TO AUTOLOGIN

            ApplicationModel model = ServiceSystem.ApplicationModel;

            if (model != null)
            {
                if (returnUrl != null)
                {
                    return(Redirect(returnUrl));
                }
                //if (currentCrumb != null)
                //    return RedirectToAction(currentCrumb.Action, currentCrumb.Controller, new { area=currentCrumb.Area });
                else
                {
                    return(RedirectToAction(model.Action, model.Controller, new { area = model.Area }));
                }
            }

            return(View());
        }