Ejemplo n.º 1
0
        public ActionResult CreateNewsSourceComment(int newssourceid)
        {
            var comment = new NewsSourceComment()
            {
                NewsSourceId = newssourceid
            };

            return(PartialView("_CreateOrEditNewsSourceComment", comment));
        }
Ejemplo n.º 2
0
 public ActionResult EditNewsSourceComment(NewsSourceComment NewsSourcecomment)
 {
     if (ModelState.IsValid)
     {
         _commentRepo.InsertOrUpdateNewsSourceComments(NewsSourcecomment);
         _commentRepo.Save();
         return(new HttpStatusCodeResult(HttpStatusCode.OK));
     }
     return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
 }
Ejemplo n.º 3
0
 public void InsertOrUpdateNewsSourceComments(NewsSourceComment newssourcecomment)
 {
     if (newssourcecomment.Id == default(int))
     {
         // New entity
         context.NewsSourceComments.Add(newssourcecomment);
     }
     else
     {
         // Existing entity
         context.Entry(newssourcecomment).State = EntityState.Modified;
     }
 }