示例#1
0
        public void Add(string productId, string text, string publisherId)
        {
            var comment = new Models.Comment
            {
                Text      = text,
                Date      = DateTime.Now,
                Publisher = _userDal.GetUser(publisherId)
            };

            _productDal.AddComment(int.Parse(productId), comment);
        }
示例#2
0
        public void Add(string productId, string text, string publisherId, double rating)
        {
            double newRating = rating < 0 ? 0 : rating > 10 ? 10 : rating;
            var    comment   = new Models.Comment
            {
                Text      = text,
                Date      = DateTime.Now,
                Publisher = _userDal.GetUser(publisherId),
                Rating    = newRating
            };

            _productDal.AddComment(int.Parse(productId), comment);
        }