コード例 #1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Initialize Mapper
            DtoMappings.Initialize();

            //Initialise Bootstrapper
            Bootstrapper.Initialise();
        }
コード例 #2
0
ファイル: Global.asax.cs プロジェクト: samibader/CoreProject
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Initialize Mapper
            DtoMappings.Initialize();

            //Initialise Bootstrapper
            Bootstrapper.Initialise();

            // clear XML Support
            GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear();
        }
コード例 #3
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Initialize Mapper
            DtoMappings.Initialize();

            //Initialise Bootstrapper
            Bootstrapper.Initialise();

            FluentValidationModelValidatorProvider.Configure(
                provider =>
            {
                provider.ValidatorFactory = new DependencyResolverModelValidatorFactory();
                provider.Add(
                    typeof(IsEmailUniquePropertyValidator),
                    (metadata, context, rule, validator) => new IsEmailUniqueClientPropertyValidator(metadata, context, rule, validator));
            });
            //FluentValidationModelValidatorProvider.Configure();
        }
コード例 #4
0
 public TestService()
 {
     Logger.Info("Created TestService");
     //HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize();
     DtoMappings.Initialize();
 }
コード例 #5
0
        public void SetUp()
        {
            //Initializaing Mappings
            DtoMappings.Initialize();


            //Initializing Data
            TestShoutBoxMessage = new ShoutBoxMessageModel {
                Author = "test", Message = "test", ShoutBoxId = 1, TimePosted = new DateTime(2010, 10, 10, 10, 10, 10)
            };
            TestShoutBoxMessage1 = new ShoutBoxMessageModel {
                Author = "test", Message = "testLatest", ShoutBoxId = 1, TimePosted = new DateTime(2011, 10, 10, 10, 10, 10)
            };
            TestQuestionAnswer = new TestQuestionAnswer {
                Correct = true, NumberSelected = 0, Text = "test"
            };
            TestQuestion = new TestQuestionModel
            {
                QuestionText = "test question", QuestionLabel = "test", Answers = new List <TestQuestionAnswer>
                {
                    TestQuestionAnswer
                }
            };
            TestTestType = new TestTypeModel {
                TypeName = "test"
            };
            TestPofile = new ProfileModel {
                LoginName = "test", Email = "*****@*****.**", IsActive = true
            };
            TestTest = new TestModel
            {
                Author = TestPofile, CreationDate = new DateTime(2010, 1, 1), Name = "test", TestType = TestTestType
            };
            LatestTest = new TestModel
            {
                Author = TestPofile, CreationDate = new DateTime(2011, 1, 1), Name = "test", TestType = TestTestType
            };
            TestCourseType = new CourseTypeModel {
                TypeName = "Fizyka"
            };
            TestCourseType1 = new CourseTypeModel {
                TypeName = "Matematyka"
            };
            TestGroupType = new GroupTypeModel {
                TypeName = "test"
            };
            TestGroupType1 = new GroupTypeModel {
                TypeName = "test1"
            };
            TestGroup = new GroupModel {
                GroupType = TestGroupType, GroupName = "test"
            };
            TestForum = new ForumModel {
                Author = "test", Name = "test"
            };
            TestShoutBox = new ShoutboxModel();
            TestShoutBox.Messages.Add(TestShoutBoxMessage);
            TestShoutBox.Messages.Add(TestShoutBoxMessage1);
            TestSurvey = new SurveyModel
            {
                SurveyText = "Smiga chodzi fruwa ?", DateCreated = new DateTime(2010, 1, 1)
            };
            TestLatestSurvey = new SurveyModel
            {
                SurveyText = "Smiga chodzi fruwa ?", DateCreated = new DateTime(2011, 1, 1)
            };


            TestCourse2 = new CourseModel
            {
                CourseType   = TestCourseType1,
                ShoutBox     = TestShoutBox,
                Forum        = TestForum,
                Group        = TestGroup,
                CreationDate = DateTime.Now,
                Description  = "test1",
                Logo         = "/test1.jpg",
                Name         = "test1",
                Password     = "******"
            };

            TestCourse3 = new CourseModel
            {
                CourseType   = TestCourseType1,
                ShoutBox     = TestShoutBox,
                Forum        = TestForum,
                Group        = TestGroup,
                CreationDate = DateTime.Now,
                Description  = "test1",
                Logo         = "/test1.jpg",
                Name         = "test1",
                Password     = null
            };
            TestContentType = new ContentTypeModel {
                TypeName = "test"
            };
            TestContent = new ContentModel
            {
                ContentUrl     = "test",
                CreationDate   = DateTime.Now,
                DownloadNumber = 0,
                Name           = "test",
                Text           = "test",
                Type           = TestContentType
            };
            TestJournalMark = new JournalMarkModel {
                Name = "Zaliczenie", Value = "5"
            };
            TestJournal = new JournalModel
            {
                Course = TestCourse3, Marks = new List <JournalMarkModel>
                {
                    TestJournalMark
                }, Name = "test journal"
            };

            FileModel = new FileModel {
                FileName = "test", Address = "test"
            };
            SectionModel = new SectionModel {
                IconName = "test", Text = "test", Title = "tset"
            };

            LearningMaterialModel = new LearningMaterialModel
            {
                Level         = 1,
                CreationDate  = DateTime.Now,
                Description   = "test",
                Goals         = "test",
                Summary       = "test",
                UpdateDate    = DateTime.Now,
                VersionNumber = "111",
                Tests         = new List <TestModel> {
                    TestTest
                },
                Files = new List <FileModel> {
                    FileModel
                },
                Sections = new List <SectionModel> {
                    SectionModel
                }
            };
            TestCourse1 = new CourseModel
            {
                CourseType        = TestCourseType,
                ShoutBox          = TestShoutBox,
                Forum             = TestForum,
                Group             = TestGroup,
                CreationDate      = DateTime.Now,
                Description       = "test",
                Logo              = "/test.jpg",
                Name              = "test",
                Password          = "******",
                LearningMaterials = new List <LearningMaterialModel> {
                    LearningMaterialModel
                }
            };

            using (var session = DataAccess.OpenSession())
            {
                session.Save(TestPofile);
                session.Save(TestShoutBoxMessage);
                session.Save(TestShoutBoxMessage1);
                session.Save(TestCourseType);
                session.Save(TestGroupType);
                session.Save(TestGroupType1);
                session.Save(TestGroup);
                session.Save(TestForum);
                session.Save(TestShoutBox);
                session.Save(TestCourseType1);
                session.Save(TestSurvey);
                session.Save(TestLatestSurvey);
                session.Save(TestTestType);
                session.Save(TestTest);
                session.Save(LatestTest);
                session.Save(TestCourse1);
                session.Save(TestCourse2);
                session.Save(TestQuestionAnswer);
                session.Save(TestQuestion);
                session.Save(TestCourse3);
                session.Save(TestJournalMark);
                session.Save(TestJournal);
                session.Save(TestContentType);
                session.Save(TestContent);
                session.Save(FileModel);
                session.Save(SectionModel);
                session.Save(LearningMaterialModel);
                session.Flush();
            }
        }
