public ActionResult BandNewMessage(int? MessageId) { NewMessageViewModel model = new NewMessageViewModel(); if (MessageId.HasValue) { model = msgService.GetNewMessageViewModel(MessageId); } return View(model); }
public ActionResult BandNewMessage(NewMessageViewModel model) { model.AuthorEmail = Session["band"].ToString(); if (ModelState.IsValid) { if (msgService.MessageRecipientsValid(model.Recipients)) { msgService.SendMessage(model); return RedirectToAction("BandSentMessages"); } else { model.RecipientsErrorMsg = "Some of recipients doeas not exists"; } } return View(model); }
public ActionResult SendBandMessage(string Recipient) { NewMessageViewModel model = new NewMessageViewModel(); model.Recipients = Recipient; if (Session["user"] != null) { model.AuthorEmail = Session["user"].ToString(); } else { model.AuthorEmail = Session["band"].ToString(); } return View(model); }
public ActionResult SendBandMessage(NewMessageViewModel model) { if (ModelState.IsValid) { if (msgService.MessageRecipientsValid(model.Recipients)) { msgService.SendMessage(model); return View(model); } else { model.RecipientsErrorMsg = "Some of recipients doeas not exists"; } } return View(model); }