コード例 #1
0
        public bool SubmitPressed()
        {
            bool retval = false;

            if (KiesProject)
            {
                if (ProjectNrCbb.SelectedIndex > -1)
                {
                    ProjErrorLbl.Text = String.Empty;
                    Acumulator.Instance().Projectnr = (string)ProjectNrCbb.SelectedValue;
                }
                else
                {
                    ProjErrorLbl.Text = "Geen Project geselecteerd.";
                    retval            = false;
                }
            }
            if (KiesBouwnummer)
            {
                if (BouwNrCbb.SelectedIndex > -1)
                {
                    BouwErrorLbl.Text = String.Empty;
                    Acumulator.Instance().Bouwnr = (string)BouwNrCbb.SelectedValue;
                    Acumulator.Instance().oOL    = (BouwNrCbb.SelectedItem as BouwnummerItem).oOL;
                    retval = true;
                }
                else
                {
                    BouwErrorLbl.Text = "Geen bouwnummer geselecteerd.";
                    retval            = false;
                }
            }
            return(retval);
        }
コード例 #2
0
 private void LogouBtn_Click(object sender, RoutedEventArgs e)
 {
     infoBar.Visibility = Visibility.Collapsed;
     infoBar.Clear4Submit();
     LogouBtn.Visibility     = Visibility.Collapsed;
     LoginBtn.Visibility     = Visibility.Visible;
     infoBar.Visibility      = Visibility.Collapsed;
     NewUserBtn.Visibility   = Visibility.Collapsed;
     SwitchBnrBtn.Visibility = Visibility.Collapsed;
     AfspraakBtn.Visibility  = Visibility.Collapsed;
     ControlHolder.Children.Clear();
     Acumulator.Instance().uitvoerPlaceHolder = null;
     Acumulator.Instance().SavedXml           = null;
     Acumulator.Instance().bluePrintManager.ClearAll();
     //Acumulator.Instance().HuidigRuimteSetKey.Clear();
     //Acumulator.Instance().TekeningBijRuimte.Clear();
     Acumulator.Instance().clearDownloadsActive();
     Acumulator.Instance().oOL = null;
     ControlHolder.Children.Add(new TextBlock()
     {
         Text = "U bent nu uitgelogd"
     });
     WebContext.Current.Authentication.Logout(false);
     LogHelper.SendLog("Log out User: " + Acumulator.Instance().HuidigGebruiker.GebruikersNaam, LogType.activity);
 }
コード例 #3
0
        void loginWnd_Closed(object sender, EventArgs e)
        {
            ControlHolder.Children.Clear();
            LoginWindow lw = (LoginWindow)sender;

            if (lw.DialogResult == true && lw.NaamBox.Text != string.Empty)
            {
                LoginBtn.Visibility = Visibility.Collapsed;
                LogouBtn.Visibility = Visibility.Visible;
                Acumulator.Instance().GebruikersNaam = lw.NaamBox.Text;
                ControlHolder.Children.Add(new TextBlock()
                {
                    Text = "Welkom " + lw.NaamBox.Text, FontSize = 18
                });
                TimeOut.SetTimeout(500, () =>
                {
                    startBorchure();
                });
            }
            else if (lw.DialogResult == false)
            {
                ControlHolder.Children.Add(new TextBlock()
                {
                    Text = "Login geannuleerd.", FontSize = 18
                });
            }
        }
コード例 #4
0
        public void WriteXml(XmlWriter writer)
        {
            writer.WriteAttributeString("Omschrijving", Omschrijving);
            foreach (Ruimte r in Children)
            {
                writer.WriteStartElement("Ruimte");
                r.WriteXml(writer);
                writer.WriteEndElement();
            }

            var list = Acumulator.Instance().BB.MakeCompleteList();

            if (list.Count > 0)
            {
                writer.WriteStartElement("CompleetLijst");
                int cntr = 0;
                foreach (string c in list)
                {
                    writer.WriteAttributeString("C" + cntr.ToString(), c);
                    cntr++;
                }
                writer.WriteAttributeString("Count", cntr.ToString());
                writer.WriteEndElement();
            }
            if (Korting != null)
            {
                writer.WriteStartElement("KortingInfo");
                Korting.WriteXml(writer);
                writer.WriteEndElement();
            }
        }
