public ExtendTimeAndMaterialViewModel GetExtendTimeAndMaterialViewModel(Guid jobOrderId)
 {
     var jobOrder = Repository.GetById<Merp.Accountancy.CommandStack.Model.TimeAndMaterialJobOrder>(jobOrderId);
     var model = new ExtendTimeAndMaterialViewModel();
     model.Value = jobOrder.Value.Amount;
     if (jobOrder.DateOfExpiration.HasValue)
     {
         model.NewDateOfExpiration = jobOrder.DateOfExpiration;
     }
     model.JobOrderNumber = jobOrder.Number;
     model.JobOrderId = jobOrder.Id;
     model.JobOrderName = jobOrder.Name;
     model.CustomerName = jobOrder.Customer.Name;
     return model;
 }
 public void ExtendTimeAndMaterialJobOrder(ExtendTimeAndMaterialViewModel model)
 {
     var command = new ExtendTimeAndMaterialJobOrderCommand(model.JobOrderId, model.NewDateOfExpiration, model.Value);
     Bus.Send(command);
 }
Exemple #3
0
 public ActionResult ExtendTimeAndMaterial(ExtendTimeAndMaterialViewModel model)
 {
     if (!this.ModelState.IsValid)
     {
         return View(model);
     }
     WorkerServices.ExtendTimeAndMaterialJobOrder(model);
     return Redirect("/Accountancy/JobOrder");
 }