Example #1
0
        protected void BttnPlRev_Click(object sender, EventArgs e)
        {
            string             titel         = TxtBxTitel.Text;
            string             inhoud        = TxtBxInhoud.Text;
            AdministratieClass administratie = (AdministratieClass)Session["administratie"];
            ProductClass       product       = (ProductClass)Session["product"];

            //voor test
            AdresClass   adres = new AdresClass("Smirnofstraat", "5", "Den Bosch");
            AccountClass a     = new GeregistreerdeClass(1, "BarrieVanDerSloot", Convert.ToDateTime("05-02-89"), Geslacht.Man, adres, "Ramenwasser", "Media Design", "*****@*****.**", "beestje445", AbbonementClass.Gratis, Modstatus.Actief, "UniqueBarber");

            try
            {
                product.ToevoegenReview(a.AccountId, titel, inhoud);
            }
            catch (Exception)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Het toevoegen van het review is niet gelukt." + "');", true);
                return;
            }

            List <ReviewClass> reviews = new List <ReviewClass>();

            product.Ophalenreviews(product);
            reviews            = product.Reviews;
            Session["reviews"] = reviews;

            Server.Transfer("product.aspx");
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ProductClass product = (ProductClass)Session["product"];

            if (!IsPostBack)
            {
                LblAparaat.Text   = product.Aparaat;
                LblCategorie.Text = Convert.ToString(product.Categorie);
                LblMerk.Text      = product.Merk;
                LblPrijs.Text     = Convert.ToString(product.Prijs);
                LblSerie.Text     = product.Serie;
                LblVersie.Text    = product.Versie;

                List <ReviewClass> reviews = new List <ReviewClass>();
                if ((List <ReviewClass>)Session["reviews"] != null)
                {
                    reviews = (List <ReviewClass>)Session["reviews"];
                    LstBxProduct.Items.Clear();
                    foreach (ReviewClass review in reviews)
                    {
                        LstBxProduct.Items.Add(review.ToString());
                    }
                }
            }
        }
Example #3
0
 public ReviewClass(string inhoud, int reviewId, string titel, DateTime geplaatstOp
                    , ProductClass product, AccountClass account)
 {
     this.Inhoud      = inhoud;
     this.ReviewId    = reviewId;
     this.Titel       = titel;
     this.GeplaatstOp = geplaatstOp;
     this.Commentaren = new List <CommentaarClass>();
     this.Product     = product;
     this.Account     = account;
     this.Data        = new Databasemanager();
 }
Example #4
0
        protected void BttnSelecteer_Click(object sender, EventArgs e)
        {
            List <ProductClass> producten = (List <ProductClass>)Session["producten"];
            int                selectieNr = LstBxResultaat.SelectedIndex;
            ProductClass       product    = producten[selectieNr];
            List <ReviewClass> reviews    = new List <ReviewClass>();

            product.Ophalenreviews(product);
            reviews            = product.Reviews;
            Session["reviews"] = reviews;
            Session["product"] = product;
            Session.Contents.Remove("producten");
            Server.Transfer("product.aspx");
        }
Example #5
0
        public void Ophalenreviews(ProductClass product)
        {
            List <List <string> > reviewstrings = data.OphalenReviews(Convert.ToInt32(productId));

            // de data zou een profiel erbij moeten geven

            foreach (List <string> reviewstring in reviewstrings)
            {
                List <string> accounttrings    = data.AccountOphalenAccountId(Convert.ToInt32(reviewstring[1]));
                List <string> werknemerstrings = data.ZoekWerknemer(Convert.ToInt32(reviewstring[1]));

                Geslacht geslacht = Geslacht.Man;
                if (accounttrings[3] == "n")
                {
                    geslacht = Geslacht.Man;
                }
                else
                {
                    geslacht = Geslacht.Vrouw;
                }
                AbbonementClass abbonement = AbbonementClass.Gratis;
                if (accounttrings[11] == "Free")
                {
                    abbonement = AbbonementClass.Gratis;
                }
                else
                {
                    abbonement = AbbonementClass.Bannervrij;
                }
                AdresClass adres = new AdresClass(accounttrings[4], accounttrings[5], accounttrings[6]);

                if (werknemerstrings.Count == 0)
                {
                    GeregistreerdeClass geregistreerde = new GeregistreerdeClass(Convert.ToUInt32(accounttrings[0]), accounttrings[1], Convert.ToDateTime(accounttrings[2]), geslacht, adres, accounttrings[7], accounttrings[8], accounttrings[9], accounttrings[10], abbonement, Modstatus.Actief, accounttrings[13]);
                    Reviews.Add(new ReviewClass(reviewstring[4], Convert.ToInt32(reviewstring[0]), reviewstring[3], Convert.ToDateTime(reviewstring[6]), product, geregistreerde));
                }
                else
                {
                    WerknemerClass werknemer = new WerknemerClass(Convert.ToUInt32(accounttrings[0]), accounttrings[1], Convert.ToDateTime(accounttrings[2]), geslacht, adres, accounttrings[7], accounttrings[8], accounttrings[9], accounttrings[10], abbonement, Modstatus.Actief, accounttrings[13], Convert.ToDouble(werknemerstrings[0]), werknemerstrings[1], Convert.ToDateTime(werknemerstrings[2]));
                    Reviews.Add(new ReviewClass(reviewstring[4], Convert.ToInt32(reviewstring[0]), reviewstring[3], Convert.ToDateTime(reviewstring[6]), product, werknemer));
                }
            }
        }