Example #1
0
        /// <summary>
        /// De Load die hij uitvoerd als je de form opent.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormBekijkenprofiel_Load(object sender, EventArgs e)
        {
            var gebruiker = GebruikerManager.GebruikerOpvragen(UserId);

            Naam.Text  = gebruiker.voornaam + " " + gebruiker.achternaam;
            this.Text  = "Profiel van " + gebruiker.voornaam + " " + gebruiker.achternaam;
            Adres.Text = gebruiker.woonplaats;
            if (gebruiker.oppassen && gebruiker.uitlaten == false)
            {
                OppassenUitlatenLabel.Text = "Kan passen op:";
            }
            else if (gebruiker.oppassen == false && gebruiker.uitlaten)
            {
                OppassenUitlatenLabel.Text = "Kan de volgende dieren uitlaten:";
            }
            else if (gebruiker.oppassen && gebruiker.uitlaten)
            {
                OppassenUitlatenLabel.Text = "Kan op de volgende dieren passen en is bereid om ze uit te laten:";
            }
            Kanpassenop.Text = gebruiker.diertypes;
            Overmijinfo.Text = gebruiker.overmij;
            Prijs.Text       = "Prijs per dag: €" + gebruiker.vraagprijs;
            //Rating
            Bitmap[] Ster = new Bitmap[6]
            {
                Properties.Resources.ster0, Properties.Resources.ster1, Properties.Resources.ster2, Properties.Resources.ster3, Properties.Resources.ster4, Properties.Resources.ster5
            };
            RatingPictureBox.Image = Ster[ReviewManager.BerekenRating(UserId)];
            //Profielfoto
            Profielfoto.Image = ProfielfotoManager.getProfielfoto(gebruiker.userid);
            // LogedIn features weg halen
            if (!LoginCheck())
            {
                List <Control> ReviewPItems = new List <Control>()
                {
                    TitelLabel, BodyLabel, SchrijfhierLabel, OLijnLabel, ASterLabel, RtitelTextBox, RbodyTextBox,
                    Ster1CheckBox, Ster2CheckBox, Ster3CheckBox, Ster4CheckBox, Ster5CheckBox, PReviewButton, DiscardButton
                };

                foreach (var Item in ReviewPItems)
                {
                    Item.Visible = false;
                }
            }
            //reviews laden
            ReviewLoad();
        }
Example #2
0
        public void NaarZoeken()
        {
            FormHome.Home.panelH.Controls.Clear();
            FormHome.Home.panelH.Controls.Add(FormHome.CZH);
            FormHome.Home.panelB.Controls.Clear();
            FormHome.Home.panelB.Controls.Add(FormHome.CZB);
            FormHome.Home.SetFullscreenMode(false);
            CZH.pictureBoxProfiel.Visible = SessionManager.IsLoggedIn();
            CZH.label2.Visible            = SessionManager.IsLoggedIn();
            CZH.pictureBoxAdmin.Visible   = false;
            CZH.label4.Visible            = false;
            if (SessionManager.IsLoggedIn())
            {
                CZH.label2.Text                = ((Gebruiker)SessionManager.GetCurrentUser()).voornaam;
                CZH.pictureBoxProfiel.Image    = ProfielfotoManager.getProfielfoto(((Gebruiker)SessionManager.GetCurrentUser()).userid);
                CZH.pictureBoxProfiel.SizeMode = PictureBoxSizeMode.StretchImage;

                CZH.pictureBoxAdmin.Visible = ((Gebruiker)SessionManager.GetCurrentUser()).admin;
                CZH.label4.Visible          = ((Gebruiker)SessionManager.GetCurrentUser()).admin;
            }
        }
