public async Task <IActionResult> Edit(int id, [Bind("ReceiveId,ShopId,OrderId,PaymentMid")] TReceive tReceive) { if (id != tReceive.ReceiveId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tReceive); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TReceiveExists(tReceive.ReceiveId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["OrderId"] = new SelectList(_context.TOrder, "OrderId", "OrderId", tReceive.OrderId); ViewData["PaymentMid"] = new SelectList(_context.TPaymentMethod, "PaymentMid", "TypePayment", tReceive.PaymentMid); ViewData["ShopId"] = new SelectList(_context.TShop, "ShopId", "NameShop", tReceive.ShopId); return(View(tReceive)); }
public async Task <IActionResult> Create([Bind("ReceiveId,ShopId,OrderId,PaymentMid")] TReceive tReceive) { if (ModelState.IsValid) { _context.Add(tReceive); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["OrderId"] = new SelectList(_context.TOrder, "OrderId", "OrderId", tReceive.OrderId); ViewData["PaymentMid"] = new SelectList(_context.TPaymentMethod, "PaymentMid", "TypePayment", tReceive.PaymentMid); ViewData["ShopId"] = new SelectList(_context.TShop, "ShopId", "NameShop", tReceive.ShopId); return(View(tReceive)); }
public async Task Run(TReceive rec, IActorContext context) { var result = await _transformer(May(rec)); result.Do(res => { if (_shouldForward) { _target(context).Forward(res); } else { _target(context).Tell(res, context.Self); } }); }
public void Run(TReceive rec, IActorContext context) { var result = _transformer(rec.ToMaybe()); result.Do(res => { if (res == null) { return; } if (_shouldForward) { _target(context).Forward(res); } else { _target(context).Tell(res, context.Self); } }); }
public void Run(TReceive rec, IActorContext context) { var mayRec = May(rec); var result = _transformer(mayRec); result.Do(res => { if (res == null) { return; } if (_shouldForward) { Forward(_target(mayRec), res); } else { Tell(_target(mayRec), res, context.Self); } }); }