Пример #1
0
        public ActionResult CreateOrganizationComment(int organizationId)
        {
            var comment = new OrganizationComment {
                OrganizationId = organizationId
            };

            return(PartialView("_CreateOrEditOrganizationComment", comment));
        }
Пример #2
0
 public ActionResult EditOrganizationComment(OrganizationComment organizationcomment)
 {
     if (ModelState.IsValid)
     {
         _commentRepo.InsertOrUpdateOrganizationComments(organizationcomment);
         _commentRepo.Save();
         return(new HttpStatusCodeResult(HttpStatusCode.OK));
     }
     return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
 }
Пример #3
0
 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;
     }
 }