コード例 #5
0
 public void WijzigPressed()
 {
     Acumulator.Instance().BB.InvalidateNaWijzig();
     foreach (IBaseControl BC in SubContPanel.Children)
     {
         BC.WijzigPressed();
     }
 }
コード例 #6
0
 public static Acumulator Instance()
 {
     if (_instance == null)
     {
         _instance = new Acumulator();
     }
     return(_instance);
 }
コード例 #7
0
 public StartPagina()
 {
     InitializeComponent();
     ControlHolder.Children.Add(new TextBlock()
     {
         Text = "Login om te beginnen met de online tegelbrochure"
     });
     Acumulator.Instance().InfoBar     = infoBar;
     Acumulator.Instance().StartPagina = this;
     infoBar.Visibility = Visibility.Collapsed;
 }
コード例 #8
0
        private void loadProj(UserRole ur)
        {
            eBrochureDomainContext ctx;

            if (Acumulator.Instance().ctx == null)
            {
                ctx = new eBrochureDomainContext();
                Acumulator.Instance().ctx = ctx;
            }
            else
            {
                ctx = Acumulator.Instance().ctx;
            }

            if (ur == UserRole.Admin)
            {
                ctx.Load(ctx.GetPRojectQuery()).Completed += (sender, args) =>
                {
                    ProjectNrCbb.ItemsSource       = ctx.PRojects;
                    ProjectNrCbb.SelectedValuePath = "PR_ID";
                    ProjectNrCbb.DisplayMemberPath = "Omschrijving";
                    KiesProject = true;
                };
            }
            else if (ur == UserRole.Adviseur || ur == UserRole.Demo || ur == UserRole.Showroom)
            {
                ctx.Load(ctx.GetPRojectQuery()).Completed += (sender1, args1) =>
                {
                    ctx.Load(ctx.GetGebruikersQuery()).Completed += (sender2, args2) =>
                    {
                        ctx.Load(ctx.GetProjectSetOpbouwQuery()).Completed += (sender, args) =>
                        {
                            var pros = (from p in ctx.PRojects
                                        join pso in ctx.ProjectenSetOpbouws on p.PR_ID equals pso.Project_NR
                                        join g in ctx.Gebruikers on pso.ProjectenSet_NR equals g.ProjectenSet_NR
                                        where g.GebruikersID == Acumulator.Instance().HuidigGebruiker.ID
                                        select p).ToList();

                            ProjectNrCbb.ItemsSource       = pros;
                            ProjectNrCbb.SelectedValuePath = "PR_ID";
                            ProjectNrCbb.DisplayMemberPath = "Omschrijving";
                            KiesProject = true;
                            if (ProjectNrCbb.Items.Count == 1)
                            {
                                ProjectNrCbb.SelectedIndex = 0;
                                ProjectNrCbb.IsEnabled     = false;
                                //ProjectNrCbb.Visibility = System.Windows.Visibility.Collapsed;
                                //projlabel.Visibility = System.Windows.Visibility.Collapsed;
                            }
                        };
                    };
                };
            }
        }
コード例 #9
0
        public virtual TvNode MakeTree(TvNode TreeCollection)
        {
            List <TvNode> Childs = new List <TvNode>();

            foreach (IOfferte of in Children)
            {
                Childs.Add(of.MakeTree(null));
            }
            var thisnode = new TvNode(this.GetType().Name, "ID" + Acumulator.GetNodeID(), this.GetType().Name, Childs, TreeCollection);

            return(thisnode);
        }
コード例 #10
0
 private void SwitchBnrFunc()
 {
     Acumulator.Instance().bluePrintManager.ClearAll();
     //Acumulator.Instance().ClearBouwnummer();
     Acumulator.Instance().uitvoerPlaceHolder = null;
     Acumulator.Instance().SavedXml           = null;
     //Acumulator.Instance().HuidigRuimteSetKey.Clear();
     //Acumulator.Instance().TekeningBijRuimte.Clear();
     Acumulator.Instance().clearDownloadsActive();
     Acumulator.Instance().oOL = null;
     infoBar.Clear4Submit();
     startBorchure();
 }
