public KopersGegevens() { InitializeComponent(); Acumulator.Instance().BB.ShowWijzigBtn(true); LoadData(); SwitchWijzig(true); }
public void RemoveSave() { var ctx = Acumulator.Instance().ctx; ctx.Load(ctx.GetOpgeslagenOfferteByIdQuery(Acumulator.Instance().Bouwnr)).Completed += (sender, args) => { var saves = (from s in ctx.OpgeslagenOffertes orderby s.timestamp select s); while (saves.Count() > 0) { if (saves.Last().Volledig == true) { ArchiefOffertes ao = new ArchiefOffertes(); ao.Bouwnummer_NR = saves.Last().Bouwnummer_NR; ao.GebruikerID_Delete = Acumulator.Instance().HuidigGebruiker.ID; ao.GebruikerID_Save = saves.Last().Gebruiker_ID; ao.timestamp_save = saves.Last().timestamp; ao.timestamp_remove = DateTime.Now; ao.Xml_Value = saves.Last().Xml_Value; ao.Versie = saves.Count().ToString(); if (saves.Last().Prijs != null) { ao.Prijs = saves.Last().Prijs; } ctx.ArchiefOffertes.Add(ao); } ctx.OpgeslagenOffertes.Remove(saves.Last()); } ctx.SubmitChanges(); Acumulator.Instance().SavedXml = null; Acumulator.Instance().oOL = null; }; }
private void MakeTotals() { var korting = Acumulator.Instance().ProjFase.Korting; //hier korting verrekenen var kortHolder = Acumulator.Instance().OTracker.offerteRuimte_.Korting; if (kortHolder != null) { korting = Acumulator.Instance().OTracker.offerteRuimte_.Korting.KortingBedrag; } //////////////////////// if (korting > 0) { subtotalTB.Visibility = Visibility.Visible; subtotalPrijsTB.Visibility = Visibility.Visible; kortingTB.Visibility = Visibility.Visible; kortingPrijsTB.Visibility = Visibility.Visible; subtotalPrijsTB.Text = "€" + String.Format("{0:0.00}", TotaalPrijs); var kortt = Math.Round(korting, 2); kortingPrijsTB.Text = "- €" + String.Format("{0:0.00}", (kortt)); TotaalPrijs -= kortt; } totaalPrijsTB.Text = "€" + String.Format("{0:0.00}", TotaalPrijs); }
private void GetInstapPrijzen() { HeleDozenLijst.Clear(); instapChecklist.Clear(); foreach (Ruimte r in Acumulator.Instance().OTracker.offerteRuimte_.Children) { foreach (var p in r.GekozenTegels) { if (instapChecklist.ContainsKey(p.ID)) { instapChecklist[p.ID] += 1; } else { instapChecklist.Add(p.ID, 1); } } foreach (var p in r.GekozenProfielen) { if (instapChecklist.ContainsKey(p.ProfielID)) { instapChecklist[p.ProfielID] += 1; } else { instapChecklist.Add(p.ProfielID, 1); } } } }
public void SetDataSaved() { NameTB.Text = "Laatst opgeslagen offerte:"; var opgeslagenOfferteLean = Acumulator.Instance().oOL; if (opgeslagenOfferteLean != null) { SavedBy.Text = opgeslagenOfferteLean.gebruiker; SavedAt.Text = opgeslagenOfferteLean.Datum.ToString("dd-MM-yyyy HH:mm:ss"); OpgeslagenopTB.Text = "Opgeslagen op:"; VersieNr.Text = opgeslagenOfferteLean.VersieFull.ToString() + "." + opgeslagenOfferteLean.VersiePartial.ToString(); if (opgeslagenOfferteLean.VersiePartial == 0) { Uitwerking.Text = "volledig"; } else { Uitwerking.Text = "onvolledig"; } Prijs.Text = opgeslagenOfferteLean.Prijs; } else { SavedAt.Text = "-"; SavedBy.Text = "-"; VersieNr.Text = "-"; } }
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; } }
private void Adjust_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) { double newtotal; var ifbar = Acumulator.Instance().InfoBar; newtotal = ifbar.Bon.GetTotalD();//totaalprijs.Text.TrimStart('€'),out newtotal); double oldtotal; var ool = Acumulator.Instance().oOL; double.TryParse(ool.Prijs.TrimStart('€'), out oldtotal); double oldkort = 0.0; var otrack = Acumulator.Instance().OTracker; if (otrack.offerteRuimte_.Korting != null) { oldkort = otrack.offerteRuimte_.Korting.KortingBedrag; } var dw = new DetailsWindow(); dw.Width = 500; dw.Height = 500; dw.Closed += dw_Closed; dw.LoadContent(new DiscountAuthorizer(newtotal, oldtotal, oldkort, dw)); dw.Show(); } }
public void InitProduct(Product p) { product = p; if (p.Breedte < 3000 && p.Breedte > 1 && p.Lengte < 3000 && p.Lengte > 1) { productNR.Text = p.productcode.TrimStart(' ') + " " + p.Breedte.ToString().Substring(0, 2) + "x" + p.Lengte.ToString().Substring(0, 2) + "cm"; } else { productNR.Text = p.productcode.TrimStart(' '); } productKleur.Text = p.Kleur.TrimStart(' '); if (p.Omschrijving.Contains('€') && !Acumulator.Instance().ProjFase.FilterDorpels) { var oms_parts = p.Omschrijving.Split('€'); productKleur.Text += Environment.NewLine + "Let op: Meerprijs van €" + oms_parts[1]; } var soort = (from sc in Acumulator.Instance().ctx.SubCats join scp in Acumulator.Instance().ctx.SubCatPerPakkets on sc.SCB_ID equals scp.SCB_NR where scp.SCBP_ID == p.LinkedSubCat select sc.Omschrijving).FirstOrDefault(); soortInfo.Text = soort; string path = "default image"; if (p.ImgPath != null) { path = "http://mybouwapp.nl/Images/ProductImgStorage/" + p.ImgPath; //this.LoadImage(new Uri(path, UriKind.Absolute)); GetImageStart(path); } }
private void ShowTekeningBtn_Click_1(object sender, RoutedEventArgs e) { var dw = new DetailsWindow(); dw.Height = 450; dw.Width = 600; foreach (Ruimte r in Acumulator.Instance().OTracker.offerteRuimte_.Children.Where(x => x.GetType() == typeof(Ruimte))) { /* if (Acumulator.Instance().HuidigRuimteSetKey.ContainsKey(r.RuimteID) && Acumulator.Instance().TekeningBijRuimte.ContainsKey(r.RuimteID) && Acumulator.Instance().TekeningBijRuimte[r.RuimteID].ContainsKey(Acumulator.Instance().HuidigRuimteSetKey[r.RuimteID])) * { * var imgpath = Acumulator.Instance().TekeningBijRuimte[r.RuimteID][Acumulator.Instance().HuidigRuimteSetKey[r.RuimteID]]; * if(Acumulator.Instance().Blueprints.ContainsKey(imgpath)) * { * * bp.LoadImg(Acumulator.Instance().Blueprints[imgpath]); * * } * * }*/ var data = Acumulator.Instance().bluePrintManager.getBlueprintData(r.RuimteID, false); if (data != null) { var bp = new BluePrintControl(); bp.LoadImg(data); dw.LoadContent(bp); } } dw.Show(); }
private bool XmlMatch(string matchwidth) { var retval = false; if (Acumulator.Instance().SavedXml == null) { retval = false; } else { var cntr = 0; Start: if (cntr < 3) { cntr++; try { SaveLoadXML slx = new SaveLoadXML(); foreach (var r in Acumulator.Instance().OTracker.offerteRuimte_.Children.Where(c => c.GetType() == typeof(Ruimte))) { (r as Ruimte).GetMetersAdjusted((r as Ruimte).GetSaldoMeters()); (r as Ruimte).GetSaldoMetersAccent(); (r as Ruimte).GetSaldoMetersHoek(); } var curxml = slx.SerializeOfferte(Acumulator.Instance().OTracker.offerteRuimte_); curxml = NormalizeXml(curxml); Acumulator.Instance().lastGeneratedXml = curxml; string savedxml; if (matchwidth != null) { savedxml = matchwidth; } else { savedxml = Acumulator.Instance().SavedXml; } savedxml = NormalizeXml(savedxml); // retval = String.Equals(curxml, savedxml, StringComparison.Ordinal); for (int i = 0; i < curxml.Length; i++) { if (curxml[i] != savedxml[i]) { var totc = curxml.Substring(i); var tots = savedxml.Substring(i); break; } } var hash_curxml = CalculateMD5Hash(curxml); var hash_savedxml = CalculateMD5Hash(savedxml); retval = String.Equals(hash_curxml, hash_savedxml, StringComparison.Ordinal); } catch (Exception e) { LogHelper.SendLog(e.Message, LogType.error); goto Start; } } } return(retval); }
public void DownloadBlueprint(string path, string ruimteid, string setnr) { var holder = (from h in bluePrints where h.filepath == path && h.ruimteId == ruimteid && h.ruimteSetNr == setnr select h).FirstOrDefault(); if (holder == null) { holder = new BluePrintHolder() { filepath = path, ruimteId = ruimteid, ruimteSetNr = setnr != null ? setnr : "Basis", statusInfo = BluePrintStatus.Downloading }; bluePrints.Add(holder); } if (HuidigeRuimteSetNrs.ContainsKey(ruimteid)) { HuidigeRuimteSetNrs[ruimteid] = setnr != null ? setnr : "Basis"; } else { HuidigeRuimteSetNrs.Add(ruimteid, setnr != null ? setnr : "Basis"); } string apath = "http://mybouwapp.nl/Images/Blueprints/" + path; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apath); request.UseDefaultCredentials = true; Acumulator.Instance().updateDownActive(ruimteid, true); request.BeginGetResponse(RequestReady, request); }
private PakketKeuze CheckPakkettenExists(PakketKeuze save_pakketn, List <string> loadcompl) { var ctx = Acumulator.Instance().ctx; if (save_pakketn != null) { var validpak = (from pak in ctx.Pakkettens where save_pakketn.Pakket_ID == pak.P_ID select pak.P_ID).ToList(); if (validpak != null) { return(save_pakketn); } else { //notify save not complete loadcompl.Clear(); return(null); } } else { return(null); } }
public BluePrintStatus GetBlueprintStatus(string ruimteid) { var ctx = Acumulator.Instance().ctx; if (HuidigeRuimteSetNrs.ContainsKey(ruimteid)) { var results = (from h in bluePrints where h != null && h.ruimteId == ruimteid && h.ruimteSetNr == HuidigeRuimteSetNrs[ruimteid] select h.statusInfo); if (results.Count() > 0) { return(results.First()); } else { var hasImage = (from i in ctx.RuimteS where i.RS_ID == HuidigeRuimteSetNrs[ruimteid] select i.BlueprintPath).FirstOrDefault(); if (hasImage != null && hasImage.Length > 0) { return(BluePrintStatus.Idle); } else { return(BluePrintStatus.Unavailable); } } } else { return(BluePrintStatus.Unavailable); } }
public void GetAllBlueprints() { //Acumulator.Instance().Blueprints.Clear(); bluePrints.Clear(); foreach (Ruimte r in Acumulator.Instance().OTracker.offerteRuimte_.Children) { string path = Acumulator.Instance().GetPathGespiegeld(r.RuimteID); BluePrintHolder holder = new BluePrintHolder() { filepath = path, ruimteId = r.RuimteID, ruimteSetNr = "Basis", statusInfo = BluePrintStatus.Downloading }; if (HuidigeRuimteSetNrs.ContainsKey(r.RuimteID)) { HuidigeRuimteSetNrs[r.RuimteID] = "Basis"; } else { HuidigeRuimteSetNrs.Add(r.RuimteID, "Basis"); } bluePrints.Add(holder); if (path != null && path != "") { string apath = "http://mybouwapp.nl/Images/Blueprints/" + path; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apath); request.UseDefaultCredentials = true; Acumulator.Instance().updateDownActive(r.RuimteID, true); request.BeginGetResponse(RequestReady, request); } } }
private void Button_Click(object sender, RoutedEventArgs e) { var obj = (from b in Acumulator.Instance().ctx.Blokkens where b.BlokID == linkedBlok.BlokID select b).FirstOrDefault(); if (obj != null) { if (linkedBlok.Status == AfspraakStatus.Beschikbaar) { obj.Status = true; obj.EigenaarGebruikerID = Acumulator.Instance().HuidigGebruiker.ID; obj.Eigenaar = Acumulator.Instance().HuidigGebruiker.GebruikersNaam; // linkedBlok.Status = AfspraakStatus.Gekozen; } else if (linkedBlok.Status == AfspraakStatus.Gekozen) { // obj.Status = false; // obj.Eigenaar = null; // obj.EigenaarGebruikerID = null; //linkedBlok.Status = AfspraakStatus.Beschikbaar; } var invokeop = Acumulator.Instance().ctx.ReserveerBlok(obj, ProbeerReserveerComplete, null); } }
public void CheckAllSaves() { var ctx = Acumulator.Instance().ctx; ctx.Load(ctx.GetOpgeslagenOfferteByIdQuery(Acumulator.Instance().Bouwnr)).Completed += (sender, arg) => { string result = "resultaat vergelijking : " + Environment.NewLine; var saves = (from oo in ctx.OpgeslagenOffertes where oo.Bouwnummer_NR == Acumulator.Instance().Bouwnr orderby oo.timestamp select oo.Xml_Value).ToList(); List <KeyValuePair <int, int> > done = new List <KeyValuePair <int, int> >(); for (int i = 0; i <= saves.Count() - 1; i++) { for (int j = 0; j <= saves.Count() - 1; j++) { if (j != i && !done.Contains(new KeyValuePair <int, int>(i, j)) && !done.Contains(new KeyValuePair <int, int>(j, i))) { if (XmlMatch(saves[i], saves[j])) { result += "xml van " + (i + 1) + " en " + (j + 1) + " zijn gelijk" + Environment.NewLine; } else { result += "xml van " + (i + 1) + " en " + (j + 1) + " zijn ongelijk" + Environment.NewLine; } done.Add(new KeyValuePair <int, int>(i, j)); } } } MessageBox.Show(result); }; }
public void SetDataNew(DateTime savetime, bool volledig) { NameTB.Text = "Nieuw uitgewerkte offerte:"; SavedAt.Text = savetime.ToString("dd-MM-yyyy HH:mm:ss"); SavedBy.Text = Acumulator.Instance().HuidigGebruiker.GebruikersNaam; OpgeslagenopTB.Text = "Uitgewerkt op:"; if (volledig) { if (Acumulator.Instance().oOL != null) { VersieNr.Text = Acumulator.Instance().oOL.VersieFull + 1 + ".0"; } else { VersieNr.Text = "1.0"; } Uitwerking.Text = "volledig"; } else { if (Acumulator.Instance().oOL != null) { VersieNr.Text = Acumulator.Instance().oOL.VersieFull + "." + (Acumulator.Instance().oOL.VersiePartial + 1).ToString(); } else { VersieNr.Text = "0.1"; } Uitwerking.Text = "onvolledig"; } if (String.IsNullOrEmpty(Acumulator.Instance().InfoBar.Bon.GetTotal()) == false) { Prijs.Text = Acumulator.Instance().InfoBar.Bon.GetTotal(); } }
public PakketKeuze(string id, string pg, string oms) { Pakket_ID = id; PakketPrijsgroep_NR = pg; Omschrijving = oms; Getsubs(Acumulator.Instance().ctx); }
private void loadSave() { Wijzigstand = false; if (dataRegel.ProductId != null) { var bew = ruimte.GekozenBewerkingen.Where(x => x.Kenmerk != null && x.Kenmerk.StartsWith(dataRegel.ProductId + dataRegel.SubCat)).ToList(); foreach (var nb in bew) { if (nb.BewerkingCat_NR == "NC1") { VoegCbb.SelectedValue = nb.Nabewerking_ID; } else { VerwerkingCbb.SelectedValue = nb.Nabewerking_ID; } } if (bew == null || bew.Count == 0) { Wijzigstand = true; } else { var iscurcompl = Acumulator.Instance().BB.IsCurrentComplete(); wijzigstand = !iscurcompl; Acumulator.Instance().BB.ShowWijzigBtn(iscurcompl); } } else {//tegelhoogte etc wijzigstand = true; } }
public bool SubmitPressed() { var result = true; if (MetersValid()) { var ctx = Acumulator.Instance().ctx; var BasisReplaced = false; if (InternData.Regels.Count(x => x.Status != StatusType.Leeg) > 0) { if (InternData.Regels[0].GekozenTegel.ProductId != InternData.BasisTegel.ProductId) { BasisReplaced = true; } } //v3 foreach (var rgl in InternData.Regels) { if (rgl.Status != StatusType.Leeg) { //Extra meters moeten altijd worden opgeslagen zowel voor basis wijziging als voor gedeeltelijke aanpassing. result &= SaveExtraMeterLine(rgl, BasisReplaced); if (!result) { break; } } } ////v2 //if (!BasisReplaced) //{ // //basis is hetzelfde gebleven. Alle regels die er zijn zijn toevoegingen of gedeeltelijke aanpassingen. // foreach (var rgl in InternData.Regels) // { // if (rgl.Status == StatusType.Toevoeging) // { // result &= SaveExtraMeterLine(rgl, BasisReplaced); // } // } //} //else //{ // foreach (var rgl in InternData.Regels) // { // //Extra meters moeten altijd worden opgeslagen zowel voor basis wijziging als voor gedeeltelijke aanpassing. // result &= SaveExtraMeterLine(rgl, BasisReplaced); // } //} //// } else { MessageBox.Show("Er is een fout in het totaal aantal meters. Controleer en verbeter de meters om verder te gaan."); result = false; } return(result); }
/* private void GetBlueprints() * { * // Acumulator.Instance().Blueprints.Clear(); * foreach (Ruimte r in this.offerteRuimte_.Children) * { * string path = Acumulator.Instance().GetPathGespiegeld(r.RuimteID); * * if (path != null && path != "") * { * string apath = "https://mybouwapp.nl/Images/Blueprints/" + path; * * * HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apath); * * request.UseDefaultCredentials = true; * Acumulator.Instance().updateDownActive(r.RuimteID, true); * request.BeginGetResponse(new AsyncCallback(RequestReady), request); * * } * } * }*/ //private bool lockacumu = false; /*private void RequestReady(IAsyncResult asyncResult) * { * var req = asyncResult.AsyncState as HttpWebRequest; * try * { * using (WebResponse wrs = req.EndGetResponse(asyncResult)) * { * var path = wrs.ResponseUri.ToString().Replace("https://mybouwapp.nl/Images/Blueprints/", ""); * var foo = wrs.GetResponseStream(); * * var bar = foo.CloneToMemoryStream(); * var foobar = bar.ToArray(); * while (lockacumu) * { } * lockacumu = true; * * Acumulator.Instance().BlueprintRequestReady(path, foobar, null); * lockacumu = false; * } * } * catch (Exception e) * { * var err = e; * var emsg = e.Message; * } * } */ public override void NieuwOfferte() { Acumulator.Instance().OTracker = this; offerteKavel_ = null; offerteBasis_ = null; offerteRuimte_ = null; InitData(); }
private void BW_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { Acumulator.Instance().uitvoerPlaceHolder = new UitvoerPlaceHolder() { uitvoerCreator = _uitvoerCreator, Pdfdoc = _File }; Acumulator.Instance().BusyBee.IsBusy = false; }
public void ReadXml(XmlReader reader) { reader.MoveToContent(); Pakket_ID = reader.GetAttribute("Pakket_ID"); PakketPrijsgroep_NR = reader.GetAttribute("PakketPrijsgroep_NR"); Omschrijving = reader.GetAttribute("Omschrijving"); Getsubs(Acumulator.Instance().ctx); }
public void Clear4Submit() { var curRuimte = Acumulator.Instance().BB.HuidigRuimte; curRuimte.GekozenAccenten.Clear(); curRuimte.AanvullendeMeters.Clear(); curRuimte.GekozenProfielen.RemoveAll(x => x.IsExpertMode == true); }
private PaginaBlok MakeHoekProfielBlok(Ruimte r) { var pBlok = new PaginaBlok(15); pBlok.LinkedRuimteId = r.RuimteID; pBlok.AddRegel(Environment.NewLine, Environment.NewLine, false); pBlok.AddRegel(null, "Hoekprofiel", true); var basisRegelFinished = false; List <int> accIndexDone = new List <int>(); var nabew = r.qryNabewerkingen(Acumulator.Instance().ctx); foreach (var hkprof in r.GekozenProfielen) { var scppd = nabew.Where(n => n.ID == hkprof.LinkedSubCat).FirstOrDefault() as Classes.SubCatPerPakket; if (scppd != null) { if (!basisRegelFinished) { var accHprof = r.AanvullendeMeters.FirstOrDefault(x => x.ProdSoort == ExpertControls.Models.ProductSoort.HoekProfiel && x.LinkedHoekProf.ProfielID == hkprof.ProfielID && x.RegelIndex == 0); if (accHprof != null) // basis vervangen/aangepast in accent pagina { pBlok.AddRegel(accHprof.Meters + "m", accHprof.LinkedHoekProf.Omschrijving, false); if (!String.IsNullOrEmpty(accHprof.Opmerking)) { pBlok.AddRegel(null, accHprof.Opmerking, false); } accIndexDone.Add(accHprof.RegelIndex); } else//basis nog standaard { pBlok.AddRegel(/*hkprof.Meters*/ scppd.TotaalMeters + "m", hkprof.Omschrijving, false); } basisRegelFinished = true; } else { var anvHprof = r.AanvullendeMeters.FirstOrDefault(x => x.ProdSoort == ProductSoort.HoekProfiel && x.LinkedHoekProf.ProfielID == hkprof.ProfielID && !accIndexDone.Contains(x.RegelIndex)); if (anvHprof != null) { pBlok.AddRegel(anvHprof.Meters + "m", anvHprof.LinkedHoekProf.Omschrijving, false); if (!String.IsNullOrEmpty(anvHprof.Opmerking)) { pBlok.AddRegel(null, anvHprof.Opmerking, false); } accIndexDone.Add(anvHprof.RegelIndex); pBlok.AddRegel(Environment.NewLine, Environment.NewLine, false); } } } } pBlok.AddRegel(Environment.NewLine, Environment.NewLine, false); return(pBlok); }
private bool addHoekLine(AdvancedVervangRegel rgl, bool BasisReplaced) { var result = true; var ctx = Acumulator.Instance().ctx; var curRuimte = Acumulator.Instance().BB.HuidigRuimte; var lsc = rgl.Status == StatusType.Basis ? InternData.SubCatNR : "Sub4Accent" + Ruimte.GenerateScbNr4Accent(InternData.SubCatNR).SCB_ID; var hoekprof = (from prf in ctx.Productens where prf.PD_ID == rgl.GekozenTegel.ProductId select new HoekProfiel() { ProfielID = prf.PD_ID, volgorde = (int)prf.volgorde, VerpakkingsToeslag = rgl.GekozenTegel.InstapPrijs, LinkedSubCat = lsc, Omschrijving = prf.Omschrijving, Kleur = (from kleur in ctx.Kleurens where kleur.K_ID == prf.PKC_NR select kleur.Omschrijving).FirstOrDefault().ToString(), KleurVolgorde = (from kleur in ctx.Kleurens where kleur.K_ID == prf.PKC_NR select(int) kleur.volgorde).FirstOrDefault(), KleurCode = prf.PKC_NR, Breedte = (int)prf.breedte, Lengte = (int)prf.lengte, ProfielImg = prf.ImagePath, Meters = rgl.VervangInfo.GekozenMeters, IsExpertMode = true, }).FirstOrDefault(); if (hoekprof != null) { if (rgl.Status != StatusType.Basis || BasisReplaced) { curRuimte.GekozenProfielen.Add(hoekprof); } var extMeters = new ExtraMeters { LinkedHoekProf = hoekprof, LinkedSubCat = InternData.SubCatNR, Meters = rgl.VervangInfo.GekozenMeters, RegelIndex = rgl.RegelIndex, NabewerkingSetNR = rgl.GekozenTegel.NSNR, IsBasis = rgl.Status == StatusType.Basis ? !BasisReplaced : false, Meerprijs = rgl.GekozenTegel.PrijsPerMeter, Opmerking = rgl.VervangInfo.Opmerking, ProdSoort = ProductSoort.HoekProfiel }; curRuimte.AanvullendeMeters.Add(extMeters); } return(result); }
public void LoadData() { var kavelinfo = (from k in Acumulator.Instance().ctx.Bouwnummers where k.B_ID == Acumulator.Instance().Bouwnr select k.Omschrijving).FirstOrDefault().ToString(); var proj = (from p in Acumulator.Instance().ctx.PRojects join b in Acumulator.Instance().ctx.Bouwnummers on p.PR_ID equals b.PR_NR where b.B_ID == Acumulator.Instance().Bouwnr select p.Omschrijving).FirstOrDefault(); var koper = (from b in Acumulator.Instance().ctx.Bouwnummers where b.B_ID == Acumulator.Instance().Bouwnr select b).FirstOrDefault(); InputNaam.Text = koper.KlantNaam ?? ""; InputStraat.Text = koper.adres_straat ?? ""; InputPlaats.Text = koper.adres_plaats ?? ""; InputEmail.Text = koper.email ?? ""; InputTel1.Text = koper.Telefoon1 ?? ""; InputTel2.Text = koper.Telefoon2 ?? ""; TBproject.Text = proj ?? ""; TBbouwnr.Text = kavelinfo; TBRuimte.Text = ""; foreach (var r in Acumulator.Instance().OTracker.offerteRuimte_.Children) { var spiegeld = ""; var sp = (from rpt in Acumulator.Instance().ctx.RuimtesPerTypes where rpt.R_NR == (r as Ruimte).RuimteID && rpt.T_NR == Acumulator.Instance().Type select rpt.Spiegel).FirstOrDefault(); if (sp ?? false) { spiegeld = " (Gespiegeld)"; } TBRuimte.Text += (r as Ruimte).Omschrijving + spiegeld + Environment.NewLine; } var opgeslagenOfferteLean = Acumulator.Instance().oOL; if (opgeslagenOfferteLean != null) { statusBox.SetDataSaved(); // SavedBy.Text = opgeslagenOfferteLean.gebruiker; //SavedAt.Text = opgeslagenOfferteLean.Datum.ToString("dd-MM-yyyy HH:mm:ss"); //VersieNr.Text = opgeslagenOfferteLean.VersieFull.ToString() + "." + opgeslagenOfferteLean.VersiePartial.ToString(); } else { statusBox.SetDateVoid(); //SavedAt.Text = "-"; //SavedBy.Text = "-"; //VersieNr.Text = "-"; } statusBox.InitOverzicht(); if (Acumulator.Instance().HuidigGebruiker.Rol == UserRole.Admin) { HiddenBtn.Visibility = System.Windows.Visibility.Visible; } }
private bool addDorpelLine(AdvancedVervangRegel rgl, bool BasisReplaced) { var result = true; var ctx = Acumulator.Instance().ctx; var curRuimte = Acumulator.Instance().BB.HuidigRuimte; var lsc = rgl.Status == StatusType.Basis ? InternData.SubCatNR : "Sub4Accent" + Ruimte.GenerateScbNr4Accent(InternData.SubCatNR).SCB_ID; var dorpl = (from prdct in ctx.Productens where prdct.PD_ID == rgl.GekozenTegel.ProductId select new Product() { ID = prdct.PD_ID, volgorde = (int)prdct.volgorde, VerpakkingsToeslag = rgl.GekozenTegel.InstapPrijs, //(double)prdct.verpakkingstoeslag, LinkedSubCat = lsc, LinkedMainCat = InternData.HCNR, Omschrijving = prdct.Omschrijving, Kleur = (from kleur in ctx.Kleurens where kleur.K_ID == prdct.PKC_NR select kleur.Omschrijving).FirstOrDefault().ToString(), kleurVolgorde = (from kleur in ctx.Kleurens where kleur.K_ID == prdct.PKC_NR select(int) kleur.volgorde).FirstOrDefault(), KleurCode = prdct.PKC_NR, Breedte = (int)prdct.breedte, Lengte = (int)prdct.lengte, ImgPath = prdct.ImagePath, productcode = prdct.productcode }).FirstOrDefault(); if (dorpl != null) { if (rgl.Status != StatusType.Basis || BasisReplaced) { curRuimte.GekozenAccenten.Add(dorpl); } var extMeters = new ExtraMeters { LinkedProduct = dorpl, LinkedSubCat = InternData.SubCatNR, Meters = rgl.VervangInfo.GekozenMeters, RegelIndex = rgl.RegelIndex, NabewerkingSetNR = rgl.GekozenTegel.NSNR, IsBasis = rgl.Status == StatusType.Basis ? !BasisReplaced : false, Meerprijs = rgl.GekozenTegel.PrijsPerMeter, Opmerking = rgl.VervangInfo.Opmerking, ProdSoort = ProductSoort.Dorpel }; curRuimte.AanvullendeMeters.Add(extMeters); } return(result); }
private void RetryBtn_Click_1(object sender, RoutedEventArgs e) { var bw = new BackgroundWorker(); bw.DoWork += bw_DoWork; bw.RunWorkerCompleted += bw_RunWorkerCompleted; Acumulator.Instance().BusyBee.IsBusy = true; Acumulator.Instance().BusyBee.BusyContent = "Plattegrond opnieuw aan het downloaden..."; bw.RunWorkerAsync(); }
private void bw_DoWork(object sender, DoWorkEventArgs e) { var holder = Acumulator.Instance().bluePrintManager.RetryDownload(ruimteID); while (holder.statusInfo != Helpers.BluePrintStatus.Complete && holder.statusInfo != Helpers.BluePrintStatus.Failed) { System.Threading.Thread.Sleep(500); } }