Esempio n. 1
0
        public void postLetter(Inhabitant prmReceiver, Letter prmLetter)
        {
            hisCity.sendLetter(prmLetter);
            this.getBankAccount().setDebit(prmLetter.getPrice());

            Console.WriteLine("-> inhabitant-" + this.number + " mails " + prmLetter.putContent() + " to inhabitant-" + prmReceiver.number + " for a cost of " + prmLetter.getPrice() + " euros");
            Console.WriteLine("   - " + prmLetter.getPrice() + " euros are debited from inhabitant-" + this.number + " account whose balance is now " + this.getBankAccount().getAmount() + " euros");
        }
Esempio n. 2
0
 public void createUrgentLetter(Inhabitant prmReceiver, Letter prmLetter)
 {
     Letter objUrgentLetter = new UrgentLetter(new Sender(this), new Receiver(prmReceiver), prmLetter);
     this.postLetter(prmReceiver, objUrgentLetter);
 }
Esempio n. 3
0
 public void createSimpleLetter(Inhabitant prmReceiver, String prmContent)
 {
     Letter objLetterTemp = new SimpleLetter(new Sender(this), new Receiver(prmReceiver), prmContent);
     this.postLetter(prmReceiver, objLetterTemp);
 }
Esempio n. 4
0
 public void createThanksLetter(Inhabitant prmReceiver, string prmMessage)
 {
     Letter objThanksLetter = new ThanksLetter(new Sender(this), new Receiver(prmReceiver), prmMessage);
     this.postLetter(prmReceiver, objThanksLetter);
 }
Esempio n. 5
0
 public void createRegisteredLetter(Inhabitant prmReceiver, Letter prmLetter)
 {
     Letter objRegisteredLetter = new RegisteredLetter(new Sender(this), new Receiver(prmReceiver), prmLetter);
     this.postLetter(prmReceiver, objRegisteredLetter);
 }
Esempio n. 6
0
 public void createPromissoryNote(Inhabitant prmReceiver, int prmNote)
 {
     Letter objPromissoryNote = new PromissoryNote(new Sender(this), new Receiver(prmReceiver), prmNote);
     this.postLetter(prmReceiver, objPromissoryNote);
 }
Esempio n. 7
0
 public void createAcknowledgment(Inhabitant prmReceiver, string prmMessage)
 {
     Letter objAcknowledgment = new Acknowledgment(new Sender(this), new Receiver(prmReceiver), prmMessage);
     this.postLetter(prmReceiver, objAcknowledgment);
 }
Esempio n. 8
0
 public Receiver(Inhabitant prmInhabitant)
 {
     objInhabitant = prmInhabitant;
 }
Esempio n. 9
0
 public Sender(Inhabitant prmInhabitant)
 {
     objInhabitant = prmInhabitant;
 }