Beispiel #1
0
        private bool AddOrUpdateIndividualDetails(riderDto riderDto)
        {
            bool blReturn = true;

            try
            {
                Individual individual = riderDto.individual;
                individual.UserId = riderDto.Id;

                //Person comes in here?
                //Person ID is set

                //Try validating on a per class basis here
                //    blReturn =  _riderRepository.AddIndividualToDatabase(individual);
                var dbValue = GetIndividualById(riderDto.Id);

                blReturn = (dbValue == null) ? _riderRepository.AddIndividualToDatabase(individual) : _riderRepository.EditObjectInDatabase(dbValue, individual);
            }

            catch (Exception ex)
            {
            }

            return(blReturn);
        }