public async Task <IActionResult> LaundriesOrderCreate(LaundriesOrderViewModel laundriesorder) { var laundrie = _context.Laundrys.Single(x => x.Id == laundriesorder.laundriesid); var laundries = new LaundryOrder { Laundry = laundrie, Remarks = laundriesorder.Remarks, State = laundriesorder.LaundriesState }; _context.LaundryOrders.Add(laundries); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); }
// GET: Laundries/Details/5 public async Task <IActionResult> Details(Guid?id) { if (id == null) { return(NotFound()); } var laundries = await _context.Laundrys .FirstOrDefaultAsync(m => m.Id == id); LaundriesOrderViewModel fo = new LaundriesOrderViewModel { laundriesid = laundries.Id, Room = laundries.Mode, Price = laundries.Price, Remarks = "" }; return(View(fo)); }