Example #3
0
        /// <summary>
        /// Plaatst de review aan de hand van het positie nummer en andere parameters.
        /// </summary>
        /// <param name="review"></param>
        /// <param name="pos"></param>
        public void ReviewPlaatser(Review review, int pos)
        {
            int BlokY = (pos * 220);
            int Y     = 0;

            if (!OwnReview())
            {
                Y = 800;
            }
            //if (LoginCheck() )
            else
            {
                Y = 525;
            }

            // "FIX" een feature van windows forms waar posities relatief zijn tot de autoscroll positie
            // PS. Dit is bonkers irritant en we hebben hier minstens 1,5 uur naar gezocht
            Y = Y + panel1.AutoScrollPosition.Y;

            int DBY = 694 + panel1.AutoScrollPosition.Y;

            DiscardButton.Location = new Point(172, DBY);

            //
            // RnameLabel
            //
            var RnameLabel = new Label();

            RnameLabel.Font     = new Font("Microsoft Sans Serif", 10.2F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            RnameLabel.Location = new Point(268, 96 + Y + BlokY);
            RnameLabel.Name     = "RnameLabel";
            RnameLabel.Size     = new Size(157, 34);
            RnameLabel.TabIndex = 90;
            RnameLabel.Text     = GebruikerManager.GebruikerOpvragen(review.reviewerid).voornaam + " " + GebruikerManager.GebruikerOpvragen(review.reviewerid).achternaam;
            panel1.Controls.Add(RnameLabel);
            LoadedReviews.Add(RnameLabel);
            //
            // RSterPictureBox
            //
            Bitmap[] Ster = new Bitmap[6]
            {
                Properties.Resources.ster0, Properties.Resources.ster1, Properties.Resources.ster2, Properties.Resources.ster3, Properties.Resources.ster4, Properties.Resources.ster5
            };
            var RSterPictureBox = new PictureBox();

            RSterPictureBox.Location = new Point(267, 62 + Y + BlokY);
            RSterPictureBox.Name     = "RSterPictureBox";
            RSterPictureBox.Size     = new Size(157, 31);
            RSterPictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
            RSterPictureBox.TabIndex = 88;
            RSterPictureBox.TabStop  = false;
            RSterPictureBox.Image    = Ster[review.rating];
            panel1.Controls.Add(RSterPictureBox);
            LoadedReviews.Add(RSterPictureBox);
            //
            // RProfilePictureBox
            //
            var RProfilePictureBox = new PictureBox();

            RProfilePictureBox.InitialImage = null;
            RProfilePictureBox.Location     = new Point(172, 62 + Y + BlokY);
            RProfilePictureBox.Name         = "RProfilePictureBox";
            RProfilePictureBox.Size         = new Size(90, 90);
            RProfilePictureBox.SizeMode     = PictureBoxSizeMode.StretchImage;
            RProfilePictureBox.TabIndex     = 87;
            RProfilePictureBox.TabStop      = false;
            RProfilePictureBox.Image        = ProfielfotoManager.getProfielfoto(review.reviewerid);
            panel1.Controls.Add(RProfilePictureBox);
            LoadedReviews.Add(RProfilePictureBox);
            //
            // RTitelLabel
            //
            var RTitelLabel = new Label();

            RTitelLabel.Font     = new Font("Microsoft Sans Serif", 15F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            RTitelLabel.Location = new Point(427, 64 + Y + BlokY);
            RTitelLabel.Name     = "RTitelLabel";
            RTitelLabel.Size     = new Size(374, 23);
            RTitelLabel.TabIndex = 86;
            RTitelLabel.Text     = review.title;
            panel1.Controls.Add(RTitelLabel);
            LoadedReviews.Add(RTitelLabel);
            //
            // RBodyLabel
            //
            var RBodyLabel = new Label();

            RBodyLabel.Font     = new Font("Microsoft Sans Serif", 10.2F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            RBodyLabel.Location = new Point(427, 94 + Y + BlokY);
            RBodyLabel.Name     = "RBodyLabel";
            RBodyLabel.Size     = new Size(374, 158);
            RBodyLabel.TabIndex = 72;
            RBodyLabel.Text     = review.body;
            panel1.Controls.Add(RBodyLabel);
            LoadedReviews.Add(RBodyLabel);
        }
Example #4
0
        public void MaakResultaat(Gebruiker gebruiker, int pos)
        {
            //Globale variabelen
            int H       = 100;
            int W       = 400;
            int posX    = Convert.ToInt32(500 - 0.5 * W);
            int posY    = 0;
            int bufferY = 15;
            int bufferX = 10;

            //Per blok variabelen
            int blokX = posX;
            int blokY = posY + H * pos;

            //
            // ResultaatLabel
            //
            var ResultaatLabel = new Label();

            ResultaatLabel.Click += delegate
            {
                profiel_ClickEvent(gebruiker);
            };
            ResultaatLabel.AutoSize = true;
            ResultaatLabel.Font     = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            ResultaatLabel.Location = new Point(blokX + 70 + bufferX, blokY + bufferY);
            ResultaatLabel.Name     = "ResultaatLabel";
            ResultaatLabel.Size     = new Size(180, 20);
            ResultaatLabel.TabIndex = 57;
            ResultaatLabel.Text     = gebruiker.voornaam + " " + gebruiker.achternaam;
            panel.Controls.Add(ResultaatLabel);
            ResultaatList.Add(ResultaatLabel);
            //
            // ProfielFotoPictureBox
            //
            var ProfielFotoPictureBox = new PictureBox();

            ProfielFotoPictureBox.Click += delegate
            {
                profiel_ClickEvent(gebruiker);
            };
            ProfielFotoPictureBox.Location = new Point(blokX, blokY + bufferY);
            ProfielFotoPictureBox.Name     = "ProfielFotoPictureBox";
            ProfielFotoPictureBox.Size     = new Size(70, 70);
            ProfielFotoPictureBox.TabIndex = 58;
            ProfielFotoPictureBox.TabStop  = false;
            ProfielFotoPictureBox.Image    = ProfielfotoManager.getProfielfoto(gebruiker.userid);
            ProfielFotoPictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
            panel.Controls.Add(ProfielFotoPictureBox);
            ResultaatList.Add(ProfielFotoPictureBox);
            //
            // OppassenUitlaten
            //
            string verzorgen        = "";
            var    OppassenUitlaten = new Label();

            OppassenUitlaten.Click += delegate
            {
                profiel_ClickEvent(gebruiker);
            };
            OppassenUitlaten.AutoSize = true;
            OppassenUitlaten.Location = new Point(blokX + 70 + bufferX, blokY + bufferY + 20);
            OppassenUitlaten.Name     = "OppassenUitlaten";
            OppassenUitlaten.Size     = new Size(136, 13);
            OppassenUitlaten.TabIndex = 59;
            if (gebruiker.oppassen && gebruiker.uitlaten == false)
            {
                verzorgen = " verzorgen.";
            }
            else if (gebruiker.oppassen == false && gebruiker.uitlaten)
            {
                verzorgen = " uitlaten.";
            }
            else if (gebruiker.oppassen && gebruiker.uitlaten)
            {
                verzorgen = " verzorgen en uitlaten.";
            }
            OppassenUitlaten.Text = "Kan een " + gebruiker.diertypes + verzorgen;
            panel.Controls.Add(OppassenUitlaten);
            ResultaatList.Add(OppassenUitlaten);
            //
            // RatingPictureBox
            //
            var RatingPictureBox = new PictureBox();

            RatingPictureBox.Click += delegate
            {
                profiel_ClickEvent(gebruiker);
            };
            RatingPictureBox.Location = new Point(blokX + 70 + bufferX, blokY + bufferY + 20 + 15 + 15);
            RatingPictureBox.Name     = "RatingPictureBox";
            RatingPictureBox.Size     = new Size(100, 20);
            RatingPictureBox.TabIndex = 60;
            RatingPictureBox.TabStop  = false;
            Bitmap[] images = new Bitmap[] { Properties.Resources.ster0, Properties.Resources.ster1,
                                             Properties.Resources.ster2, Properties.Resources.ster3, Properties.Resources.ster4, Properties.Resources.ster5 };
            RatingPictureBox.Image    = images[ReviewManager.BerekenRating(gebruiker.userid)];
            RatingPictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
            panel.Controls.Add(RatingPictureBox);
            ResultaatList.Add(RatingPictureBox);
            //
            // VerifiedPicktureBox
            //
            if (gebruiker.verified)
            {
                var VerifiedPicktureBox = new PictureBox();
                VerifiedPicktureBox.Click += delegate
                {
                    profiel_ClickEvent(gebruiker);
                };
                VerifiedPicktureBox.Location = new Point(blokX + 70 + bufferX + ResultaatLabel.Width, blokY + bufferY);
                VerifiedPicktureBox.Name     = "VerifiedPicktureBox";
                VerifiedPicktureBox.Size     = new Size(20, 20);
                VerifiedPicktureBox.TabIndex = 61;
                VerifiedPicktureBox.TabStop  = false;
                VerifiedPicktureBox.Image    = Properties.Resources.checkbox;
                VerifiedPicktureBox.SizeMode = PictureBoxSizeMode.StretchImage;
                panel.Controls.Add(VerifiedPicktureBox);
                ResultaatList.Add(VerifiedPicktureBox);
            }
            //
            // Locatielabel
            //
            var Locatielabel = new Label();

            Locatielabel.Click += delegate
            {
                profiel_ClickEvent(gebruiker);
            };
            Locatielabel.AutoSize = true;
            Locatielabel.Location = new Point(blokX + 70 + bufferX, blokY + bufferY + 20 + 15);
            Locatielabel.Name     = "Locatielabel";
            Locatielabel.Size     = new Size(51, 13);
            Locatielabel.TabIndex = 62;
            Locatielabel.Text     = gebruiker.woonplaats + " - €" + gebruiker.vraagprijs + " per dag";
            panel.Controls.Add(Locatielabel);
            ResultaatList.Add(Locatielabel);
        }