public ActionResult postnotes(agendanote note) { HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName]; FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(authCookie.Value); var username = ticket.UserData; AgendaNotes newnote = new AgendaNotes(); newnote.addNote(note, commName, meetingId, username); return(RedirectToAction("AgendaAccess", "UIElements", new { committeeName = commName, id = meetingId })); }
public void addNote(agendanote note, String commName, int meetingId, string username) { agendanote notes = new agendanote { Post_date = System.DateTime.Now, Poster = username, Post = note.Post, meetingId = meetingId, creation_dateOfCommittee = System.DateTime.Now, committee_name = commName }; _db.agendanotes.Add(notes); _db.SaveChanges(); _db.Dispose(); }