public MarkTimeAndMaterialJobOrderAsCompletedViewModel GetMarkTimeAndMaterialJobOrderAsCompletedViewModel(Guid jobOrderId)
        {
            var jobOrder = Repository.GetById<Merp.Accountancy.CommandStack.Model.TimeAndMaterialJobOrder>(jobOrderId);

            var model = new MarkTimeAndMaterialJobOrderAsCompletedViewModel();
            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 MarkTimeAndMaterialJobOrderAsCompleted(MarkTimeAndMaterialJobOrderAsCompletedViewModel model)
 {
     var command = new MarkTimeAndMaterialJobOrderAsCompletedCommand(model.JobOrderId, model.DateOfCompletion);
     Bus.Send(command);
 }
Пример #3
0
 public ActionResult MarkTimeAndMaterialJobOrderAsCompleted(MarkTimeAndMaterialJobOrderAsCompletedViewModel model)
 {
     if (!this.ModelState.IsValid)
     {
         return View(model);
     }
     WorkerServices.MarkTimeAndMaterialJobOrderAsCompleted(model);
     return Redirect("/Accountancy/JobOrder");
 }