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(); }
public DiscountRatingData(DiscountRating discountRating) { PartnerId = discountRating.PartnerId; RatingCount = discountRating.RatingCount; RatingSum = discountRating.RatingSum; }