public void TestMethodSourceProcess() { Kernel.Instance.Start(); var modelLogic = new ModelLogic(); modelLogic.SourceProcess(); }
public ActionResult Home() { var model = ModelLogic.CreateMasterModel() as MasterModel <Home>; model.Content.LatestNewsItem = NewsLogic.GetLatestNewsitem(); return(CurrentTemplate(model)); }
public ActionResult Vacancyoverview() { var model = ModelLogic.CreateMasterModel() as MasterModel <Vacancyoverview>; model.Content.Container = GetContainer(); return(CurrentTemplate(model)); }
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); }
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); }
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 }) }); }
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%" }) }); }
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)); }
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); } }
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); } }
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(); }
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) }) }); }
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); } }
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%" }) } }); }
public ActionResult Contact() { var masterModel = ModelLogic.CreateMasterModel(); return(CurrentTemplate(masterModel)); }
public override ActionResult Index(RenderModel model) { var masterModel = ModelLogic.CreateMasterModel(); return(CurrentTemplate(masterModel)); }
public ActionResult Home() { var model = ModelLogic.CreateMasterModel() as MasterModel <Home>; return(CurrentTemplate(model)); }