Esempio n. 1
0
        public void TestMethodSourceProcess()
        {
            Kernel.Instance.Start();
            var modelLogic = new ModelLogic();

            modelLogic.SourceProcess();
        }
Esempio n. 2
0
        public ActionResult Home()
        {
            var model = ModelLogic.CreateMasterModel() as MasterModel <Home>;

            model.Content.LatestNewsItem = NewsLogic.GetLatestNewsitem();

            return(CurrentTemplate(model));
        }
Esempio n. 3
0
        public ActionResult Vacancyoverview()
        {
            var model = ModelLogic.CreateMasterModel() as MasterModel <Vacancyoverview>;

            model.Content.Container = GetContainer();

            return(CurrentTemplate(model));
        }
Esempio n. 4
0
        public void ExampleTest()
        {
            var loader = new ExampleModelLoader();
            var model  = loader.LoadModel();
            var max    = ModelLogic.GetMaxSum(model, (n, c) => n.Value % 2 != c.Value % 2, out string path);

            Assert.AreEqual(16, max);
            Assert.AreEqual("1 -> 8 -> 5 -> 2", path);
        }
Esempio n. 5
0
 public void TestMethodDayResumeSelect()
 {
     Kernel.Instance.Start();
     var modelLogic   = new ModelLogic();
     var dayPredicate = new DayPredicate
     {
         Date = new Criteria <DateInterval>(new DateInterval(DateIntervalType.CurrentYear))
     };
     var serialized    = EngineStatic.PortableXmlSerialize(dayPredicate);
     var genericOutput = modelLogic.DayResumeSelect(dayPredicate);
 }
Esempio n. 6
0
 public void TestMethodPointSelect()
 {
     Kernel.Instance.Start();
     var modelLogic    = new ModelLogic();
     var genericOutput = modelLogic.PointSelect(new PointPredicate
     {
         PointActionType = new Criteria <List <PointActionType> >(new List <PointActionType>
         {
             PointActionType.In
         })
     });
 }
Esempio n. 7
0
 public void TestMethodPersonSelect()
 {
     Kernel.Instance.Start();
     var modelLogic    = new ModelLogic();
     var genericOutput = modelLogic.PersonSelect(new PersonPredicate
     {
         Name = new Criteria <List <string> >(new List <string>
         {
             "%Duja%"
         })
     });
 }
Esempio n. 8
0
 public void TestMethodSourceSelect()
 {
     Kernel.Instance.Start();
     var modelLogic    = new ModelLogic();
     var genericOutput = modelLogic.SourceSelect(new SourcePredicate
     {
         Pager = new Pager
         {
             Index = 1,
             Size  = 2
         }
     });
 }
        public ActionResult Newsoverview()
        {
            var model = ModelLogic.CreateMasterModel() as MasterModel <Newsoverview>;

            var newsItems = NewsLogic.GetNewsitems(CurrentPage);
            var pager     = Umbraco.GetPager(5, newsItems.Count());

            //Only put the paged items in the list.
            model.Content.NewsItems = newsItems.Skip((pager.CurrentPage - 1) * pager.ItemsPerPage).Take(pager.ItemsPerPage).ToList();
            model.Content.Pager     = pager;

            return(CurrentTemplate(model));
        }
Esempio n. 10
0
        public void TestMethodSourceCreateDate()
        {
            Kernel.Instance.Start();
            var modelLogic = new ModelLogic();
            var source     = new Source
            {
                Date           = DateTimeOffset.ParseExact("2015-01-12", "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None),
                SourceFileType = SourceFileType.Csv,
                LoadedOn       = DateTimeOffset.Now
            };

            using (source.StreamReader = new StreamReader(@"..\..\Data\2015-01\2015-01-12.csv"))
            {
                source = modelLogic.SourceCreate(source);
            }
        }
Esempio n. 11
0
        public void TestMethodSourceCreate()
        {
            Kernel.Instance.Start();
            var modelLogic = new ModelLogic();
            var source     = new Source
            {
                SourceFileType = SourceFileType.Csv,
                LoadedOn       = DateTimeOffset.Now
            };
            var fileInfo = new FileInfo(@"..\..\Data\online_export.txt");

            using (source.StreamReader = new StreamReader(@"..\..\Data\online_export.txt"))
            {
                source = modelLogic.SourceCreate(source);
            }
        }
Esempio n. 12
0
 public static void Main(string[] args)
 {
     try
     {
         var loader = new FileTriangleTreeModelLoader <int>("..\\..\\..\\Exercise-1.txt");
         var model  = loader.LoadModel();
         var maxSum = ModelLogic.GetMaxSum(model, (n, c) => n.Value % 2 != c.Value % 2, out string path);
         Console.WriteLine($"Max sum = {maxSum}");
         Console.WriteLine($"Path = {path}");
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
     Console.WriteLine("Press any key to exit");
     Console.ReadKey();
 }
Esempio n. 13
0
 public void TestMethodDaySelect()
 {
     Kernel.Instance.Start();
     var modelLogic    = new ModelLogic();
     var genericOutput = modelLogic.DaySelect(new DayPredicate
     {
         Pager = new Pager
         {
             Index = 1,
             Size  = 20
         },
         Date = new Criteria <DateInterval>(new DateInterval
         {
             DateFrom = new DateTimeOffset(2014, 10, 27, 0, 0, 0, 0, DateTimeOffset.Now.Offset),
             DateTo   = new DateTimeOffset(2014, 10, 28, 0, 0, 0, 0, DateTimeOffset.Now.Offset)
         })
     });
 }
Esempio n. 14
0
        public void TestMethodExtractTransformAnalyse()
        {
            Kernel.Instance.Start();
            var modelLogic = new ModelLogic();
            var source     = new Source
            {
                Date           = DateTimeOffset.Now,
                SourceFileType = SourceFileType.Csv,
                LoadedOn       = DateTimeOffset.Now
            };

            using (source.StreamReader = new StreamReader(@"..\..\Data\online_export.txt"))
            {
                modelLogic.Extract(source);
                modelLogic.Transform(source);
                modelLogic.Analyse(source);
                var serialized = EngineStatic.PortableXmlSerialize(source);
            }
        }
Esempio n. 15
0
 public void TestMethodEventSelect()
 {
     Kernel.Instance.Start();
     var modelLogic    = new ModelLogic();
     var genericOutput = modelLogic.EventSelect(new EventPredicate
     {
         Pager = new Pager
         {
             Index = 1,
             Size  = 20
         },
         PersonPredicate = new PersonPredicate
         {
             Name = new Criteria <List <string> >(new List <string>
             {
                 "%Duja%"
             })
         }
     });
 }
Esempio n. 16
0
        public ActionResult Contact()
        {
            var masterModel = ModelLogic.CreateMasterModel();

            return(CurrentTemplate(masterModel));
        }
        public override ActionResult Index(RenderModel model)
        {
            var masterModel = ModelLogic.CreateMasterModel();

            return(CurrentTemplate(masterModel));
        }
Esempio n. 18
0
        public ActionResult Home()
        {
            var model = ModelLogic.CreateMasterModel() as MasterModel <Home>;

            return(CurrentTemplate(model));
        }