public IActionResult SubmitMessage(InboxCart inboxCart) { NavLayout(); Inbox inbox = new Inbox(); inbox = inboxCart.Inbox; inbox.InboxId = inboxCart.InboxId; inbox.ItemId = inboxCart.ItemId; _repo.Inbox.Create(inbox); _repo.Save(); var cartId = inboxCart.cartId; return(RedirectToAction("AddedToCart", new { cartId })); }
public ActionResult SubmitMessage(int cartId) { NavLayout(); var cart = _repo.ShoppingCart.FindByCondition(s => s.Id == cartId).SingleOrDefault(); var item = _repo.Items.FindByCondition(i => i.ItemId == cart.ItemId).SingleOrDefault(); var inventory = _repo.Inventory.FindByCondition(i => i.ItemId == item.ItemId).SingleOrDefault(); var itemOwner = _repo.RoboDexer.FindByCondition(r => r.RoboDexerId == inventory.RoboDexerId).SingleOrDefault(); InboxCart inboxCart = new InboxCart(); inboxCart.InboxId = itemOwner.InboxId; inboxCart.cartId = cartId; inboxCart.ItemId = item.ItemId; return(View(inboxCart)); }