public PartialViewResult Delete(string id) { RatingAndCommentModels model = new RatingAndCommentModels(); model.ID = id; return(PartialView("_Delete", model)); }
public ActionResult Delete(RatingAndCommentModels model) { try { string msg = ""; var result = _factory.Delete(model.ID, CurrentUser.UserId, ref msg); if (!result) { ModelState.AddModelError("Name", /*msg*/ Commons.ErrorMsg); Response.StatusCode = (int)HttpStatusCode.BadRequest; return(PartialView("_Delete", model)); } return(new HttpStatusCodeResult(HttpStatusCode.OK)); } catch (Exception ex) { NSLog.Logger.Error("RatingAndComment_Delete: ", ex); ModelState.AddModelError("Name", Commons.ErrorMsg); Response.StatusCode = (int)HttpStatusCode.BadRequest; return(PartialView("_Delete", model)); } }