public override string ToString() { using (var context = new DatabaseContext()) { return(Naam + ", " + Woonplaats + ", " + GeboorteDatum.ToShortDateString()); } }
public void Print() { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine(naam); Console.ResetColor(); Console.WriteLine($"date of birth: {GeboorteDatum.ToString("dd/MM/yyyy")}"); Console.WriteLine($"age: {Leeftijd}"); Console.WriteLine($"date of registration: {InschrijfDatum.ToString("dd/MM/yyyy")}"); Console.WriteLine($"discount: {RechtOpKorting}"); Console.WriteLine(); }
public void Loonstroken(string Folder, string devider) { double startloon = Math.Round(StartloonNaUren(), 2); double ancienniteit = Math.Round(AncienniteitVerschil(), 2); double LoonPlusAncienniteit = Math.Round(Ancienniteit(), 2); double loonMinSocialezekerheid = Math.Round(SocialeZekerheid(), 2); double bedragBedrijfsvoorheffing = Math.Round(BedrijfsvoorheffingVerschil(), 2); double loonMinBedrijfsvoorheffing = Math.Round(Bedrijfsvoorheffing(), 2); double nettoLoon = Math.Round(Extras(), 2); string bestandnaamLoonstrook = $"LOONBRIEF {Naam} {Rijksregisternummer} {DateTime.Now.ToString("MM-yyyy")}.txt"; using (StreamWriter writer = new StreamWriter(Folder + bestandnaamLoonstrook)) { writer.WriteLine(devider); writer.WriteLine($"LOONBRIEF {DateTime.Now.ToString("MMMM yyyy").ToUpper()}"); writer.WriteLine(devider); writer.WriteLine($"NAAM : {Naam}"); writer.WriteLine($"RIJKSREGISTERNUMMER : {Rijksregisternummer}"); writer.WriteLine($"IBAN-NUMMER : {Bankrekening}"); writer.WriteLine($"GESLACHT : {(Geslacht ? "MAN" : "VROUW")}"); writer.WriteLine($"GEBOORTEDATUM : {GeboorteDatum.ToShortDateString()}"); writer.WriteLine($"DATUM INDIENSTTREDING : {DatumIntreding.ToShortDateString()}"); writer.WriteLine($"FUNCTIE : {Functie.ToUpper()}"); writer.WriteLine($"AANTAL GEPRESTEERDE UREN : {Uren}/38"); if (BedrijfswagenString() != "") { writer.WriteLine($"BEDRIJFSWAGEN : {(Bedrijfswagen ? "Ja" : "Nee")}"); } writer.WriteLine(devider); writer.WriteLine($"STARTLOON : €{CijferPrinterRechts(startloon)}"); writer.WriteLine($"ANCIËNNITEIT : + €{CijferPrinterRechts(ancienniteit)}"); writer.WriteLine($" €{CijferPrinterRechts(LoonPlusAncienniteit)}"); writer.WriteLine($"SOCIALE ZEKERHEID : - €{CijferPrinterRechts(BijdragenSocialeZekerheid)}"); writer.WriteLine($" €{CijferPrinterRechts(loonMinSocialezekerheid)}"); writer.WriteLine($"BEDRIJFSVOORHEFFING : - €{CijferPrinterRechts(bedragBedrijfsvoorheffing)}"); writer.WriteLine($" €{CijferPrinterRechts(loonMinBedrijfsvoorheffing)}"); if (Support() != "") { writer.WriteLine($"BONUS THUIS WERKEN : + €{CijferPrinterRechts(50.00)}"); if (CostumerSupport() != "") { writer.WriteLine($"TERUGBETAALING OPLEIDING : + €{CijferPrinterRechts(19.50)}"); } } writer.WriteLine($"NETTOLOON : €{CijferPrinterRechts(nettoLoon)}"); writer.WriteLine(devider); } }
public virtual string Beschrijf() { string beschrijf = ""; beschrijf = $"NAAM :{Naam}" + "\n" + $"GESLACHT :{Geslacht}" + "\n" + $"GEBOORTEDATUM :{GeboorteDatum.ToString("dd/MM/yyyy")}" + "\n" + $"RIJKSREGISTERNUMMER :{RijksRegisterNummer}" + "\n" + $"INDATUMINDIENSTTREDING:{Indiensttreding.ToString("dd/MM/yyyy")}" + "\n" + $"FUNCTIE :{Functie}" + "\n" + $"TYPECONTRACT :{Typecontract}" + "\n" + $"IBANNUMMER :{IbanNummer}" + "\n"; return(beschrijf); }
public void MaakLoonBrief(string bestandsLocatie) { string bestandsNaam = bestandsLocatie + $"LOONBRIEF {Naam} {RijksRegisterNummer} {DateTime.Now.ToString("MM yyyy")}.txt"; using (StreamWriter writer = new StreamWriter(bestandsNaam)) { writer.WriteLine("-----------------------------------------------------------"); writer.WriteLine($"NAAM :{Naam}"); writer.WriteLine($"GESLACHT :{Geslacht}"); writer.WriteLine($"GEBOORTEDATUM :{GeboorteDatum.ToShortDateString()}"); writer.WriteLine($"RIJKSREGISTERNUMMER :{RijksRegisterNummer}"); writer.WriteLine($"DATUM INDIENSTTREDING :{Indiensttreding.ToShortDateString()}"); writer.WriteLine($"FUNCTIE :{Functie}"); writer.WriteLine($"TYPECONTRACT :{Typecontract}"); writer.WriteLine($"AANTAL GEPRESTEERDE UREN :{AantalGepresenteerdUren}"); writer.WriteLine($"IBANNUMMER :{IbanNummer}"); if (Functie == "Programmeur") { writer.WriteLine($"BEDRIJFSWAGEN :{(Bedrijfswagen ? "Ja" : "Nee")}"); } writer.WriteLine("-----------------------------------------------------------"); writer.WriteLine($"STARTLOON : € {Math.Round(Uurberekendstartloon(), 2)}"); writer.WriteLine($"ANCIËNNITEIT : + € {Math.Round(Ancienniteit(), 2)}"); writer.WriteLine($" €{Math.Round(Uurberekendstartloon() + Ancienniteit(), 2)}"); writer.WriteLine($"SOCIALE ZEKERHEID : - €200"); writer.WriteLine($" €{Math.Round(NaSocialeZekerheid())}"); writer.WriteLine($"BEDRIJFSVOORHEFFING : - €{Math.Round(Bedrijfsvoorheffing(), 2)}"); if (Functie.ToLower().Contains("support")) { writer.WriteLine("THUISWERKTWEEDAGEN :+ €50"); if (Functie.ToLower() == "customersupport") { writer.WriteLine("OPLEIDING :+€19.50"); } } writer.WriteLine($"NETTOLOON : €{Math.Round(Netto(), 2)}"); writer.WriteLine("-----------------------------------------------------------"); } }
// Code van Benjamin . Ik was terug in tijdsnood en ik wist niet hoe ik het anders kon doen, dus dank U Benjamin public void GeneratePayslip(string root) { string path = root + " " + $"{Naam}.txt"; using (StreamWriter sw = File.CreateText(path)) { sw.WriteLine("------------------------------------------------------"); sw.WriteLine($"Loonbrief {DateTime.Now.ToString("MMMM yyyy")}"); sw.WriteLine("------------------------------------------------------"); sw.WriteLine($"Naam : {Naam}"); sw.WriteLine($"Rijksregister nr. : {RijksregisterNr}"); sw.WriteLine($"Iban nr. : {IbanNr}"); sw.WriteLine($"Geslacht : {Geslacht}"); sw.WriteLine($"Geboorte Datum : {GeboorteDatum.ToShortDateString()}"); sw.WriteLine($"Datum Indiensttreding : {DatumIndiensttreding.ToShortDateString()}"); sw.WriteLine($"Functie : {Functie}"); sw.WriteLine($"Aantal gewerkte uren per week : {Loon.AantalGewerkteUrenPerWeek}"); sw.WriteLine($"Bedrijfswagen : {(Loon.BedrijfsWagen ? "Ja" : "Nee")}"); sw.WriteLine("--------------------------------------------------------------------------------"); sw.WriteLine($"Startloon : €{Print(Loon.BerekenStartLoon())}"); sw.WriteLine($"Anciëniteit : + €{Print(BerekenAncieniteit())}"); sw.WriteLine($" : €{Print(Loon.Nettoloon)}"); sw.WriteLine($"Sociale zekerheid : - €{Print(SocialeZekerheid())}"); sw.WriteLine($" : €{Print(Loon.Nettoloon)}"); sw.WriteLine($"Bedrijfsvoorheffing : - €{Print(Bedrijfsvoorheffing())}"); if (this.Functie == "IT Support" || this.Functie == "CS Support") { SupportBonus(); } if (this.Functie == "CS Support") { CSSupportBonus(); } sw.WriteLine($" : €{Print(Loon.Nettoloon)}"); sw.WriteLine($"Netto Loon : €{Print(Loon.Nettoloon)}"); } }
public override string ToString() { string persoon = $"{Voornaam} is geboren op {GeboorteDatum.ToShortDateString()}"; return(persoon); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (VoorletterAanschrijving != null) { hashCode = hashCode * 59 + VoorletterAanschrijving.GetHashCode(); } if (Voornamen != null) { hashCode = hashCode * 59 + Voornamen.GetHashCode(); } if (VoorvoegselGeslachtnaam != null) { hashCode = hashCode * 59 + VoorvoegselGeslachtnaam.GetHashCode(); } if (Geslachtsnaam != null) { hashCode = hashCode * 59 + Geslachtsnaam.GetHashCode(); } if (Geslachtsaanduiding != null) { hashCode = hashCode * 59 + Geslachtsaanduiding.GetHashCode(); } if (Aanschrijfwijze != null) { hashCode = hashCode * 59 + Aanschrijfwijze.GetHashCode(); } if (GeboorteDatum != null) { hashCode = hashCode * 59 + GeboorteDatum.GetHashCode(); } if (Verblijfsadres != null) { hashCode = hashCode * 59 + Verblijfsadres.GetHashCode(); } if (Adresbuitenland != null) { hashCode = hashCode * 59 + Adresbuitenland.GetHashCode(); } if (Burgerservicenummer != null) { hashCode = hashCode * 59 + Burgerservicenummer.GetHashCode(); } if (AanduidingNaamgebruik != null) { hashCode = hashCode * 59 + AanduidingNaamgebruik.GetHashCode(); } if (AanhefAanschrijving != null) { hashCode = hashCode * 59 + AanhefAanschrijving.GetHashCode(); } if (VoornamenAanschrijving != null) { hashCode = hashCode * 59 + VoornamenAanschrijving.GetHashCode(); } if (GeslachtsnaamAanschrijving != null) { hashCode = hashCode * 59 + GeslachtsnaamAanschrijving.GetHashCode(); } if (AdelijkeTitelOfPredikant != null) { hashCode = hashCode * 59 + AdelijkeTitelOfPredikant.GetHashCode(); } if (Geboorteplaats != null) { hashCode = hashCode * 59 + Geboorteplaats.GetHashCode(); } if (Geboorteland != null) { hashCode = hashCode * 59 + Geboorteland.GetHashCode(); } if (Ouder != null) { hashCode = hashCode * 59 + Ouder.GetHashCode(); } if (Partner != null) { hashCode = hashCode * 59 + Partner.GetHashCode(); } if (Overlijden != null) { hashCode = hashCode * 59 + Overlijden.GetHashCode(); } if (Telefoonnummer != null) { hashCode = hashCode * 59 + Telefoonnummer.GetHashCode(); } if (Faxnummer != null) { hashCode = hashCode * 59 + Faxnummer.GetHashCode(); } if (Emailadres != null) { hashCode = hashCode * 59 + Emailadres.GetHashCode(); } if (Verblijfstitel != null) { hashCode = hashCode * 59 + Verblijfstitel.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if IngeschrevenPersoon instances are equal /// </summary> /// <param name="other">Instance of IngeschrevenPersoon to be compared</param> /// <returns>Boolean</returns> public bool Equals(IngeschrevenPersoon other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( VoorletterAanschrijving == other.VoorletterAanschrijving || VoorletterAanschrijving != null && VoorletterAanschrijving.Equals(other.VoorletterAanschrijving) ) && ( Voornamen == other.Voornamen || Voornamen != null && Voornamen.Equals(other.Voornamen) ) && ( VoorvoegselGeslachtnaam == other.VoorvoegselGeslachtnaam || VoorvoegselGeslachtnaam != null && VoorvoegselGeslachtnaam.Equals(other.VoorvoegselGeslachtnaam) ) && ( Geslachtsnaam == other.Geslachtsnaam || Geslachtsnaam != null && Geslachtsnaam.Equals(other.Geslachtsnaam) ) && ( Geslachtsaanduiding == other.Geslachtsaanduiding || Geslachtsaanduiding != null && Geslachtsaanduiding.Equals(other.Geslachtsaanduiding) ) && ( Aanschrijfwijze == other.Aanschrijfwijze || Aanschrijfwijze != null && Aanschrijfwijze.Equals(other.Aanschrijfwijze) ) && ( GeboorteDatum == other.GeboorteDatum || GeboorteDatum != null && GeboorteDatum.Equals(other.GeboorteDatum) ) && ( Verblijfsadres == other.Verblijfsadres || Verblijfsadres != null && Verblijfsadres.Equals(other.Verblijfsadres) ) && ( Adresbuitenland == other.Adresbuitenland || Adresbuitenland != null && Adresbuitenland.Equals(other.Adresbuitenland) ) && ( Burgerservicenummer == other.Burgerservicenummer || Burgerservicenummer != null && Burgerservicenummer.Equals(other.Burgerservicenummer) ) && ( AanduidingNaamgebruik == other.AanduidingNaamgebruik || AanduidingNaamgebruik != null && AanduidingNaamgebruik.Equals(other.AanduidingNaamgebruik) ) && ( AanhefAanschrijving == other.AanhefAanschrijving || AanhefAanschrijving != null && AanhefAanschrijving.Equals(other.AanhefAanschrijving) ) && ( VoornamenAanschrijving == other.VoornamenAanschrijving || VoornamenAanschrijving != null && VoornamenAanschrijving.Equals(other.VoornamenAanschrijving) ) && ( GeslachtsnaamAanschrijving == other.GeslachtsnaamAanschrijving || GeslachtsnaamAanschrijving != null && GeslachtsnaamAanschrijving.Equals(other.GeslachtsnaamAanschrijving) ) && ( AdelijkeTitelOfPredikant == other.AdelijkeTitelOfPredikant || AdelijkeTitelOfPredikant != null && AdelijkeTitelOfPredikant.Equals(other.AdelijkeTitelOfPredikant) ) && ( Geboorteplaats == other.Geboorteplaats || Geboorteplaats != null && Geboorteplaats.Equals(other.Geboorteplaats) ) && ( Geboorteland == other.Geboorteland || Geboorteland != null && Geboorteland.Equals(other.Geboorteland) ) && ( Ouder == other.Ouder || Ouder != null && Ouder.SequenceEqual(other.Ouder) ) && ( Partner == other.Partner || Partner != null && Partner.SequenceEqual(other.Partner) ) && ( Overlijden == other.Overlijden || Overlijden != null && Overlijden.Equals(other.Overlijden) ) && ( Telefoonnummer == other.Telefoonnummer || Telefoonnummer != null && Telefoonnummer.Equals(other.Telefoonnummer) ) && ( Faxnummer == other.Faxnummer || Faxnummer != null && Faxnummer.Equals(other.Faxnummer) ) && ( Emailadres == other.Emailadres || Emailadres != null && Emailadres.Equals(other.Emailadres) ) && ( Verblijfstitel == other.Verblijfstitel || Verblijfstitel != null && Verblijfstitel.Equals(other.Verblijfstitel) )); }