public MarkFixedPriceJobOrderAsCompletedViewModel GetMarkFixedPriceJobOrderAsCompletedViewModel(Guid jobOrderId) { var jobOrder = Repository.GetById<Merp.Accountancy.CommandStack.Model.FixedPriceJobOrder>(jobOrderId); var model = new MarkFixedPriceJobOrderAsCompletedViewModel(); model.DateOfCompletion = DateTime.Now; model.CustomerName = jobOrder.Customer.Name; model.JobOrderId = jobOrder.Id; model.JobOrderNumber = jobOrder.Number; model.JobOrderName = jobOrder.Name; return model; }
public void MarkFixedPriceJobOrderAsCompleted(MarkFixedPriceJobOrderAsCompletedViewModel model) { var command = new MarkFixedPriceJobOrderAsCompletedCommand(model.JobOrderId, model.DateOfCompletion); Bus.Send(command); }
public ActionResult MarkFixedPriceJobOrderAsCompleted(MarkFixedPriceJobOrderAsCompletedViewModel model) { if (!this.ModelState.IsValid) { return View(model); } WorkerServices.MarkFixedPriceJobOrderAsCompleted(model); return Redirect("/Accountancy/JobOrder"); }