public ActionResult <int> Create(ProductFeedback productFeedback) { int res = 0; res = _productFeedbackService.Create(productFeedback); return(res); }
public ActionResult Create(ProductCommentViewModel commentViewModel) { if (ModelState.IsValid) { var comment = new ProductFeedback() { Id = commentViewModel.CommentId, ProductId = commentViewModel.ProductId, Comment = commentViewModel.Comment, CreatedAt = DateTime.Now, UserId = WebSecurity.CurrentUserId }; try { _productCommentRepository.Save(comment); } catch (DataException) { TempData["error"] = ProjectConfiguration.Get.DataErrorMessage; } return(RedirectToAction("Feedbacks", "Product", new { Id = comment.ProductId })); } else { TempData["Comment"] = commentViewModel.Comment; return(RedirectToAction("Feedbacks", "Product", new { Id = commentViewModel.ProductId })); } }
public bool SaveFeedback(ProductFeedback productFeedback) { using (var context = new UniversityEntities()) { context.ProductFeedback.Add(productFeedback); context.SaveChanges(); return(true); } }
public ActionResult ProductFeedback(string message, string id) { ProductFeedback productFeedback = new ProductFeedback(); productFeedback.FeedbackDescription = message; productFeedback.IsDeleted = false; productFeedback.ProductId = Convert.ToDecimal(id); productFeedback.CreatedDate = DateTime.Now; bool savefeedback = _feedbackService.SaveFeedback(productFeedback); return(this.Json("Thank you for your feedback.", JsonRequestBehavior.AllowGet)); }
public IActionResult Update(string id, ProductFeedback memberIn) { var productFeedback = _productFeedbackService.Get(id); if (productFeedback == null) { return(NotFound()); } _productFeedbackService.Update(id, memberIn); return(NoContent()); }
public int Create(ProductFeedback productFeedback) { try { _productFeedback.InsertOne(productFeedback); return(1); } catch (Exception ex) { Console.WriteLine(ex.Message); return(0); } }
public bool ProductFeedbackCreate(ProductFeedback feedback) { try { _productFeedbacksRepository.Add(feedback); _productFeedbacksRepository.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public void Remove(ProductFeedback productFeedback) => _productFeedback.DeleteOne(productFeedback => productFeedback.Id == productFeedback.Id);
public void Update(string id, ProductFeedback productFeedback) => _productFeedback.ReplaceOne(productFeedback => productFeedback.Id == id, productFeedback);
public ProductFeedback Update(ProductFeedback entity, List <Expression <Func <ProductFeedback, object> > > update = null, List <Expression <Func <ProductFeedback, object> > > exclude = null) { return(_productFeedback.Update(entity, update, exclude)); }
public ProductFeedback Delete(ProductFeedback entity) { return(_productFeedback.Delete(entity)); }
public ProductFeedback Add(ProductFeedback entity) { return(_productFeedback.Add(entity)); }
public bool SaveFeedback(ProductFeedback productFeedback) { return(_feedbackRepository.SaveFeedback(productFeedback)); }