private ExtraOmzetViewModel MaakModel(Analyse analyse) { if (analyse.ExtraOmzet == null) { return(new ExtraOmzetViewModel()); } return(new ExtraOmzetViewModel(analyse.ExtraOmzet)); }
public IActionResult Index(Analyse analyse) { analyse = _analyseRepository.GetById(analyse.AnalyseId, Soort.Loonkost); analyse.UpdateTotalen(_analyseRepository); PlaatsTotaalInViewData(analyse); return(View(MaakModel(analyse))); }
private OverurenBesparingViewModel MaakModel(Analyse analyse) { if (analyse.OverurenBesparing == null) { return(new OverurenBesparingViewModel()); } return(new OverurenBesparingViewModel(analyse.OverurenBesparing)); }
public IActionResult Index(Analyse analyse) { analyse = _analyseRepository.GetById(analyse.AnalyseId, Soort.LogistiekeBesparing); analyse.UpdateTotalen(_analyseRepository); LogistiekeBesparingViewModel model = new LogistiekeBesparingViewModel(analyse.LogistiekeBesparing); return(View(model)); }
public void TestGeefTotalenBaten_11SoortenInDictionary() { _analyse = new Analyse(); IDictionary <Soort, decimal> totalen = _analyse.GeefTotalenBaten(); int aantalSoorten = totalen.Count; Assert.Equal(11, aantalSoorten); }
private Analyse ReadAnalyseFromSession(HttpContext context) { Analyse analyse = context.Session.GetString("analyse") == null ? new Analyse() : JsonConvert.DeserializeObject <Analyse>(context.Session.GetString("analyse")); analyse.Departement = _werkgeverRepository.GetDepartementByAnalyseId(analyse.AnalyseId); return(analyse); }
public IActionResult Index(Analyse analyse) { analyse = _analyseRepository.GetById(analyse.AnalyseId, Soort.Subsidie); analyse.UpdateTotalen(_analyseRepository); SubsidieViewModel model = MaakModel(analyse); return(View(model)); }
public IActionResult Index(Analyse analyse) { analyse = _analyseRepository.GetById(analyse.AnalyseId, Soort.OverurenBesparing); analyse.UpdateTotalen(_analyseRepository); OverurenBesparingViewModel model = MaakModel(analyse); return(View(model)); }
public LoonKostTest() { _organisatie = new Organisatie("a", "b", "c", "1000", "d"); _organisatie.UrenWerkWeek = 40.0M; _organisatie.PatronaleBijdrage = 0.35M; _analyse = new Analyse(_organisatie); _kost = new LoonKost(_analyse); _kost.VoegLijnToe(); }
public AanpassingsSubsidieTest() { Organisatie o = new Organisatie("a", "b", "c", "1000", "d"); o.UrenWerkWeek = 40.0M; o.PatronaleBijdrage = 0.35M; Analyse a = new Analyse(o); _baat = new AanpassingsSubsidie(a); }
public AndereBesparingTest() { Organisatie o = new Organisatie("a", "b", "c", "1000", "d"); o.UrenWerkWeek = 40.0M; o.PatronaleBijdrage = 0.35M; Analyse a = new Analyse(o); _baat = new AndereBesparing(a); }
public ProductiviteitsWinstTest() { Organisatie o = new Organisatie("a", "b", "c", "1000", "d"); o.UrenWerkWeek = 40.0M; o.PatronaleBijdrage = 0.35M; Analyse a = new Analyse(o); _baat = new ProductiviteitsWinst(a); }
public OpleidingsKostTest() { Organisatie o = new Organisatie("a", "b", "c", "1000", "d"); o.UrenWerkWeek = 40.0M; o.PatronaleBijdrage = 0.35M; Analyse a = new Analyse(o); _kost = new OpleidingsKost(a); }
public static Analyse ProcessData(Data all) { Analyse analyse = new Analyse(); analyse.ClientQuantity = GetClientQuantity(all.Clients); analyse.SellerQuantity = GetSellerQuantity(all.Sellers); analyse.BiggestSaleID = GetBiggestSale(all.Sales); analyse.WorstSeller = GetWorstSeller(all.Sales); return(analyse); }
private void PlaatsTotaalInViewData(Analyse analyse) { if (analyse.ExtraKosten.Count == 0) { ViewData["totaal"] = 0; } var totaal = KostOfBaatExtensions.GeefTotaal(analyse.ExtraKosten); ViewData["totaal"] = totaal.ToString("C", new CultureInfo("nl-BE")); }
public IActionResult Index(Analyse analyse) { analyse = _analyseRepository.GetById(analyse.AnalyseId, Soort.EnclaveKost); analyse.UpdateTotalen(_analyseRepository); IEnumerable <EnclaveKostViewModel> viewModels = MaakModel(analyse); PlaatsTotaalInViewData(analyse); return(View(viewModels)); }
public void TestGeefTotalenBaten() { DummyApplicationDbContext dbContext = new DummyApplicationDbContext(); IDictionary <Soort, decimal> expected = new Dictionary <Soort, decimal> { { Soort.LoonkostSubsidies, 22593.68M }, { Soort.MedewerkersZelfdeNiveau, 266516.27M }, { Soort.MedewerkersHogerNiveau, 266516.27M }, { Soort.UitzendkrachtBesparing, 17570.00M }, { Soort.ExtraOmzet, 600M }, { Soort.ExtraProductiviteit, 6470M }, { Soort.OverurenBesparing, 34570M }, { Soort.ExterneInkoop, 6500M }, { Soort.Subsidie, 3500M }, { Soort.LogistiekeBesparing, 5000M }, { Soort.ExtraBesparing, 4996M } }; _analyse = new Analyse { Departement = dbContext.Aldi, /* KOSTEN */ Loonkosten = dbContext.Loonkosten, ExtraKosten = dbContext.ExtraKosten, BegeleidingsKosten = dbContext.BegeleidingsKosten, OpleidingsKosten = dbContext.OpleidingsKosten, PersoneelsKosten = dbContext.PersoneelsKosten, GereedschapsKosten = dbContext.GereedschapsKosten, VoorbereidingsKosten = dbContext.VoorbereidingsKosten, EnclaveKosten = dbContext.EnclaveKosten, /* BATEN */ MedewerkersZelfdeNiveauBaten = dbContext.MedewerkerNiveauBaten, MedewerkersHogerNiveauBaten = dbContext.MedewerkerNiveauBaten, UitzendKrachtBesparingen = dbContext.UitzendKrachtBesparingen, ExterneInkopen = dbContext.ExterneInkopen, ExtraOmzet = dbContext.ExtraOmzet, ExtraProductiviteit = dbContext.ExtraProductiviteit, OverurenBesparing = dbContext.OverurenBesparing, Subsidie = dbContext.Subsidie, LogistiekeBesparing = dbContext.LogistiekeBesparing, ExtraBesparingen = dbContext.ExtraBesparingen }; IDictionary <Soort, decimal> totalen = _analyse.GeefTotalenBaten(); foreach (KeyValuePair <Soort, decimal> pair in totalen) { decimal totaal = Math.Round(pair.Value, 2); Assert.Equal(expected[pair.Key], totaal); } }
public IActionResult Index(Analyse analyse) { analyse = _analyseRepository.GetById(analyse.AnalyseId, Soort.ExtraBesparing); analyse.UpdateTotalen(_analyseRepository); IEnumerable <ExtraBesparingViewModel> model = MaakModel(analyse); PlaatsTotaalInViewData(analyse); return(View(model)); }
public IActionResult Index(Analyse analyse) { analyse = _analyseRepository.GetById(analyse.AnalyseId, Soort.UitzendkrachtBesparing); analyse.UpdateTotalen(_analyseRepository); IEnumerable <UitzendKrachtBesparingViewModel> viewModels = MaakModel(analyse); PlaatsTotaalInViewData(analyse); return(View(viewModels)); }
public IActionResult Index(Analyse analyse) { analyse = _analyseRepository.GetById(analyse.AnalyseId, Soort.MedewerkersHogerNiveau); analyse.UpdateTotalen(_analyseRepository); IEnumerable <MedewerkerNiveauBaatViewModel> viewModels = MaakModel(analyse); PlaatsTotaalInViewData(analyse); return(View(viewModels)); }
public void ReadImage(ImageData imageData) { byte[] a = Convert.FromBase64String(imageData.Base64); MemoryStream memoryStream = new MemoryStream(a); Image image = System.Drawing.Image.FromStream(memoryStream); image.Save(imageData.guid.ToString() + ".png", ImageFormat.Png); try { Analyse z = new Analyse(); MWArray[] I = z.analyseImage(5, imageData.guid.ToString() + ".png", imageData.CoordinateXY[0], imageData.CoordinateXY[1]); // MWNumericArray I_num = I[4].ToArray(); // Byte[] I_bytess = (Byte[])I_num.ToVector(MWArrayComponent.Real); // Byte[] I_bytes = I_bytess.SelectMany(value => BitConverter.GetBytes(value)).ToArray(); int w = I[4].Dimensions[0]; int h = I[4].Dimensions[1]; //I[3] = null; imageData.Base64 = null; Bitmap bmp = new Bitmap(w, h, PixelFormat.Format8bppIndexed); ColorPalette cp = bmp.Palette; for (Int32 i = 0; i < 256; ++i) { cp.Entries[i] = Color.FromArgb(255, i, i, i); } bmp.Palette = cp; BitmapData data = bmp.LockBits((new Rectangle(0, 0, bmp.Width, bmp.Height)), ImageLockMode.WriteOnly, bmp.PixelFormat); // Marshal.Copy(I_bytess, 0, data.Scan0, I_bytess.Length); bmp.UnlockBits(data); bmp.Save(imageData.guid.ToString() + ".png", ImageFormat.Png); byte[] arr = File.ReadAllBytes(imageData.guid.ToString() + ".png"); imageData.Base64 = Convert.ToBase64String(arr); imageData.Matlab = new FromMatlab(); imageData.Matlab.Width = I[0].ToString(); imageData.Matlab.Height = I[1].ToString(); imageData.Matlab.Arena = I[2].ToString(); double[,] ale = (double[, ])I[3].ToArray(); imageData.Matlab.MatrixC1 = Math.Round(((double [, ])I[3].ToArray())[0, 0], 2).ToString(); imageData.Matlab.MatrixC2 = Math.Round(((double[, ])I[3].ToArray())[1, 0], 2).ToString(); imageData.Matlab.MatrixC3 = Math.Round(((double[, ])I[3].ToArray())[2, 0], 2).ToString(); imageData.IsFinish(); } catch (Exception e) { Console.WriteLine(e.Message); } }
public void TestIndex_Succes() { Analyse analyse = new Analyse { Departement = _dbContext.Aldi }; var result = _controller.Index(analyse) as ViewResult; var model = result?.Model as WerkgeverViewModel; Assert.Equal(typeof(WerkgeverViewModel), result?.Model.GetType()); Assert.Equal("ALDI", model?.Naam); }
public IActionResult Index(Analyse analyse) { if (analyse.Departement == null || analyse.Departement.Naam.Length == 0) { // er is nog geen werkgever, vragen om een werkgever te selecteren return(RedirectToAction("SelecteerWerkgever")); } WerkgeverViewModel model = new WerkgeverViewModel(analyse.Departement); return(View(model)); }
public void TestIndex_AnalyseKlaar_RedirectsToResultaat() { Analyse analyse = new Analyse { InArchief = true }; var result = _controller.Index(analyse) as RedirectToActionResult; Assert.Equal("Index", result?.ActionName); Assert.Equal("Resultaat", result?.ControllerName); }
public BatenIndexViewModel(Analyse analyse) { if (analyse.MedewerkersZelfdeNiveauBaten.Count != 0) { MedewerkersZelfdeNiveauBaatIngevuld = true; } if (analyse.MedewerkersHogerNiveauBaten.Count != 0) { MedewerkersHogerNiveauBaatIngevuld = true; } if (analyse.UitzendKrachtBesparingen.Count != 0) { UitzendKrachtBesparingenIngevuld = true; } if (analyse.ExtraOmzet != null && analyse.ExtraOmzet.Bedrag > 0) { ExtraOmzetIngevuld = true; } if (analyse.ExtraProductiviteit != null && analyse.ExtraProductiviteit.Bedrag > 0) { ExtraProductiviteitIngevuld = true; } if (analyse.OverurenBesparing != null && analyse.OverurenBesparing.Bedrag > 0) { OverurenBesparingIngevuld = true; } if (analyse.ExterneInkopen.Count != 0) { ExterneInkopenIngevuld = true; } if (analyse.Subsidie != null && analyse.Subsidie.Bedrag > 0) { SubsidieIngevuld = true; } if (analyse.LogistiekeBesparing != null && (analyse.LogistiekeBesparing.TransportKosten > 0 || analyse.LogistiekeBesparing.LogistiekHandlingsKosten > 0)) { LogistiekeBesparingIngevuld = true; } if (analyse.ExtraBesparingen.Count != 0) { ExtraBesparingenIngevuld = true; } }
private void PlaatsTotaalInViewData(Analyse analyse) { if (analyse.ExtraBesparingen.Count == 0) { ViewData["totaal"] = 0; } decimal totaal = analyse.ExtraBesparingen .Sum(t => t.Bedrag); ViewData["totaal"] = totaal.ToString("C", new CultureInfo("nl-BE")); }
public IActionResult Delete(int id) { AnalyseFilter.ZetSessieLeeg(HttpContext); Analyse analyse = _analyseRepository.GetById(User.Identity.Name, id); if (analyse == null) { return(RedirectToAction(nameof(Index))); } ViewData["analyse"] = analyse.Departement.Werkgever.Naam + " - " + analyse.Departement.Naam; return(View()); }
public override void OnActionExecuting(ActionExecutingContext context) { _analyse = ReadAnalyseFromSession(context.HttpContext); Analyse analyse = new Analyse(); if (_analyse.AnalyseId != 0) {// geen nieuwe analyse analyse = _analyseRepository.GetById(_analyse.AnalyseId); } context.ActionArguments["analyse"] = analyse; base.OnActionExecuting(context); }
public void TestIndex_GeenContactPersoonIngesteld_RedirectNaarVoegContactPersoonToe() { Analyse analyse = new Analyse { Departement = _dbContext.Aldi }; Werkgever werkgever = new Werkgever(); _werkgeverRepository.Setup(w => w.GetById(It.IsAny <int>())).Returns(werkgever); var result = _controller.Index(analyse) as RedirectToActionResult; Assert.Equal("VoegContactPersoonToe", result?.ActionName); }
//自动分析 private void AutoAnalyse() { if (lsbStudys.SelectedIndex == -1) { return; } //计算基线 MyDrawBioWave.BioBaselien = Analyse.AnalyseBaseline(MyStudyList.SelectedStudy.BioBuf); //绘制生理参数波形 MyDrawBioWave.DrawWave(); }