Ejemplo n.º 1
0
        public static RegistrationFee ToRegistrationFee(this RegistrationFeeModel registrationFeeModel, RegistrationFee registrationFee)
        {
            Guard.NotNull(registrationFee, nameof(registrationFee));
            Guard.NotNull(registrationFeeModel, nameof(registrationFeeModel));

            return(ToRegistrationFeeHelper(registrationFeeModel, registrationFee));
        }
Ejemplo n.º 2
0
        public static RegistrationFeeModel ToModel(this RegistrationFee registrationFee)
        {
            Guard.NotNull(registrationFee, nameof(registrationFee));

            RegistrationFeeModel registrationFeeModel = new RegistrationFeeModel();

            return(ToModelHelper(registrationFeeModel, registrationFee));
        }
Ejemplo n.º 3
0
        public static IList <RegistrationFeeModel> ToModels(this IList <RegistrationFee> registrationFees)
        {
            if (registrationFees == null || registrationFees.Count <= 0)
            {
                throw new ArgumentNullException("registrationFees");
            }

            IList <RegistrationFeeModel> registrationFeeModels = new List <RegistrationFeeModel>();

            foreach (RegistrationFee registrationFee in registrationFees)
            {
                RegistrationFeeModel registrationFeeModel = new RegistrationFeeModel();
                registrationFeeModels.Add(ToModelHelper(registrationFeeModel, registrationFee));
            }

            return(registrationFeeModels);
        }
Ejemplo n.º 4
0
        private static RegistrationFee ToRegistrationFeeHelper(RegistrationFeeModel registrationFeeModel, RegistrationFee registrationFee)
        {
            registrationFee = registrationFee ?? new RegistrationFee();

            if (registrationFeeModel != null)
            {
                registrationFee.Id                   = registrationFeeModel.Id;
                registrationFee.AmountPayable        = registrationFeeModel.AmountPayable;
                registrationFee.AccessCharge         = registrationFeeModel.AccessCharge;
                registrationFee.CanMakePartPayment   = registrationFeeModel.CanMakePartPayment;
                registrationFee.CreatedOn            = registrationFeeModel.CreatedOn;
                registrationFee.CreatedBy            = registrationFeeModel.CreatedBy;
                registrationFee.RegistrationPeriodId = registrationFeeModel.RegistrationPeriodId;
                registrationFee.LevelId              = registrationFeeModel.LevelId;
                registrationFee.DepartmentId         = registrationFeeModel.DepartmentId;
                registrationFee.ProgrammeId          = registrationFeeModel.ProgrammeId;

                if (registrationFeeModel.Level != null && registrationFeeModel.Level.Id > 0)
                {
                    registrationFee.Level = registrationFeeModel.Level;
                }
                if (registrationFeeModel.Department != null && registrationFeeModel.Department.Id > 0)
                {
                    registrationFee.Department = registrationFeeModel.Department;
                }
                if (registrationFeeModel.RegistrationPeriod != null && registrationFeeModel.RegistrationPeriod.Id > 0)
                {
                    registrationFee.RegistrationPeriod = registrationFeeModel.RegistrationPeriod;
                }
                if (registrationFeeModel.Programme != null && registrationFeeModel.Programme.Id > 0)
                {
                    registrationFee.Programme = registrationFeeModel.Programme;
                }
            }

            return(registrationFee);
        }