private ActionResult CreateOrEdit(CommitteePost post, CommitteeEvent evt, HttpPostedFileBase File) { if (File != null) { var postFile = new PostFile(); postFile.PostId = post.PostId; postFile.PostedFile = File; serverFileRepository.InsertOrUpdate(postFile, CurrentUser); serverFileRepository.Save(); return(Edit(post.PostId)); } // Couldn't get the Location.LocationId key to work correctly with the hidden // field so just remove it from validation. ModelState.Remove("Location.LocationId"); if (ModelState.IsValid) { if (evt.Location == null) { return(Save(post)); } else { if (evt.ViewEndDate > evt.EventDate) { evt.EndDate = evt.ViewEndDate; } return(Save(evt)); } } else { if (evt.Location == null) { return(View(post)); } else { return(View(evt)); } } }
public ActionResult Create(CommitteePost post, CommitteeEvent evt, HttpPostedFileBase File) { return(CreateOrEdit(post, evt, File)); }