Esempio n. 1
0
        private void SaveDiscountRating(DeserializeDiscountRating discountRatingItem, DiscountRating discountRatingDbData)
        {
            _database.BeginTransaction();

            if (discountRatingDbData != null)
            {
                discountRatingDbData.PartnerId   = discountRatingItem.Id;
                discountRatingDbData.RatingCount = discountRatingItem.RatingCount;
                discountRatingDbData.RatingSum   = discountRatingItem.RatingSum;

                _database.Update(discountRatingDbData);
            }
            else
            {
                discountRatingDbData = new DiscountRating
                {
                    PartnerId   = discountRatingItem.Id,
                    RatingCount = discountRatingItem.RatingCount,
                    RatingSum   = discountRatingItem.RatingSum
                };

                _database.Insert(discountRatingDbData);
            }

            _database.Commit();
        }
Esempio n. 2
0
 public DiscountRatingData(DiscountRating discountRating)
 {
     PartnerId   = discountRating.PartnerId;
     RatingCount = discountRating.RatingCount;
     RatingSum   = discountRating.RatingSum;
 }