示例#1
0
        public void Handle(AssociateOutgoingInvoiceToJobOrderCommand message)
        {
            var jobOrder = Repository.GetById <JobOrder, All_JobOrders>(message.JobOrderId);

            jobOrder.AssociateOutgoingInvoice(EventStore, message.InvoiceId);
            Repository.Save(jobOrder);
        }
        public void AssignOutgoingInvoiceToJobOrder(AssignOutgoingInvoiceToJobOrderViewModel model, string jobOrderNumber)
        {
            var jobOrderId = (from j in Database.JobOrders
                              where j.Number == jobOrderNumber
                              select j.OriginalId).Single();
            var command = new AssociateOutgoingInvoiceToJobOrderCommand(model.InvoiceOriginalId, jobOrderId);

            Bus.Send(command);
        }