예제 #1
0
        private static void InitRepository()
        {
            JobProgress progress = progressController.CreateJob(0, 4, "Init");

            Membership.Tasks.Init(settings.SqlConnectionString);
            progressController.IncrementValue(progress.JobId);

            Membership.Roles.Init(settings.SqlConnectionString);
            progressController.IncrementValue(progress.JobId);

            Membership.UserSettings.Init(settings.SqlConnectionString);
            progressController.IncrementValue(progress.JobId);

            Membership.Users.Init(settings.SqlConnectionString, Cultures.GetAll());
            progressController.IncrementValue(progress.JobId);
        }
예제 #2
0
        public static void Init(ApplicationSettingsBase applicationSettings, string startupPath)
        {
            progressController = new JobProgressController();

            // Load application settings
            settings             = new DomainModel.Settings(applicationSettings);
            settings.StartupPath = startupPath;

            Status = new ApplicationStatus(new
                                           StatusController.Controller.StatusController());

            try
            {
                Cultures.Init(settings.SqlConnectionString);
                //culture = Cultures.GetAll()["en-us"];
            }
            catch (Exception ex)
            {
                try
                {
                    // Unable to load cultures
                    Status.Update(StatusController.Abstract.StatusTypes.Error, "", ex.Message);
                }
                catch { }
            }



            // Create a resource manager to access localized resources
            resourceManager = new ResourceManager(settings.DefaultLocale);

            // Init repository
            InitRepository();

            // Set a default invalid user for application
            user = new Entities.User();
        }