public ActionResult EditShortMessage(SMMessage message) { if (ModelState.IsValid) { string str; bool toAllNewStudents; bool toAllVolunteers; str = Request["toAllNewStudents"]; if (str == "on") { toAllNewStudents = true; message.Type = SystemNoticeType.SetBit(message.Type, SystemNoticeType.NewStudentNotice); } else { toAllNewStudents = false; } str = Request["toAllVolunteers"]; if (str == "on") { toAllVolunteers = true; message.Type = SystemNoticeType.SetBit(message.Type, SystemNoticeType.VolunteerNotice); } else { toAllVolunteers = false; } message.PostDate = DateTime.Now; db.Entry(message).State = EntityState.Modified; db.SaveChanges(); } return(RedirectToAction("Index", "Manage")); }
public ActionResult EditShortMessage() { SMMessage message = web_db.SMMessages.Find(1); if (message == null) { message = new SMMessage { Title = "Empty", Description = "Empty", PostDate = DateTime.Now }; web_db.SMMessages.Add(message); web_db.SaveChanges(); } return(View(message)); }
public static extern IntPtr SendMessage(IntPtr hWnd, SMMessage Msg, SMIndex wParam, int lParam);