Esempio n. 1
0
        public ActionResult Insert(Models.Comments objComment)
        {
            try
            {
                clsDataBaseMethodsComments objDB = new clsDataBaseMethodsComments();
                objDB.Insert(objComment);

                TempData["Success"] = "¡Comment Created!";
                return(RedirectToAction("Index", "Comments", new { id = objComment.intPostId }));
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
            }
            return(View(objComment));
        }
Esempio n. 2
0
 public JsonResult LoadGrid(string id)
 {
     try
     {
         clsDataBaseMethodsComments objDB = new clsDataBaseMethodsComments();
         if (id == null || id == "")
         {
             id = "0";
         }
         int intValorId = Convert.ToInt32(id);
         return(Json(objDB.ListComments(intValorId)));
     }
     catch (Exception)
     {
         return(null);
     }
 }