public string Inloggen(string email, string wachtwoord) { string accountType = "bezoeker"; List <string> accListVanDb = new List <string>(); try { accListVanDb = data.Inloggen(email, wachtwoord); } catch (Exception) { //inloggen mislukt throw; } Geslacht geslacht; if (accListVanDb[3] == "n") { geslacht = Geslacht.Man; } else { geslacht = Geslacht.Vrouw; } AdresClass adres = new AdresClass(accListVanDb[4], accListVanDb[5], accListVanDb[6]); AbbonementClass abbonement; if (accListVanDb[11] == "Bannervrij") { abbonement = AbbonementClass.Bannervrij; } else { abbonement = AbbonementClass.Gratis; } if (accListVanDb.Count == 13) { WerknemerClass werknemer = new WerknemerClass(Convert.ToUInt32(accListVanDb[0]), accListVanDb[1], Convert.ToDateTime(accListVanDb[2]), geslacht, adres, accListVanDb[6], accListVanDb[7], accListVanDb[8], accListVanDb[9], abbonement, Modstatus.Actief, wachtwoord, Convert.ToDouble(accListVanDb[11]), accListVanDb[12], Convert.ToDateTime(accListVanDb[13])); Account = werknemer; accountType = "werknemer"; } else { GeregistreerdeClass geregistreerde = new GeregistreerdeClass(Convert.ToUInt32(accListVanDb[0]), accListVanDb[1], Convert.ToDateTime(accListVanDb[2]), geslacht, adres, accListVanDb[7], accListVanDb[8], accListVanDb[9], accListVanDb[10], abbonement, Modstatus.Actief, wachtwoord); Account = geregistreerde; } return(accountType); }
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"); }
public void AccountToevoegen(string wachtwoord, string naam, DateTime geboortedatum, string geslacht, string straat, string huisnummer, string woonplaats, string beroep, string opleiding, string email, string skype) { Modstatus modstatus = Modstatus.Actief; AbbonementClass abbonement = AbbonementClass.Gratis; uint accountId = 0; try { int accountid = Convert.ToInt32(data.KrijgLaatsteAccountId()) + 1; data.ToevoegenAccount(wachtwoord, naam, geboortedatum, geslacht, huisnummer, straat, woonplaats, beroep, opleiding, email, skype, Convert.ToString(abbonement), Convert.ToString(modstatus), accountid); //accountId = Convert.ToUInt32(data.OphalenAccountId(email)); } catch (Exception e) { throw e; } AdresClass adres = new AdresClass(straat, huisnummer, woonplaats); Geslacht gelachtt = Geslacht.Man; if (geslacht == "Man") { gelachtt = Geslacht.Man; } else { gelachtt = Geslacht.Vrouw; } Account = new GeregistreerdeClass(accountId, naam, geboortedatum, gelachtt, adres, beroep, opleiding, email, skype, abbonement, modstatus, wachtwoord); }
protected void BttnComm_Click(object sender, EventArgs e) { string inhoudcomment = TxtBxComm.Text; AdministratieClass administratie = (AdministratieClass)Session["administratie"]; ReviewClass review = (ReviewClass)Session["review"]; // account is null op het moment, je kunt pas een commentaar zetten als je bent inglogd // default account gebruiken 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"); review.ToevoegenCommentaar(a, inhoudcomment); UpdatenComments(); }
public void OphalenCommentaren() { Commentaren = new List <CommentaarClass>(); List <List <string> > commentaarstrings = new List <List <string> >(); commentaarstrings = data.OphalenCommentaren(reviewId); foreach (List <string> commentaarstring in commentaarstrings) { List <string> accountstring = data.AccountOphalenAccountId(Convert.ToInt32(commentaarstring[0])); List <string> werknemerstring = data.ZoekWerknemer(Convert.ToInt32(commentaarstring[0])); Geslacht geslacht; if (accountstring[3] == "n") { geslacht = Geslacht.Man; } else { geslacht = Geslacht.Vrouw; } AdresClass adres = new AdresClass(accountstring[4], accountstring[5], accountstring[6]); AbbonementClass abbonement; if (accountstring[11] == "Bannervrij") { abbonement = AbbonementClass.Bannervrij; } else { abbonement = AbbonementClass.Gratis; } if (werknemerstring.Count == 0) { GeregistreerdeClass geregistreerde = new GeregistreerdeClass(Convert.ToUInt32(accountstring[0]), accountstring[1], Convert.ToDateTime(accountstring[2]), geslacht, adres, accountstring[7], accountstring[8], accountstring[9], accountstring[10], abbonement, Modstatus.Actief, accountstring[13]); Commentaren.Add(new CommentaarClass(commentaarstring[2], geregistreerde)); } else { WerknemerClass werknemerClass = new WerknemerClass(Convert.ToUInt32(accountstring[0]), accountstring[1], Convert.ToDateTime(accountstring[2]), geslacht, adres, accountstring[7], accountstring[8], accountstring[9], accountstring[10], abbonement, Modstatus.Actief, accountstring[13], Convert.ToDouble(werknemerstring[0]), werknemerstring[2], Convert.ToDateTime(werknemerstring[1])); Commentaren.Add(new CommentaarClass(commentaarstring[2], werknemerClass)); } } }
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)); } } }
//public WerknemerClass(string naam, DateTime geboortedatum, Geslacht geslacht, AdresClass adres, string beroep, // string opleiding, string email, string skype, AbbonementClass abbonement, Modstatus modstatus, List<ReviewClass> reviews // ,double salaris, string functie, DateTime aangenomeop) //{ // base.Naam = naam; // base.GeboorteDatum = geboortedatum; // base.Geslacht = geslacht; // base.Adres = adres; // base.Beroep = beroep; // base.Opleiding = opleiding; // base.Email = email; // base.Skype = skype; // base.Abbonement = abbonement; // base.Modstatus = modstatus; // base.Reviews = reviews; // this.Salaris = salaris; // this.Functie = functie; // this.AangenomenOp = aangenomeop; //} public WerknemerClass(uint accountId, string naam, DateTime geboortedatum, Geslacht geslacht, AdresClass adres, string beroep, string opleiding, string email, string skype, AbbonementClass abbonement, Modstatus modstatus, string wachtwoord , double salaris, string functie, DateTime aangenomeop) { base.AccountId = accountId; base.Naam = naam; base.GeboorteDatum = geboortedatum; base.Geslacht = geslacht; base.Adres = adres; base.Beroep = beroep; base.Opleiding = opleiding; base.Email = email; base.Skype = skype; base.Abbonement = abbonement; base.Modstatus = modstatus; base.Wachtwoord = wachtwoord; base.Reviews = new List <ReviewClass>(); this.Salaris = salaris; this.Functie = functie; this.AangenomenOp = aangenomeop; this.Data = data; }
public GeregistreerdeClass(uint accountId, string naam, DateTime geboortedatum, Geslacht geslacht, AdresClass adres, string beroep, string opleiding, string email, string skype, AbbonementClass abbonement, Modstatus modstatus, string wachtwoord) { base.AccountId = accountId; base.Naam = naam; base.GeboorteDatum = geboortedatum; base.Geslacht = geslacht; base.Adres = adres; base.Beroep = beroep; base.Opleiding = opleiding; base.Email = email; base.Skype = skype; base.Abbonement = abbonement; base.Modstatus = modstatus; base.Wachtwoord = wachtwoord; base.Reviews = new List <ReviewClass>(); this.Data = new Databasemanager(); }