public ExtendFixedPriceViewModel GetExtendFixedPriceViewModel(Guid jobOrderId) { var jobOrder = Repository.GetById<Merp.Accountancy.CommandStack.Model.FixedPriceJobOrder>(jobOrderId); var model = new ExtendFixedPriceViewModel(); model.NewDueDate = jobOrder.DueDate; model.Price = jobOrder.Price.Amount; model.JobOrderNumber = jobOrder.Number; model.JobOrderId = jobOrder.Id; model.JobOrderName = jobOrder.Name; model.CustomerName = jobOrder.Customer.Name; return model; }
public void ExtendFixedPriceJobOrder(ExtendFixedPriceViewModel model) { var command = new ExtendFixedPriceJobOrderCommand(model.JobOrderId, model.NewDueDate, model.Price); Bus.Send(command); }
public ActionResult ExtendFixedPrice(ExtendFixedPriceViewModel model) { if (!this.ModelState.IsValid) { return View(model); } WorkerServices.ExtendFixedPriceJobOrder(model); return Redirect("/Accountancy/JobOrder"); }