public BondPeriodicSchedule[] GetBondPeriodicScheduleDistinctRefNo()
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    GROUP_ADMINISTRATOR, GROUP_USER
                };
                AllowAccessToOperation(SOLUTION_NAME, groupNames);

                IBondPeriodicScheduleRepository bondPeriodicScheduleRepository = _DataRepositoryFactory.GetDataRepository <IBondPeriodicScheduleRepository>();

                IEnumerable <BondPeriodicSchedule> bondPeriodicSchedules = bondPeriodicScheduleRepository.Get().ToArray();

                return bondPeriodicSchedules.ToArray();
            }));
        }
        public BondPeriodicSchedule[] GetBondPeriodicSchedulebyRefNo(string refNo)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    GROUP_ADMINISTRATOR, GROUP_USER
                };
                AllowAccessToOperation(SOLUTION_NAME, groupNames);

                IBondPeriodicScheduleRepository bondPeriodicScheduleMapRepository = _DataRepositoryFactory.GetDataRepository <IBondPeriodicScheduleRepository>();

                BondPeriodicSchedule[] bondPeriodicScheduleEntity = bondPeriodicScheduleMapRepository.Get().Where(c => c.RefNo == refNo).OrderBy(c => c.Num_Pmt).ToArray();

                if (bondPeriodicScheduleEntity == null)
                {
                    NotFoundException ex = new NotFoundException(string.Format("BondPeriodicSchedule with ID of {0} is not in database", refNo));
                    throw new FaultException <NotFoundException>(ex, ex.Message);
                }

                return bondPeriodicScheduleEntity;
            }));
        }