Exemplo n.º 1
0
        public override void Execute()
        {
            Employee emp = database.GetEmployee(empId);

            if (emp != null)
            {
                CommissionClassification cc = emp.Classification as CommissionClassification;
                if (cc != null)
                {
                    SalesReceipt receipt = new SalesReceipt(date, amount);
                    cc.AddSalesReceipt(receipt);
                }
                else
                {
                    throw new ApplicationException("Tried to add sales receipt to" +
                                                   "non-commissioned employee");
                }
            }
            else
            {
                throw new ApplicationException("No such employee.");
            }
        }
Exemplo n.º 2
0
 public void AddSalesReceipt(SalesReceipt salesReceipt)
 {
     salesReceipts[salesReceipt.Date] = salesReceipt;
 }