protected override void Update() { using (var vatInvoiceService = SvcClientManager.GetSvcClient<VATInvoiceServiceClient>(SvcType.VATInvoiceSvc) ) { var vtr = new VATInvoice { Id = ObjectId, BPId = BPId, InternalBPId = InternalBPId, Comment = Comment, InvoicedDate = InvoicedDate, InvoiceNo = InvoiceNo, VATInvoiceType = VATInvoiceType, VATInvoiceRequestId = VATInvoiceRequestId }; vatInvoiceService.UpdateDocument(CurrentUser.Id, vtr, AddVATInvoiceLines, UpdateVATInvoiceLines, DeleteVATInvoiceLines); } }
protected override void Create() { using (var vatInvoiceService = SvcClientManager.GetSvcClient<VATInvoiceServiceClient>(SvcType.VATInvoiceSvc) ) { var vatInvoice = new VATInvoice { BPId = BPId, InternalBPId = InternalBPId, Comment = Comment, InvoicedDate = InvoicedDate, InvoiceNo = InvoiceNo, VATInvoiceType = VATInvoiceType, IsDeleted = false, IsDraft = false, VATInvoiceRequestId=VATInvoiceRequestId }; foreach (VATInvoiceLine itemLine in AddVATInvoiceLines) { if (itemLine.QuotaId <= 0) { throw new Exception(ResVATInvoice.QuotaOfInvoiceLineRequired); } if (itemLine.VATRateId <= 0) { throw new Exception(ResVATInvoice.TaxRateOfInvoiceLineRequired); } } vatInvoiceService.CreateDocument(CurrentUser.Id, vatInvoice, AddVATInvoiceLines); } }