public ActionResult CreateMessage(int campaignId) { MessageContentViewModel model = new MessageContentViewModel() { }; model.CampaignId = campaignId; var campaign = _campaignService.GetCampaignById(campaignId); model.ProductId = campaign.Products.Where(pr=>pr.WhenDeleted == null).First().Id; model.CampaignTitle = campaign.Title; return View(model); }
public ActionResult SendSellerMessageForApproving(MessageContentViewModel model) { if (TryUpdateModel(model)) { int currentUser = Services.WorkContext.CurrentUser.Id; _messageService.AddMessage(currentUser, model.Content, model.From, DateTime.UtcNow, model.CampaignId, model.Subject, false); _notifier.Information(T("Your message has been sent for approving!")); return RedirectToAction("Messages"); } return View("CreateMessage", model); }