コード例 #11
0
        public override TvNode MakeTree(TvNode TreeNode)
        {
            List <TvNode> Childs = new List <TvNode>();

            foreach (IOfferte of in Children)
            {
                Childs.Add(of.MakeTree(TreeNode));
            }
            Childs.Add(new TvNode("Tot slot", "ID" + Acumulator.GetNodeID(), "FinalStage", null, null));
            //TreeNode.Children.AddRange(Childs);
            Acumulator.Instance().BB.treeView1.ItemsSource = Childs;
            return(null);
        }
コード例 #12
0
        public void LoadBnrListbox(List <OpgeslagenOfferteLean> oOs)
        {
            var ctx = Acumulator.Instance().ctx;
            List <BouwnummerItem> source;

            if (Acumulator.Instance().HuidigGebruiker.Rol == UserRole.Showroom)
            {
                /*var foo = (from g in ctx.Gebruikers
                 *          where g.GebruikersID == Acumulator.Instance().HuidigGebruiker.ID
                 *          select g.BouwnummerSet_NR).FirstOrDefault();
                 * var bar = (from bso in ctx.BouwnummerSetOpbouws
                 *          where bso.BouwnummerSet_NR == foo
                 *          select bso.Bouwnummer_NR).ToList();
                 * var foobar = (from bnr in ctx.Bouwnummers
                 *              where bar.Contains(bnr.B_ID)
                 *              select bnr).ToList();*/

                source = (from bnr in ctx.Bouwnummers
                          join bso in ctx.BouwnummerSetOpbouws on bnr.B_ID equals bso.Bouwnummer_NR
                          join g in ctx.Gebruikers on bso.BouwnummerSet_NR equals g.BouwnummerSet_NR
                          join tp in ctx.bouwTypes on bnr.T_NR equals tp.T_ID


                          where g.GebruikersID == Acumulator.Instance().HuidigGebruiker.ID
                          select new BouwnummerItem(bnr.B_ID, bnr.Omschrijving, bnr.VerkoopStatus != null ? bnr.VerkoopStatus.StatusNaam : "", tp.Omschrijving, oOs.Where(x => x.B_ID == bnr.B_ID).FirstOrDefault())).ToList();
            }
            else
            {
                source = (from bnr in ctx.Bouwnummers
                          join tp in ctx.bouwTypes on bnr.T_NR equals tp.T_ID


                          where bnr.PR_NR == ProjectNrCbb.SelectedValue.ToString()
                          select new BouwnummerItem(bnr.B_ID, bnr.Omschrijving, bnr.VerkoopStatus != null ? bnr.VerkoopStatus.StatusNaam : "", tp.Omschrijving, oOs.Where(x => x.B_ID == bnr.B_ID).FirstOrDefault())).ToList();
            }
            Helpers.CustomComparer <BouwnummerItem> comp = new Helpers.CustomComparer <BouwnummerItem>();
            source.Sort(comp);
            BouwNrCbb.Items.Clear();
            foreach (var x in source)
            {
                BouwNrCbb.Items.Add(x);
            }
            //     BouwNrCbb.ItemsSource = source;
            BouwNrCbb.SelectedValuePath = "B_ID";
            LoadingMsg.Visibility       = System.Windows.Visibility.Collapsed;
            if (BouwNrCbb.Items.Count > 0)
            {
                BouwNrCbb.Visibility = System.Windows.Visibility.Visible;
            }
        }
