Exemplo n.º 1
0
        public void GetOldestUnapprovedInvoiceForMedicalVendorUserReturnsNullWhenNoUnapprovedInvoicesExistsForId()
        {
            ExpectGetDataAccessAdapterAndDispose();
            ExpectFetchEntityCollectionWithSortExpression();

            _mocks.ReplayAll();
            PhysicianInvoice medicalVendorInvoice = _medicalVendorInvoiceRepository.
                                                    GetOldestUnapprovedInvoiceForMedicalVendorUser(1);

            _mocks.VerifyAll();

            Assert.IsNull(medicalVendorInvoice);
        }
        public void GetOldestUnapprovedInvoiceForMedicalVendorUserReturnsInvoice()
        {
            const long       organizationRoleUserWithUnapprovedInvoice = 610;
            PhysicianInvoice medicalVendorInvoice = _repository.
                                                    GetOldestUnapprovedInvoiceForMedicalVendorUser(organizationRoleUserWithUnapprovedInvoice);

            Assert.IsNotNull(medicalVendorInvoice, "Null Medical Vendor Invoice returned.");
        }
Exemplo n.º 3
0
 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 PhysicianInvoice GetOldestUnapprovedInvoiceForMedicalVendorUser(long medicalVendorMedicalVenderUserId)
        {
            try
            {
                PhysicianInvoice medicalVendorInvoice = _medicalVendorInvoiceRepository.
                                                        GetOldestUnapprovedInvoiceForMedicalVendorUser(medicalVendorMedicalVenderUserId);

                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);
            }
        }