public void loadprices(string subcatppNR, SubCatkControl parent, Ruimte r) { LinkedSControl = parent; foreach (CustomListItem cli in ListBox.Items) { var optie = Inputlist.Where(x => x.GetType() == typeof(OptieKeuze) && (x as OptieKeuze).OptieID == cli.Id).FirstOrDefault() as OptieKeuze; var subcatNR = (from scpp in Acumulator.Instance().ctx.SubCatPerPakkets where scpp.SCBP_ID == subcatppNR select scpp.SCB_NR).FirstOrDefault().ToString(); var meters = (from scpr in Acumulator.Instance().ctx.SubCatPerRuimteDeels join scp in Acumulator.Instance().ctx.SubCats on scpr.SCB_NR equals scp.SCB_ID where scpr.SCB_NR == subcatNR && scpr.R_NR == optie.OptieID && scp.C_NR != "C8" select scpr.meters).FirstOrDefault().ToString(); if (meters.Length > 0) { meters += (from sc in Acumulator.Instance().ctx.SubCats where sc.SCB_ID == subcatNR select sc.eenheidMETERS).FirstOrDefault().ToString(); } var oli = new List <OpbouwItem>(); oli.Add(new OpbouwItem("", "€" + string.Format("{0:0.00}", optie.getMeerprijs(Acumulator.Instance().ctx, r.GekozenPakket.PakketPrijsgroep_NR)), meters)); cli.Opbouw = oli; } }
public void MatchProfiel(SubCatkControl cntrl, string matchvalue) { if (firstchoice == null) { firstchoice = cntrl; } if (firstchoice == cntrl) { Matching = true; foreach (SubCatkControl sck in SubContPanel.Children) { if (sck != cntrl) { foreach (WrapPanel wp in sck.SubCatPanel.Children.Where(x => x.GetType() == typeof(WrapPanel))) { foreach (ProductKControl pc in wp.Children.Where(x => x.GetType() == typeof(ProductKControl))) { if (pc.hoekprofiel.ProfielType != matchvalue) { pc.IsEnabled = false; if (pc.janeeRdBtn.IsChecked == true) { pc.janeeRdBtn.IsChecked = false; } } else { pc.IsEnabled = true; } } } } } } Matching = false; }
public void SetLinkedSControl(SubCatkControl parent) { LinkedSControl = parent; }
public void MatchKeuze(SubCatkControl cntrl, string matchvalue, bool voegkleur) { Matching = true; switch (cntrl.HoofdCatType) { case MainCatType.normaal: foreach (SubCatkControl sck in SubContPanel.Children) { if (sck != cntrl) { switch (cntrl.sType) { case SubType.product: foreach (WrapPanel wp in sck.SubCatPanel.Children.Where(x => x.GetType() == typeof(WrapPanel))) { foreach (ProductKControl pc in wp.Children.Where(x => x.GetType() == typeof(ProductKControl))) { if (pc.product.Kleur == matchvalue) { pc.janeeRdBtn.IsChecked = true; } } } break; case SubType.nabewerking: break; } } } break; case MainCatType.accent: foreach (SubCatkControl sck in SubContPanel.Children) { if (sck != cntrl) { if (sck.hoofdcatnummer == cntrl.hoofdcatnummer) { //geen accent foreach (WrapPanel wp in sck.SubCatPanel.Children.Where(x => x.GetType() == typeof(WrapPanel))) { var noselct = wp.Children.Where(x => x.GetType() == typeof(ProductKControl) && (x as ProductKControl).product.ID == "0").FirstOrDefault() as ProductKControl; noselct.janeeRdBtn.IsChecked = true; } } } } foreach (WrapPanel wp in cntrl.SubCatPanel.Children.Where(x => x.GetType() == typeof(WrapPanel))) { foreach (ProductKControl pc in wp.Children.Where(x => x.GetType() == typeof(ProductKControl))) { if (pc.product.Kleur == matchvalue) { pc.janeeRdBtn.IsChecked = true; } } } break; case MainCatType.verwerking: foreach (SubCatkControl sck in SubContPanel.Children.Where(x => x.GetType() == typeof(SubCatkControl))) { if (sck != cntrl) { if (sck.hoofdcatnummer == cntrl.hoofdcatnummer || voegkleur) { foreach (KeuzeList kl in sck.SubCatPanel.Children.Where(x => x.GetType() == typeof(KeuzeList))) { var tomatch = kl.ListBox.Items.Where(I => (I as CustomListItem).Id == matchvalue).FirstOrDefault() as CustomListItem; if (tomatch != null) { if (tomatch.Gekozen == false) { tomatch.Gekozen = true; } } } } } } break; } Matching = false; }