コード例 #13
0
        private SubPage SwitchStart4User()
        {
            SubPage sp = new SubPage();

            switch (Acumulator.Instance().HuidigGebruiker.Rol)
            {
            case UserRole.Admin:
                sp.Titel = "Kies Project en Bouwnummer";
                sp.Addcontrol(new InputBouwNr(Acumulator.Instance().HuidigGebruiker.Rol));
                NewUserBtn.Visibility   = Visibility.Visible;
                SwitchBnrBtn.Visibility = Visibility.Visible;
                AfspraakBtn.Visibility  = Visibility.Visible;
                break;

            case UserRole.Showroom:
            case UserRole.Demo:
            case UserRole.Adviseur:
                sp.Titel = "Kies Bouwnummer";
                sp.Addcontrol(new InputBouwNr(Acumulator.Instance().HuidigGebruiker.Rol));
                SwitchBnrBtn.Visibility = Visibility.Visible;
                AfspraakBtn.Visibility  = Visibility.Visible;
                break;

            case UserRole.Bewoner:
                var ctx = new eBrochureDomainContext();
                Acumulator.Instance().ctx = ctx;
                ctx.Load(ctx.GetGebruikersQuery()).Completed += (sender, args) =>
                {
                    ctx.Load(ctx.GetBouwnummerSetOpbouwQuery()).Completed += (sender2, args2) =>
                    {
                        ctx.Load(ctx.GetBouwnummersQuery()).Completed += (sender3, args3) =>
                        {
                            var bnr = (from b in ctx.BouwnummerSetOpbouws
                                       join g in ctx.Gebruikers on b.BouwnummerSet_NR equals g.BouwnummerSet_NR
                                       join baseb in ctx.Bouwnummers on b.Bouwnummer_NR equals baseb.B_ID
                                       where g.Naam.ToLower() == Acumulator.Instance().GebruikersNaam.ToLower()
                                       select new { b.Bouwnummer_NR, baseb.PR_NR }).FirstOrDefault();
                            Acumulator.Instance().Bouwnr    = bnr.Bouwnummer_NR;
                            Acumulator.Instance().Projectnr = bnr.PR_NR;
                            BB.GeenInputBouwnummer();
                        };
                    };
                };
                AfspraakBtn.Visibility = Visibility.Visible;
                break;
            }
            return(sp);
        }
コード例 #14
0
        public RuimteOfferte()
        {
            var tp = Acumulator.Instance().Type;

            if (tp != null)
            {
                var oms = (from bt in Acumulator.Instance().ctx.bouwTypes
                           where bt.T_ID == tp
                           select bt.Soort).FirstOrDefault().ToString();
                Omschrijving = oms;

                qryRuimtes(Acumulator.Instance().Type, Acumulator.Instance().ctx);
                //Acumulator.Instance().BB.reload_tree();
                //Acumulator.Instance().OTracker.VerderBouwen();
            }
        }
コード例 #15
0
        public override TvNode MakeTree(TvNode TreeNode)
        {
            List <TvNode> Childs = new List <TvNode>();
            var           bnr    = "";

            if (Acumulator.Instance().Bouwnr != null)
            {
                bnr = (from b in Acumulator.Instance().ctx.Bouwnummers
                       where b.B_ID == Acumulator.Instance().Bouwnr
                       select b.Omschrijving).FirstOrDefault();
            }
            var thisnode = new TvNode("Overzicht: " + bnr, "ID" + Acumulator.GetNodeID(), this.GetType().Name, Childs, TreeNode);

            foreach (IOfferte of in Children)
            {
                Childs.Add(of.MakeTree(thisnode));
            }
            thisnode.Children = Childs;
            return(thisnode);
        }
コード例 #16
0
        private void ProjectNrCbb_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            LoadingMsg.Visibility = System.Windows.Visibility.Visible;
            BouwNrCbb.Visibility  = System.Windows.Visibility.Collapsed;
            if (ProjectNrCbb.Items.Count > 0 && ProjectNrCbb.SelectedItem != null)
            {
                GemaakteKeuze.Text = (ProjectNrCbb.SelectedItem as PRoject).Omschrijving;
            }
            if (ProjectNrCbb.SelectedIndex > -1)
            {
                BouwNrCbb.Items.Clear();
                eBrochureDomainContext ctx;
                if (Acumulator.Instance().ctx != null)
                {
                    ctx = Acumulator.Instance().ctx;

                    ctx.Load(ctx.GetBouwnummersQuery()).Completed += (sender1, args) =>
                    {
                        ctx.Load(ctx.GetBouwnummerSetOpbouwQuery()).Completed += (sender2, args2) =>
                        {
                            ctx.Load(ctx.GetBouwTypesQuery()).Completed += (sender3, args3) =>
                            {
                                ctx.Load(ctx.GetVerkoopStatusQuery()).Completed += (sender01, args01) =>
                                {
                                    List <OpgeslagenOfferteLean> oOs;
                                    ctx.OpgeslagenOffertes.Clear();
                                    ctx.GetOpgeslagenOfferteLean(operation =>
                                    {
                                        oOs = operation.Value;
                                        if (oOs != null)
                                        {
                                            LoadBnrListbox(oOs);
                                        }
                                    }, null);
                                };
                            };
                        };
                    };
                }
            }
        }
