public ActionResult EditCafeComment(int ID) { Model model = new Model(); try { CafeComment cafeComment = model.SELECTCafeComment_WHEREID(ID); if (cafeComment != null) { return(View(cafeComment)); } else { model.Close(); return(RedirectToAction("Error", "Admin")); } } catch (Exception) { model.Close(); return(RedirectToAction("Error", "Admin")); } }
public ActionResult UpdateCafeComment(CafeComment cafeComment) { int errorCode = InputControl.UpdateCafeCommentControl(cafeComment); return(Json(new { result = errorCode })); }
public void UPDATECafeComment_WHEREID(CafeComment cafeComment) { connection.Execute("UPDATE netgarson.dbo.[CafeComment] SET CommentText = @CommentText, Plus = @Plus, Cons = @Cons, IsNew = @IsNew, Active = @Active, User_ID = @User_ID WHERE ID = @ID", new { cafeComment.CommentText, cafeComment.Plus, cafeComment.Cons, cafeComment.IsNew, cafeComment.Active, cafeComment.User_ID, cafeComment.ID }); }
public void INSERTCafeComment(CafeComment cafeComment) { connection.Execute("INSERT INTO netgarson.dbo.[CafeComment]([CommentText], [Plus], [Cons], [RecordDate], [IsNew], [Active], [User_ID]) VALUES (@CommentText, @Plus, @Cons, @RecordDate, @IsNew, @Active, @User_ID)", new { cafeComment.CommentText, cafeComment.Plus, cafeComment.Cons, cafeComment.RecordDate, cafeComment.IsNew, cafeComment.Active, cafeComment.User_ID }); }