Ejemplo n.º 1
0
 private void GenerateEvents()
 {
     if (rbtnCashIn.Checked)
     {
         TellerCashInEvent = new TellerCashInEvent();
         TellerCashInEvent.Amount = amount;
         TellerCashInEvent.Date = TimeProvider.Now;
         TellerCashInEvent.TellerId = (cmbTeller.SelectedItem as Teller).Id;
         TellerCashInEvent.Description = tbxDescription.Text;
         ServicesProvider.GetInstance().GetEventProcessorServices().FireTellerEvent(TellerCashInEvent);
     }
     else if (rbtnCashOut.Checked)
     {
         TellerCashOutEvent = new TellerCashOutEvent();
         TellerCashOutEvent.Amount = amount;
         TellerCashOutEvent.Date = TimeProvider.Now;
         TellerCashOutEvent.TellerId = (cmbTeller.SelectedItem as Teller).Id;
         TellerCashOutEvent.Description = tbxDescription.Text;
         ServicesProvider.GetInstance().GetEventProcessorServices().FireTellerEvent(TellerCashOutEvent);
     }
 }
Ejemplo n.º 2
0
        private static TellerEvent GetTellerEvent(string code)
        {
            TellerEvent e;
            switch (code)
            {
                case OTellerEvents.CashIn:
                    e = new TellerCashInEvent();
                    break;

                case OTellerEvents.CashOut:
                    e = new TellerCashOutEvent();
                    break;

                case OTellerEvents.OpenDay:
                    e = new OpenOfDayAmountEvent();
                    break;

                case OTellerEvents.CloseDay:
                    e = new CloseOfDayAmountEvent();
                    break;

                case OTellerEvents.OpenDayPositiveDifference:
                    e = new OpenAmountPositiveDifferenceEvent();
                    break;

                case OTellerEvents.OpenDayNegativeDifference:
                    e = new OpenAmountNegativeDifferenceEvent();
                    break;

                case OTellerEvents.CloseDayPositiveDifference:
                    e = new CloseAmountPositiveDifferenceEvent();
                    break;

                case OTellerEvents.CloseDayNegativeDifference:
                    e = new CloseAmountNegativeDifferenceEvent();
                    break;

                default:
                    Debug.Fail("Failed to create teller events");
                    throw new Exception();
            }

            return e;
        }