コード例 #6
0
 public ProfileService(IRoleProvider provider)
 {
     _roleProvider = provider;
     DtoMappings.Initialize();
 }
コード例 #7
0
        //private static void _SetupRefreshJob()
        //{

        //    //remove a previous job
        //    Action remove = HttpContext.Current.Cache["Refresh"] as Action;
        //    if (remove is Action)
        //    {
        //        HttpContext.Current.Cache.Remove("Refresh");
        //        remove.EndInvoke(null);
        //    }

        //    //get the worker
        //    Action work = () => {
        //        while (true)
        //        {
        //            Thread.Sleep(60000);
        //            WebClient refresh = new WebClient();
        //            try
        //            {
        //                refresh.UploadString("http://salesapp.ssg-sy.com", string.Empty);
        //                refresh.UploadString("http://salesapp.ssg-sy.com/remote", string.Empty);
        //            }
        //            catch (Exception ex)
        //            {
        //                //snip...
        //            }
        //            finally
        //            {
        //                refresh.Dispose();
        //            }
        //        }
        //    };
        //    work.BeginInvoke(null, null);

        //    //add this job to the cache
        //    HttpContext.Current.Cache.Add(
        //        "Refresh",
        //        work,
        //        null,
        //        Cache.NoAbsoluteExpiration,
        //        Cache.NoSlidingExpiration,
        //        CacheItemPriority.Normal,
        //        (s, o, r) => { _SetupRefreshJob(); }
        //        );
        //}
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Initialize Mapper
            DtoMappings.Initialize();

            //Initialise Bootstrapper
            Bootstrapper.Initialise();

            FluentValidationModelValidatorProvider.Configure(
                provider =>
            {
                provider.ValidatorFactory = new DependencyResolverModelValidatorFactory();

                provider.Add(
                    typeof(IsEmailUniquePropertyValidator),
                    (metadata, context, rule, validator) => new IsEmailUniqueClientPropertyValidator(metadata, context, rule, validator));

                /// GuideCity ///
                // provider.Add(
                //    typeof(GuideIsArabicNameAddUniquePropertyValidator),
                //    (metadata, context, rule, validator) => new GuideIsArabicNameAddUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                //   typeof(GuideIsEnglishNameAddUniquePropertyValidator),
                //   (metadata, context, rule, validator) => new GuideIsEnglishNameAddUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                //   typeof(GuideIsArabicNameEditUniquePropertyValidator),
                //   (metadata, context, rule, validator) => new GuideIsArabicNameEditUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                //  typeof(GuideIsEnglishNameEditUniquePropertyValidator),
                //  (metadata, context, rule, validator) => new GuideIsEnglishNameEditUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                //typeof(GuideIsExistIdEditUniquePropertyValidator),
                //(metadata, context, rule, validator) => new GuideIsExistIdEditUniqueClientPropertyValidator(metadata, context, rule, validator));
                //// provider.Add(
                //typeof(GuideIsCityIdExistPropertyValidator),
                //(metadata, context, rule, validator) => new GuideIsCityIdExistClientPropertyValidator(metadata, context, rule, validator));


                /// GuideTown ///
                //  provider.Add(
                // typeof(GuideIsIdExistTownPropertyValidator),
                // (metadata, context, rule, validator) => new GuideIsIdExistTownClientPropertyValidator(metadata, context, rule, validator));
                ////  provider.Add(
                //typeof(GuideIsCityIdExistPropertyValidator),
                //(metadata, context, rule, validator) => new GuideIsCityIdExistClientPropertyValidator(metadata, context, rule, validator));

                /// City ///
                // provider.Add(
                //    typeof(IsArabicNameAddUniquePropertyValidator),
                //    (metadata, context, rule, validator) => new IsArabicNameAddUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                //    typeof(IsEnglishNameAddUniquePropertyValidator),
                //    (metadata, context, rule, validator) => new IsEnglishNameAddUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                // typeof(IsArabicNameEditUniquePropertyValidator),
                // (metadata, context, rule, validator) => new IsArabicNameEditUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                // typeof(IsEnglishNameEditUniquePropertyValidator),
                // (metadata, context, rule, validator) => new IsEnglishNameEditUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                // typeof(IsExistIdEditUniquePropertyValidator),
                //(metadata, context, rule, validator) => new IsExistIdEditUniqueClientPropertyValidator(metadata, context, rule, validator));


                /// Town ///
                //provider.Add(
                // typeof(IsCityIdExistPropertyValidator),
                //(metadata, context, rule, validator) => new IsCityIdExistClientPropertyValidator(metadata, context, rule, validator));
                //  provider.Add(
                // typeof(IsIdExistTownPropertyValidator),
                //(metadata, context, rule, validator) => new IsIdExistTownClientPropertyValidator(metadata, context, rule, validator));
                //  provider.Add(
                // typeof(IsPlaceIdUniqueAddPropertyValidator),
                //(metadata, context, rule, validator) => new IsPlaceIdUniqueAddClientPropertyValidator(metadata, context, rule, validator));

                //   provider.Add(
                // typeof(IsPlaceIdUniqueEditPropertyValidator),
                //(metadata, context, rule, validator) => new IsPlaceIdUniqueEditClientPropertyValidator(metadata, context, rule, validator));


                /// Classify ///
            });

            AntiForgeryConfig.SuppressIdentityHeuristicChecks = true;


            //SignalR start for notifications
            SignalHelper.Start();
        }
コード例 #8
0
 public CourseService()
 {
     HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize();
     DtoMappings.Initialize();
 }