public void CreateMedicalVendorInvoicesGivesAllItemEntitiesToSingleInvoice() { var medicalVendorInvoiceEntities = new EntityCollection <PhysicianInvoiceEntity> { new PhysicianInvoiceEntity() }; var medicalVendorInvoiceItemEntities = new EntityCollection <PhysicianInvoiceItemEntity>(); var medicalVendorInvoiceItems = new List <MedicalVendorInvoiceItem> { new MedicalVendorInvoiceItem(), new MedicalVendorInvoiceItem() }; Expect.Call(_medicalVendorInvoiceItemFactory.CreateMedicalVendorInvoiceItems(medicalVendorInvoiceItemEntities)) .Return(medicalVendorInvoiceItems); Expect.Call(() => _medicalVendorInvoiceBaseFactory.SetMedicalVendorInvoiceBaseFields(null, null)).IgnoreArguments(); _mocks.ReplayAll(); List <PhysicianInvoice> medicalVendorInvoices = _medicalVendorInvoiceFactory. CreateMedicalVendorInvoices(medicalVendorInvoiceEntities, medicalVendorInvoiceItemEntities); _mocks.VerifyAll(); PhysicianInvoice medicalVendorInvoice = medicalVendorInvoices.Single(); Assert.IsNotNull(medicalVendorInvoice.MedicalVendorInvoiceItems); Assert.AreEqual(medicalVendorInvoiceItems.Count, medicalVendorInvoice.MedicalVendorInvoiceItems.Count); }
public List <PhysicianInvoice> CreateMedicalVendorInvoices(EntityCollection <PhysicianInvoiceEntity> medicalVendorInvoiceEntities, EntityCollection <PhysicianInvoiceItemEntity> medicalVendorInvoiceItemEntities) { if (medicalVendorInvoiceEntities == null) { throw new ArgumentNullException("medicalVendorInvoiceEntities", "The given MedicalVendorInvoiceEntity collection cannot be null."); } if (medicalVendorInvoiceItemEntities == null) { throw new ArgumentNullException("medicalVendorInvoiceItemEntities", "The given MedicalVendorInvoiceItemEntity collection cannot be null."); } var medicalVendorInvoices = new List <PhysicianInvoice>(); foreach (var medicalVendorInvoiceEntity in medicalVendorInvoiceEntities) { var invoiceItemEntitiesForInvoice = new EntityCollection <PhysicianInvoiceItemEntity> (medicalVendorInvoiceItemEntities.Where(i => i.PhysicianInvoiceId == medicalVendorInvoiceEntity.PhysicianId).ToList()); PhysicianInvoice medicalVendorInvoice = CreateMedicalVendorInvoice(medicalVendorInvoiceEntity, invoiceItemEntitiesForInvoice); medicalVendorInvoices.Add(medicalVendorInvoice); } return(medicalVendorInvoices); }
public void GetMedicalVendorInvoiceReturnsInvoiceWhenValidGuidGiven() { PhysicianInvoice medicalVendorInvoice = _repository. GetMedicalVendorInvoice(_validGuid); Assert.IsNotNull(medicalVendorInvoice); Assert.AreEqual(_validGuid, medicalVendorInvoice.ApprovalGuid); }
public void GetOldestUnapprovedInvoiceForMedicalVendorUserReturnsInvoice() { const long organizationRoleUserWithUnapprovedInvoice = 610; PhysicianInvoice medicalVendorInvoice = _repository. GetOldestUnapprovedInvoiceForMedicalVendorUser(organizationRoleUserWithUnapprovedInvoice); Assert.IsNotNull(medicalVendorInvoice, "Null Medical Vendor Invoice returned."); }
public void GetMedicalVendorInvoiceReturnsInvoiceWhenValidIdGiven() { PhysicianInvoice medicalVendorInvoice = _repository. GetMedicalVendorInvoice(VALID_MEDICAL_VENDOR_INVOICE_ID); Assert.IsNotNull(medicalVendorInvoice); Assert.AreEqual(VALID_MEDICAL_VENDOR_INVOICE_ID, medicalVendorInvoice.Id); }
public void SaveMedicalVendorInvoiceThrowsExceptionWhenGivenInvalidMedicalVendorInvoice() { var medicalVendorInvoice = new PhysicianInvoice(); Expect.Call(_mockedValidator.IsValid(medicalVendorInvoice)).Return(false); Expect.Call(_mockedValidator.GetBrokenRuleErrorMessages()).Return(new List <string>()); _mocks.ReplayAll(); _medicalVendorInvoiceRepository.SaveMedicalVendorInvoice(medicalVendorInvoice); _mocks.VerifyAll(); }
public void ChangeMedicalVendorInvoiceApprovalStatusChangesStatusOfValidId() { PhysicianInvoice medicalVendorInvoice = _repository. GetMedicalVendorInvoice(VALID_MEDICAL_VENDOR_INVOICE_ID); ApprovalStatus newStatus = medicalVendorInvoice.ApprovalStatus == ApprovalStatus.Approved ? ApprovalStatus.Unapproved : ApprovalStatus.Approved; _repository.ChangeMedicalVendorInvoiceApprovalStatus(VALID_MEDICAL_VENDOR_INVOICE_ID, newStatus); medicalVendorInvoice = _repository.GetMedicalVendorInvoice(VALID_MEDICAL_VENDOR_INVOICE_ID); Assert.AreEqual(newStatus, medicalVendorInvoice.ApprovalStatus); }
public void CreateMedicalVendorInvoiceReturnsMedicalVendorInvoiceWhenEntityAndListGiven() { Expect.Call(() => _medicalVendorInvoiceBaseFactory.SetMedicalVendorInvoiceBaseFields(null, null)).IgnoreArguments(); _mocks.ReplayAll(); PhysicianInvoice medicalVendorInvoice = _medicalVendorInvoiceFactory. CreateMedicalVendorInvoice(new PhysicianInvoiceEntity(), new List <MedicalVendorInvoiceItem>()); _mocks.VerifyAll(); Assert.IsNotNull(medicalVendorInvoice); }
public void ChangeMedicalVendorInvoicePaymentStatusChangesStatusOfValidId() { PhysicianInvoice medicalVendorInvoice = _repository. GetMedicalVendorInvoice(VALID_MEDICAL_VENDOR_INVOICE_ID); PaymentStatus newStatus = medicalVendorInvoice.PaymentStatus == PaymentStatus.Paid ? PaymentStatus.Unpaid : PaymentStatus.Paid; _repository.ChangeMedicalVendorInvoicePaymentStatus(VALID_MEDICAL_VENDOR_INVOICE_ID, newStatus, DateTime.Now); medicalVendorInvoice = _repository.GetMedicalVendorInvoice(VALID_MEDICAL_VENDOR_INVOICE_ID); Assert.AreEqual(newStatus, medicalVendorInvoice.PaymentStatus); }
public void GetOldestUnapprovedInvoiceForMedicalVendorUserReturnsNullWhenNoUnapprovedInvoicesExistsForId() { ExpectGetDataAccessAdapterAndDispose(); ExpectFetchEntityCollectionWithSortExpression(); _mocks.ReplayAll(); PhysicianInvoice medicalVendorInvoice = _medicalVendorInvoiceRepository. GetOldestUnapprovedInvoiceForMedicalVendorUser(1); _mocks.VerifyAll(); Assert.IsNull(medicalVendorInvoice); }
protected void SetMedicalVendorInoviceDisplayControls(PhysicianInvoice medicalVendorInvoice) { invoiceNumberLiteral.Text = HttpUtility.UrlEncode(medicalVendorInvoice.Id.ToString()); payPeriodLiteral.Text = medicalVendorInvoice.PayPeriodString; physicianNameLiteral.Text = HttpUtility.UrlEncode(medicalVendorInvoice.PhysicianName); medicalVendorNameLiteral.Text = medicalVendorInvoice.MedicalVendorName; NumberOfEvaluationsLiteral.Text = medicalVendorInvoice.MedicalVendorInvoiceItems.Count.ToString(); TotalAmountEarnedLiteral.Text = string.Format("{0:c}", medicalVendorInvoice.MedicalVendorInvoiceItems. Sum(i => i.OrganizationRoleUserAmountEarned)); invoiceItemRepeater.DataSource = medicalVendorInvoice.MedicalVendorInvoiceItems.OrderBy(i => i.ReviewDate); invoiceItemRepeater.DataBind(); }
public void SaveMedicalVendorInvoiceThrowsExceptionWhenOverlappingInvoiceFound() { var medicalVendorInvoice = new PhysicianInvoice(); Expect.Call(_mockedValidator.IsValid(medicalVendorInvoice)).Return(true); ExpectGetDataAccessAdapterAndDispose(); ExpectFetchEntityCollection(new EntityCollection <PhysicianInvoiceEntity> { new PhysicianInvoiceEntity() }); _mocks.ReplayAll(); _medicalVendorInvoiceRepository.SaveMedicalVendorInvoice(medicalVendorInvoice); _mocks.VerifyAll(); }
public void CreateMedicalVendorInvoiceEntitySetsOrganizationRoleUserNameToPhysicianName() { var medicalVendorInvoice = new PhysicianInvoice { PhysicianName = "Bobby" }; _mocks.ReplayAll(); PhysicianInvoiceEntity medicalVendorInvoiceEntity = _medicalVendorInvoiceFactory. CreateMedicalVendorInvoiceEntity(medicalVendorInvoice); _mocks.VerifyAll(); Assert.AreEqual(medicalVendorInvoice.PhysicianName, medicalVendorInvoiceEntity.PhysicianName); }
public void SaveMedicalVendorInvoicePersistsValidInvoiceToDatabase() { Guid approvalGuid = Guid.NewGuid(); var medicalVendorInvoiceItems = new List <MedicalVendorInvoiceItem> { new MedicalVendorInvoiceItem { MedicalVendorInvoiceId = 1, MedicalVendorAmountEarned = 3.23m, OrganizationRoleUserAmountEarned = 5.33m, CustomerId = 6, CustomerName = "CustomerName", EventDate = new DateTime(2009, 3, 1), EventId = 34, EventName = "EventName", PackageName = "PackageName", PodName = "PodName", ReviewDate = new DateTime(2009, 6, 1), EvaluationStartTime = new DateTime(2009, 6, 1), EvaluationEndTime = new DateTime(2009, 6, 2) } }; var medicalVendorInvoice = new PhysicianInvoice { ApprovalGuid = approvalGuid, ApprovalStatus = ApprovalStatus.Unapproved, DateGenerated = new DateTime(2009, 6, 1), MedicalVendorAddress = "MedicalVendorAddress", MedicalVendorId = VALID_MEDICAL_VENDOR_ID, MedicalVendorInvoiceItems = medicalVendorInvoiceItems, MedicalVendorName = "MedicalVendorName", PhysicianId = 1, PhysicianName = "Bob", PaymentStatus = PaymentStatus.Paid, PayPeriodEndDate = new DateTime(2009, 6, 12), PayPeriodStartDate = new DateTime(2009, 6, 1) }; _repository.SaveMedicalVendorInvoice(medicalVendorInvoice); PhysicianInvoice retrievedInvoice = _repository.GetMedicalVendorInvoice(approvalGuid); Assert.AreEqual(medicalVendorInvoice.ApprovalGuid, retrievedInvoice.ApprovalGuid); Assert.AreEqual(medicalVendorInvoice.PayPeriodEndDate, retrievedInvoice.PayPeriodEndDate); Assert.AreEqual(medicalVendorInvoice.PaymentStatus, retrievedInvoice.PaymentStatus); }
public void CreateMedicalVendorInvoiceMapsGivenListToMedicalVendorInvoiceItemCollection() { var medicalVendorInvoiceItems = new List <MedicalVendorInvoiceItem> { new MedicalVendorInvoiceItem(1), new MedicalVendorInvoiceItem(2) }; Expect.Call(() => _medicalVendorInvoiceBaseFactory.SetMedicalVendorInvoiceBaseFields(null, null)).IgnoreArguments(); _mocks.ReplayAll(); PhysicianInvoice medicalVendorInvoice = _medicalVendorInvoiceFactory. CreateMedicalVendorInvoice(new PhysicianInvoiceEntity(), medicalVendorInvoiceItems); _mocks.VerifyAll(); Assert.AreEqual(medicalVendorInvoiceItems, medicalVendorInvoice.MedicalVendorInvoiceItems); }
public void SaveMedicalVendorInvoiceThrowsExceptionWhenSavingInvoiceFails() { var medicalVendorInvoice = new PhysicianInvoice(); Expect.Call(_mockedValidator.IsValid(medicalVendorInvoice)).Return(true); ExpectGetDataAccessAdapterAndDispose(2); ExpectFetchEntityCollection(); ExpectTransaction("MedicalVendorInvoiceRepository.SaveMedicalVendorInvoice", false); ExpectSaveEntity(false, true); Expect.Call(_medicalVendorInvoiceFactory.CreateMedicalVendorInvoiceEntity(medicalVendorInvoice)) .Return(new PhysicianInvoiceEntity()); _mocks.ReplayAll(); _medicalVendorInvoiceRepository.SaveMedicalVendorInvoice(medicalVendorInvoice); _mocks.VerifyAll(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { PhysicianInvoice medicalVendorInvoice = _invoiceRepository. GetOldestUnapprovedInvoiceForMedicalVendorUser(MedicalVendorMedicalVendorUserId); if (medicalVendorInvoice != null) { SetMedicalVendorInoviceDisplayControls(medicalVendorInvoice); } else { throw new Exception("No invoices exist."); } } }
public void CreateMedicalVendorInvoiceReturnsMedicalVendorInvoice() { var medicalVendorInvoiceItemEntities = new EntityCollection <PhysicianInvoiceItemEntity>(); Expect.Call(_medicalVendorInvoiceItemFactory.CreateMedicalVendorInvoiceItems(medicalVendorInvoiceItemEntities)) .Return(new List <MedicalVendorInvoiceItem>()); Expect.Call(() => _medicalVendorInvoiceBaseFactory.SetMedicalVendorInvoiceBaseFields(null, null)).IgnoreArguments(); _mocks.ReplayAll(); PhysicianInvoice medicalVendorInvoice = _medicalVendorInvoiceFactory.CreateMedicalVendorInvoice (new PhysicianInvoiceEntity(), medicalVendorInvoiceItemEntities); _mocks.VerifyAll(); Assert.IsNotNull(medicalVendorInvoice); }
public PhysicianInvoice GetInvoice(long invoiceId) { try { PhysicianInvoice medicalVendorInvoice = _medicalVendorInvoiceRepository.GetMedicalVendorInvoice(invoiceId); medicalVendorInvoice.MedicalVendorInvoiceItems = medicalVendorInvoice. MedicalVendorInvoiceItems.OrderBy(mvii => mvii.ReviewDate).ThenBy(mvii => mvii.EventName).ToList(); return(medicalVendorInvoice); } catch (Exception) { //TODO:log the exception in log4net return(null); } }
public List <PhysicianInvoice> GenerateInvoicesForMedicalVendor(long medicalVendorId, DateTime payPeriodStartDate, DateTime payPeriodEndDate) { var organizationRoleUserIds = _physicianRepository.GetAllPhysicianIdsforaMedicalVendor(medicalVendorId); var medicalVendorInvoices = new List <PhysicianInvoice>(); foreach (long organizationRoleUserId in organizationRoleUserIds) { PhysicianInvoice medicalVendorInvoice = GenerateInvoice(medicalVendorId, organizationRoleUserId, payPeriodStartDate, payPeriodEndDate); if (medicalVendorInvoice != null) { medicalVendorInvoices.Add(medicalVendorInvoice); } } return(medicalVendorInvoices); }
public PhysicianInvoice CreateMedicalVendorInvoice(PhysicianInvoiceEntity medicalVendorInvoiceEntity, List <MedicalVendorInvoiceItem> medicalVendorInvoiceItems) { if (medicalVendorInvoiceEntity == null) { throw new ArgumentNullException("medicalVendorInvoiceEntity", "The given MedicalVendorInvoiceEntity cannot be null."); } if (medicalVendorInvoiceItems == null) { throw new ArgumentNullException("medicalVendorInvoiceEntity", "The given list of MedicalVendorInvoiceItems cannot be null."); } var medicalVendorInvoice = new PhysicianInvoice(medicalVendorInvoiceEntity.PhysicianInvoiceId) { MedicalVendorInvoiceItems = medicalVendorInvoiceItems }; _medicalVendorInvoiceBaseFactory.SetMedicalVendorInvoiceBaseFields(medicalVendorInvoice, medicalVendorInvoiceEntity); return(medicalVendorInvoice); }
public void CreateMedicalVendorInvoiceEntitySetsApprovalStatusToApprovalStatusByteValue() { var approvedMedicalVendorInvoice = new PhysicianInvoice { ApprovalStatus = ApprovalStatus.Approved }; var unapprovedMedicalVendorInvoice = new PhysicianInvoice { ApprovalStatus = ApprovalStatus.Unapproved }; _mocks.ReplayAll(); PhysicianInvoiceEntity approvedMedicalVendorInvoiceEntity = _medicalVendorInvoiceFactory. CreateMedicalVendorInvoiceEntity(approvedMedicalVendorInvoice); PhysicianInvoiceEntity unapprovedMedicalVendorInvoiceEntity = _medicalVendorInvoiceFactory. CreateMedicalVendorInvoiceEntity(unapprovedMedicalVendorInvoice); _mocks.VerifyAll(); Assert.AreEqual((byte)approvedMedicalVendorInvoice.ApprovalStatus, approvedMedicalVendorInvoiceEntity.ApprovalStatus); Assert.AreEqual((byte)unapprovedMedicalVendorInvoice.ApprovalStatus, unapprovedMedicalVendorInvoiceEntity.ApprovalStatus); }
public void CreateMedicalVendorInvoiceEntitySetsPaymentStatusToPaymentStatusByteValue() { var paidMedicalVendorInvoice = new PhysicianInvoice { PaymentStatus = PaymentStatus.Paid }; var unpaidMedicalVendorInvoice = new PhysicianInvoice { PaymentStatus = PaymentStatus.Unpaid }; _mocks.ReplayAll(); PhysicianInvoiceEntity paidMedicalVendorInvoiceEntity = _medicalVendorInvoiceFactory. CreateMedicalVendorInvoiceEntity(paidMedicalVendorInvoice); PhysicianInvoiceEntity unpaidMedicalVendorInvoiceEntity = _medicalVendorInvoiceFactory. CreateMedicalVendorInvoiceEntity(unpaidMedicalVendorInvoice); _mocks.VerifyAll(); Assert.AreEqual((byte)paidMedicalVendorInvoice.PaymentStatus, paidMedicalVendorInvoiceEntity.PaymentStatus); Assert.AreEqual((byte)unpaidMedicalVendorInvoice.PaymentStatus, unpaidMedicalVendorInvoiceEntity.PaymentStatus); }
public void CreateMedicalVendorInvoiceEntityMapsDomainPropertiesToEntityPropertiesCorrectly() { var medicalVendorInvoice = new PhysicianInvoice { ApprovalGuid = Guid.NewGuid(), PhysicianId = 3, PayPeriodEndDate = new DateTime(2001, 3, 3), MedicalVendorName = "Name" }; _mocks.ReplayAll(); PhysicianInvoiceEntity medicalVendorInvoiceEntity = _medicalVendorInvoiceFactory. CreateMedicalVendorInvoiceEntity(medicalVendorInvoice); _mocks.VerifyAll(); Assert.AreEqual(medicalVendorInvoice.ApprovalGuid, medicalVendorInvoiceEntity.ApprovalGuid); Assert.AreEqual(medicalVendorInvoice.PhysicianId, medicalVendorInvoiceEntity.PhysicianProfile.PhysicianId); Assert.AreEqual(medicalVendorInvoice.PayPeriodEndDate, medicalVendorInvoiceEntity.PayPeriodEndDate); Assert.AreEqual(medicalVendorInvoice.MedicalVendorName, medicalVendorInvoiceEntity.MedicalVendorName); }
public void GetOldestUnapprovedInvoiceForMedicalVendorUserReturnsInvoiceWhenUnapprovedInvoiceExists() { var collectionToReturn = new EntityCollection <PhysicianInvoiceEntity> { new PhysicianInvoiceEntity(3) }; ExpectGetDataAccessAdapterAndDispose(2); ExpectFetchEntityCollectionWithSortExpression(collectionToReturn); ExpectFetchEntity(true); ExpectFetchEntityCollection(); Expect.Call(_medicalVendorInvoiceFactory.CreateMedicalVendorInvoice(null, (EntityCollection <PhysicianInvoiceItemEntity>)null)) .IgnoreArguments().Return(new PhysicianInvoice()); _mocks.ReplayAll(); PhysicianInvoice medicalVendorInvoice = _medicalVendorInvoiceRepository. GetOldestUnapprovedInvoiceForMedicalVendorUser(1); _mocks.VerifyAll(); Assert.IsNotNull(medicalVendorInvoice); }
public PhysicianInvoiceEntity CreateMedicalVendorInvoiceEntity(PhysicianInvoice medicalVendorInvoice) { if (medicalVendorInvoice == null) { throw new ArgumentNullException("medicalVendorInvoice"); } return(new PhysicianInvoiceEntity { ApprovalGuid = medicalVendorInvoice.ApprovalGuid, ApprovalStatus = (byte)medicalVendorInvoice.ApprovalStatus, DateGenerated = medicalVendorInvoice.DateGenerated, MedicalVendorAddress = medicalVendorInvoice.MedicalVendorAddress, MedicalVendorName = medicalVendorInvoice.MedicalVendorName, PhysicianId = medicalVendorInvoice.PhysicianId, PhysicianName = medicalVendorInvoice.PhysicianName, PaymentStatus = (byte)medicalVendorInvoice.PaymentStatus, PayPeriodEndDate = medicalVendorInvoice.PayPeriodEndDate, PayPeriodStartDate = medicalVendorInvoice.PayPeriodStartDate, DatePaid = medicalVendorInvoice.DatePaid }); }
public void SaveMedicalVendorInvoiceCommitsTransactionOnSuccessfulPersistence() { var medicalVendorInvoice = new PhysicianInvoice(); var medicalVendorInvoiceEntity = new PhysicianInvoiceEntity(3); const bool expectCommit = true; Expect.Call(_mockedValidator.IsValid(medicalVendorInvoice)).Return(true); ExpectGetDataAccessAdapterAndDispose(2); ExpectFetchEntityCollection(); ExpectTransaction("MedicalVendorInvoiceRepository.SaveMedicalVendorInvoice", expectCommit); ExpectSaveEntity(true, true); ExpectSaveEntityCollection(1); Expect.Call(_medicalVendorInvoiceFactory.CreateMedicalVendorInvoiceEntity(medicalVendorInvoice)) .Return(medicalVendorInvoiceEntity); Expect.Call(_medicalVendorInvoiceItemFactory.CreateMedicalVendorInvoiceItemEntities (medicalVendorInvoiceEntity.PhysicianInvoiceId, medicalVendorInvoice.MedicalVendorInvoiceItems)) .Return(new EntityCollection <PhysicianInvoiceItemEntity>()); _mocks.ReplayAll(); _medicalVendorInvoiceRepository.SaveMedicalVendorInvoice(medicalVendorInvoice); _mocks.VerifyAll(); }
public void SaveMedicalVendorInvoice(PhysicianInvoice medicalVendorInvoice) { if (medicalVendorInvoice == null) { throw new ArgumentNullException("medicalVendorInvoice", "The given MedicalVendorInvoice cannot be null."); } if (!_validator.IsValid(medicalVendorInvoice)) { throw new InvalidObjectException <PhysicianInvoice>(_validator); } // TODO: TEST (Integration) var medicalVendorInvoiceEntities = new EntityCollection <PhysicianInvoiceEntity>(); IRelationPredicateBucket bucket = new RelationPredicateBucket (PhysicianInvoiceFields.PhysicianId == medicalVendorInvoice.PhysicianId & PhysicianInvoiceFields.PayPeriodStartDate <= medicalVendorInvoice.PayPeriodStartDate & PhysicianInvoiceFields.PayPeriodEndDate >= medicalVendorInvoice.PayPeriodStartDate); bucket.PredicateExpression.AddWithOr( PhysicianInvoiceFields.PhysicianId == medicalVendorInvoice.PhysicianId & PhysicianInvoiceFields.PayPeriodStartDate <= medicalVendorInvoice.PayPeriodEndDate & PhysicianInvoiceFields.PayPeriodEndDate >= medicalVendorInvoice.PayPeriodEndDate); using (var myAdapter = PersistenceLayer.GetDataAccessAdapter()) { myAdapter.FetchEntityCollection(medicalVendorInvoiceEntities, bucket); } if (!medicalVendorInvoiceEntities.IsEmpty()) { throw new OverlappingInvoiceException(medicalVendorInvoice); } PhysicianInvoiceEntity medicalVendorInvoiceEntity = _medicalVendorInvoiceFactory. CreateMedicalVendorInvoiceEntity(medicalVendorInvoice); using (var myAdapter = PersistenceLayer.GetDataAccessAdapter()) { myAdapter.StartTransaction(IsolationLevel.ReadCommitted, "MedicalVendorInvoiceRepository.SaveMedicalVendorInvoice"); try { if (!myAdapter.SaveEntity(medicalVendorInvoiceEntity, true)) { throw new PersistenceFailureException(); } var medicalVendorInvoiceItemEntities = _medicalVendorInvoiceItemFactory. CreateMedicalVendorInvoiceItemEntities(medicalVendorInvoiceEntity.PhysicianInvoiceId, medicalVendorInvoice.MedicalVendorInvoiceItems); if (myAdapter.SaveEntityCollection(medicalVendorInvoiceItemEntities) == 0) { throw new PersistenceFailureException(); } myAdapter.Commit(); } catch (Exception) { myAdapter.Rollback(); throw; } } }
public void SetUp() { _medicalVendorInvoice = new PhysicianInvoice(); }
public void TearDown() { _medicalVendorInvoice = null; }