public ActionResult CreateOrganizationComment(int organizationId) { var comment = new OrganizationComment { OrganizationId = organizationId }; return(PartialView("_CreateOrEditOrganizationComment", comment)); }
public ActionResult EditOrganizationComment(OrganizationComment organizationcomment) { if (ModelState.IsValid) { _commentRepo.InsertOrUpdateOrganizationComments(organizationcomment); _commentRepo.Save(); return(new HttpStatusCodeResult(HttpStatusCode.OK)); } return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); }
public void InsertOrUpdateOrganizationComments(OrganizationComment organizationcomment) { if (organizationcomment.Id == default(int)) { // New entity context.OrganizationComments.Add(organizationcomment); } else { // Existing entity context.Entry(organizationcomment).State = EntityState.Modified; } }