public static bool AddReview(ItemReview GetReview)
        {

            try
            {
                var dc = new ManagementContext();
                if (GetReview.ReviewId > 0)
                {
                    var review = dc.Reviews.Where(x => x.ReviewId == GetReview.ReviewId).FirstOrDefault();
                    review.comment = GetReview.comment;
                    review.title = GetReview.title;
                    review.rate = GetReview.rate;
                    review.StoreItem = review.StoreItem;
                }
                else
                {
                    DataModels.Store.Review con = new DataModels.Store.Review();
                    con.rate = GetReview.rate;
                    int s = GetReview.StoreItemId;
                    con.StoreItem = dc.StoreItems.Where(x => x.StoreItemId == GetReview.StoreItemId).FirstOrDefault();
                    con.comment = GetReview.comment;
                    con.Member = dc.Members.Where(x => x.MemberId == GetReview.MemberId).FirstOrDefault();
                    con.title = GetReview.title;
                    con.ItemReviewed = dc.InvoiceItems.Where(x => x.InvoiceItemId == GetReview.InvoiceItemId).FirstOrDefault();
                    dc.Reviews.Add(con);
                }
                int c = dc.SaveChanges();
                return c > 0;

            }
            catch (Exception exception)
            {
                ErrorDatabaseManager.AddException(exception, exception.GetType());

            }
            return false;
        }
        public ActionResult Review(StoreItem form)//RDN.Library.DataModels.Store.Review review
        {
            //http://localhost:8847/product-review/tdp1medium/10/e6cab01ce0044bd6a5d31970a7fe8dc0
            ItemReview oReview = new ItemReview();
            var memId = RDN.Library.Classes.Account.User.GetMemberId();
            oReview.MemberId = memId;
            oReview.rate = form.ratings;
            oReview.StoreItemId = form.StoreItemId;
            oReview.title = form.ReviewTitle;
            oReview.comment = form.ReviewComment;
            oReview.InvoiceItemId = form.InvoiceItemId;
            oReview.ReviewId = form.ReviewId;

            bool execute = RDN.Library.Classes.Store.ItemReview.AddReview(oReview);
            return Redirect(Url.Content("~/?u=" + SiteMessagesEnum.re));

        }
        public static ItemReview DisplayReviewList(DataModels.Store.Review ReviewList)
        {
            ItemReview bl = new ItemReview();
            bl.StoreItemId = ReviewList.StoreItem.StoreItemId;
            bl.rate = ReviewList.rate;
            bl.title = ReviewList.title;
            bl.comment = ReviewList.comment;
            bl.IsDeleted = ReviewList.IsDeleted;
            bl.IsPublished = ReviewList.IsPublished;
            bl.ReviewId = ReviewList.ReviewId;
            bl.Created = ReviewList.Created;
            if (ReviewList.Member != null)
            {
                bl.MemberId = ReviewList.Member.MemberId;
                bl.userName = ReviewList.Member.DerbyName;
            }
            else
            {
                bl.userName = "******";
            }


            return bl;
        }