Exemplo n.º 1
0
        public bool RateRegistration(List <Rate> rates, RateEntity rateEntity)
        {
            string tempStr = null;

            RateHistory = rates;

            if (!db.CreateRecord <RateEntity>(rateEntity, out tempStr))
            {
                throw new Exception(tempStr);
            }
            else
            {
                foreach (Rate rate in rates)
                {
                    rate.EntityID = rateEntity.Id;
                }
                db.CreateRecords(rates, out tempStr);
                Rate minRate = null;
                Rate maxRate = null;
                GetMinMax(out minRate, out maxRate, RateHistory);
                rateEntity.MinRate = minRate;
                rateEntity.MaxRate = maxRate;
                AllEntities        = db.getCollection <RateEntity>();
                db.UpdateRecord <RateEntity>(rateEntity, out tempStr);
            }
            return(true);
        }