コード例 #17
0
 private void HandleCompletionEvent(object sender, EventArgs e)
 {
     try
     {
         if (_op.HasError)
         {
             MessageBox.Show(_op.Error.Message.ToString());
             this.DialogResult = false;
             LogHelper.SendLog("Login Failed: " + _op.Error.Message.ToString(), LogType.error);
         }
         else if (_op.User != null && _op.User.Identity.IsAuthenticated)
         {
             eBrochureDomainContext ctx = new eBrochureDomainContext();
             ctx.Load(ctx.GetGebruikersQuery()).Completed += (args, sender0) =>
             {
                 var gebr = (from g in ctx.Gebruikers
                             where g.Naam.ToLower() == NaamBox.Text.ToLower()
                             select new LoggedInUser()
                 {
                     GebruikersNaam = g.Naam, Rol = (UserRole)g.Rol_NR, ID = g.GebruikersID
                 }).FirstOrDefault();
                 Acumulator.Instance().HuidigGebruiker = gebr;
                 this.DialogResult = true;
                 LogHelper.SendLog("Login by User: "******" - " + gebr.Rol.ToString(), LogType.activity);
                 LogHelper.SendLog("Site accessed from: " + Application.Current.Resources["ClientIP"] + " by user: "******"Login Failed", LogType.error);
             this.DialogResult = false;
         }
         this._op         = null;
         BusyIndie.IsBusy = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Handle Complete Catched: " + ex.Message);
     }
 }
コード例 #18
0
        private void LoadAfspraken()
        {
            var afspMaker = new AfspraakMaker();

            afspMaker.ReloadData();
            //var AfspraakSet = AfspraakBase.LoadAfspraken();

            if (afspMaker != null && !String.IsNullOrEmpty(Acumulator.Instance().Projectnr))
            {
                //afspMaker.SetContext(AfspraakSet);
                var holder = new DetailsWindow();
                afspMaker.DwParent = holder;
                holder.Width       = 820;
                holder.Height      = 500;
                holder.LoadContent(afspMaker);
                holder.Show();
            }
            else
            {
                //text select project first
                MessageBox.Show("Geen Project geselecteerd!");
            }
        }
コード例 #19
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            HttpWebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);
            HttpWebRequest.RegisterPrefix("https://", WebRequestCreator.ClientHttp);
            // This will enable you to bind controls in XAML to WebContext.Current properties.
            this.Resources.Add("WebContext", WebContext.Current);
            JavaScriptMethods JSM = new JavaScriptMethods();

            HtmlPage.RegisterScriptableObject("JSM", JSM);
            // This will automatically authenticate a user when using Windows authentication or when the user chose "Keep me signed in" on a previous login attempt.
            //WebContext.Current.Authentication.LoadUser(this.Application_UserLoaded, null);
            eBrochure_zeebregts.Web.Services.eBrochureDomainContext ctx = new Web.Services.eBrochureDomainContext();


            ((WebDomainClient <eBrochure_zeebregts.Web.Services.eBrochureDomainContext.IeBrochureDomainServiceContract>)ctx.DomainClient).ChannelFactory.Endpoint.Binding.OpenTimeout = new TimeSpan(0, 10, 0);
            Acumulator.Instance().ctx = ctx;
            this.Resources.Add("ClientIP", e.InitParams["ClientIP"]);
            //   var ipaddress = e.InitParams["ClientIP"];
            //    MessageBox.Show(ipaddress + "::" + hostipaddres);
            // Acumulator.Instance().ClientIP = ipaddress;

            // Show some UI to the user while LoadUser is in progress
            this.InitializeRootVisual();
        }
コード例 #20
0
 public KavelOfferte()
 {
     BouwNummer = Acumulator.Instance().Bouwnr;
     Type       = Acumulator.Instance().Type = qryType(Acumulator.Instance().ctx);
 }