//maybe split out into a comment business layer
        public Comment SaveComment(Comment comment)
        {
            comment.dateSubmitted = DateTime.Now;

            BugSquasherDB bsDB = new BugSquasherDB();
            bsDB.Comments.Add(comment);
            bsDB.SaveChanges();
            return comment;
        }
Exemplo n.º 2
0
 //
 // GET: /DefectDetails/
 public ActionResult SaveComment(Comment comment, string BtnSubmit)
 {
     switch (BtnSubmit)
     {
         case "Save Comment":
             DefectBusinessLayer defectBL = new DefectBusinessLayer();
             defectBL.SaveComment(comment);
             return RedirectToAction("Index", "Defect", new { id = comment.defectId });
     }
     return new EmptyResult();
 }