Esempio n. 1
0
 public AccountCreditetEvent(Guid aggrateId, long Id, CreditTypes creditType, decimal sum)
 {
     this.Id    = Id;
     AggrateId  = aggrateId;
     CreditType = creditType;
     Sum        = sum;
 }
Esempio n. 2
0
        public CreditText(Level level, CCPoint position, CreditTypes creditType)
        {
            Level       = level;
            randomizer  = new Random();
            CreditType  = creditType;
            Position    = position;
            CreditNames = new List <NameText>();

            switch (creditType)
            {
            case CreditTypes.RollingFirstLast:
            case CreditTypes.RollingFirstMiddleLast:
                GenerateRollingCreditName();
                break;

            case CreditTypes.AttackingFirstLast:
            case CreditTypes.AttackingFirstMiddleLast:
                GenerateAttackingCreditName();
                break;
            }
            CreditNames.ForEach(platform => Level.StartGameScene.AddChild(platform, 4));
        }
        public decimal GetInterestRateForCardType(CreditTypes type)
        {
            var interestRate = 0.0M;

            switch (type)
            {
            case CreditTypes.Discover:
                interestRate = .01M;
                break;

            case CreditTypes.Mastercard:
                interestRate = .05M;
                break;

            case CreditTypes.Visa:
                interestRate = .1M;
                break;

            default:
                throw new ArgumentOutOfRangeException($"Credit type {type} not valid.");
            }

            return(interestRate);
        }
Esempio n. 4
0
 protected void OnCreditTypeChanged(SectionCreditTypeChangedEvent @event)
 {
     _creditType = @event.CreditType;
 }
Esempio n. 5
0
        public void ChangeCreditType(CreditTypes creditType)
        {
            if (creditType == _creditType)
                return;

            ApplyEvent(new SectionCreditTypeChangedEvent(
                           EventSourceId,
                           creditType));

            var newCourseType = CourseTypes.CE;
            switch (creditType)
            {
                case CreditTypes.ContractTrainingFunded:
                case CreditTypes.GrantFunded:
                case CreditTypes.WorkforceFunded:
                    newCourseType = CourseTypes.CWECM;
                    break;
            }

            ApplyEvent(new SectionCourseTypeAddedEvent(
                           EventSourceId,
                           newCourseType,
                           _courseTypes.Union(new[] {newCourseType}).Distinct()));

            foreach (var courseType in _courseTypes.Except(new[] { newCourseType }).ToArray())
                ApplyEvent(new SectionCourseTypeRemovedEvent(
                               EventSourceId,
                               courseType,
                               _courseTypes.Except(new[] {courseType}).ToArray()));
        }
 public CourseCreditTypeChangedEvent(Guid courseId, CreditTypes creditType)
 {
     CourseId = courseId;
     CreditType = creditType;
 }
Esempio n. 7
0
 public PersonCredit(Person person, CreditTypes type)
 {
     this.person = person;
     this.type = type;
 }
Esempio n. 8
0
 public void Credit(CreditTypes creditType, decimal sum)
 {
     Balance += sum;
     _version++;
     UnCommitedEvents.Add(new AccountCreditetEvent(Id, _version, creditType, sum));
 }
 public SectionCreditTypeChangedEvent(Guid sectionId, CreditTypes creditType)
 {
     SectionId = sectionId;
     CreditType = creditType;
 }