public IActionResult CarierMessageRecevied(UsersMessageModel userMessageModelstring, int carierId) { var clearMessageContent = RemoveHtml(userMessageModelstring.MessageContent); var userSenderId = HttpContext.Session.GetString("ActiveCustomerId"); var messages = new FarmerMessage() { MessageContent = clearMessageContent, MessageDate = DateTime.Now.ToShortDateString(), Subject = userMessageModelstring.Subject, UserReceiverId = userMessageModelstring.UserReceiverId, UserSenderId = Convert.ToInt32(userSenderId), MessageReceiverDelete = true, MessageSendDelete = true }; _messageService.Create(messages); TempData["Messages"] = "Mesajınız Başarıyla Nakliyeciye Gönderildi..."; return(Redirect("/Carrier/GetCarierByDetails?id=" + carierId)); }
public IActionResult UserNewMessage(UsersMessageModel usersMessageModel) { var activeSendUserId = HttpContext.Session.GetString("ActiveCustomerId"); if (usersMessageModel != null) { var entity = new FarmerMessage() { UserSenderId = Convert.ToInt32(activeSendUserId), UserReceiverId = usersMessageModel.UserReceiverId, Subject = usersMessageModel.Subject, MessageContent = usersMessageModel.MessageContent, MessageDate = usersMessageModel.MessageDate, MessageReceiverDelete = true, MessageSendDelete = true }; _messageService.Create(entity); return(Redirect("/User/UserAccount")); } return(View()); }