public void AssignOutgoingInvoiceToJobOrder(AssignOutgoingInvoiceToJobOrderViewModel model) { var jobOrderId = (from j in Database.JobOrders where j.Number == model.JobOrderNumber select j.OriginalId).Single(); var command = new AssociateOutgoingInvoiceToJobOrderCommand(model.InvoiceOriginalId, jobOrderId); Bus.Send(command); }
public ActionResult AssignOutgoingInvoiceToJobOrder(AssignOutgoingInvoiceToJobOrderViewModel model) { if (!this.ModelState.IsValid) { return View(model); } WorkerServices.AssignOutgoingInvoiceToJobOrder(model); return Redirect("/Accountancy/"); }