public List <Common.Models.Rating> DisplayAllReviewDetailsByCustomer(string emailId) { try { var dal = new QuickKartRepository(); var ratingList = dal.DisplayAllReviewDetailsByCustomer(emailId); Common.Models.Rating rating; var ratings = new List <Common.Models.Rating>(); if (ratingList.Any()) { foreach (var rate in ratingList) { rating = new Common.Models.Rating(); rating.EmailId = rate.EmailId; rating.ProductId = rate.ProductId; rating.ProductName = rate.Product.ProductName; rating.ReviewComments = rate.ReviewComments; rating.ReviewRating = rate.ReviewRating; ratings.Add(rating); } } return(ratings); } catch (Exception ex) { return(null); } }
public bool DeleteRating(Common.Models.Rating rating) { var status = false; try { var dal = new QuickKartRepository(); status = dal.DeleteRating(rating.EmailId, rating.ProductId); } catch (Exception ex) { status = false; } return(status); }
public bool UpdateReviewComments(Common.Models.Rating rating) { bool status = false; try { var dal = new QuickKartRepository(); status = dal.UpdateReviewComments(rating.EmailId, rating.ProductId, rating.ReviewComments); } catch (Exception) { status = false; } return(status); }
public bool InsertRating(Common.Models.Rating rating) { bool status = false; try { var dal = new QuickKartRepository(); status = dal.AddRatings(rating); } catch (Exception) { status = false; } return(status); }
public bool DeleteRating(Common.Models.Rating rating) { var status = false; try { CustomerBL customerBLObj = new CustomerBL(); status = customerBLObj.DeleteRating(rating); } catch (Exception ex) { status = false; } return(status); }
public bool UpdateReviewComments(Common.Models.Rating rating) { bool status = false; try { CustomerBL customerBLObj = new CustomerBL(); status = customerBLObj.UpdateReviewComments(rating); } catch (Exception) { status = false; } return(status); }
public Common.Models.Rating GetProductReviewByCustomer(string emailId, string productId) { var rating = new Common.Models.Rating(); try { CustomerBL customerBLObj = new CustomerBL(); rating = customerBLObj.GetProductReviewByCustomer(emailId, productId); } catch (Exception ex) { rating = null; } return(rating); }
public bool InsertRating(Common.Models.Rating rating) { bool status = false; try { CustomerBL customerBLObj = new CustomerBL(); status = customerBLObj.InsertRating(rating); } catch (Exception) { status = false; } return(status); }
public Common.Models.Rating GetProductReviewByCustomer(string emailId, string productId) { var rating = new Common.Models.Rating(); try { var dal = new QuickKartRepository(); var rate = dal.GetProductReviewByCustomer(emailId, productId); rating.EmailId = rate.EmailId; rating.ProductId = rate.ProductId; rating.ReviewRating = rate.ReviewRating; rating.ReviewComments = rate.ReviewComments; } catch (Exception ex) { rating = null; } return(rating); }
public bool AddRatings(Common.Models.Rating rating) { bool status = false; try { Rating ratingObj = new Rating(); ratingObj.EmailId = rating.EmailId; ratingObj.ProductId = rating.ProductId; ratingObj.ReviewComments = rating.ReviewComments; ratingObj.ReviewRating = rating.ReviewRating; Context.Ratings.Add(ratingObj); Context.SaveChanges(); status = true; } catch (Exception ex) { status = false; } return(status); }