Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace KundeOplysninger
- {
- public class Kunde
- {
- private readonly int nr;
- private string navn;
- private string adresse1;
- private string adresse2;
- private int postnr;
- private string by;
- private string email;
- private readonly int _tlfnr;
- private readonly double _saldo;
- public Kunde(int nr, string navn, string adresse1, string adresse2, int postnr, string by, string email,
- int _tlfnr, double _saldo)
- {
- this.nr = nr;
- this.navn = navn;
- this.adresse1 = adresse1;
- this.adresse2 = adresse2;
- this.postnr = postnr;
- this.by = by;
- this.email = email;
- this._tlfnr = _tlfnr;
- this._saldo = _saldo;
- }
- public int Getnr()
- {
- return nr;
- }
- public string GetNavn()
- {
- return navn;
- }
- public void SetNavn(string navn)
- {
- this.navn = navn;
- }
- public string GetAdresse1()
- {
- return adresse1;
- }
- public void SetAdresse1(string adresse1)
- {
- this.adresse1 = adresse1;
- }
- public string GetAdresse2()
- {
- return adresse2;
- }
- public void SetAdresse2(string adresse2)
- {
- this.adresse2 = adresse2;
- }
- public int GetPostnr()
- {
- return postnr;
- }
- public void SetPostnr(int postnr)
- {
- this.postnr = postnr;
- }
- public string GetBy()
- {
- return by;
- }
- public void SetBy(string by)
- {
- this.by = by;
- }
- public string GetEmail()
- {
- return email;
- }
- public void SetEmail(string email)
- {
- this.email = email;
- }
- public int Tlfnr()
- {
- return _tlfnr;
- }
- public double Saldo()
- {
- return _saldo;
- }
- }
- }
- Åndsvag kode..
- Tlfnr og saldo giver fejl og visual studio siger at jeg ikke kan have nogle variabler som allerede er initieret. derfor jeg har prøvet med _ foran.. efter at have rettet det får jeg nu en fejl ved denne linie
- public Kunde(int nr, string navn, string adresse1, string adresse2, int postnr, string by, string email,
- int tlfnr, double saldo)
- Kunde er markeret og fejlen er "Method must have return type"..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement