示例#1
0
        public void InvoiceAccessorArchiveGuestInvoice()
        {   //Archives the fake guest invoice
            int id     = TestCleanupAccessor.GetHotelGuest();
            int worked = access.ArchiveGuestInvoice(id);

            Assert.AreEqual(2, worked);
        }
示例#2
0
        /// <summary>
        /// Pat Banks
        /// Created: 2015/03/03
        /// Calls the InvoiceAccessor method that
        /// archives invoice information for a selected hotel guest
        /// </summary>
        /// <param name="originalInvoice">invoice that was fetched from database - used to check for concurrency errors</param>
        /// <param name="updatedInvoice">information that needs to be updated in the database</param>
        /// <returns>boolean true if result was successful</returns>
        public ResultsArchive ArchiveGuestInvoice(int GuestID)
        {
            try
            {
                int numRows = _invoiceAccessor.ArchiveGuestInvoice(GuestID);

                return(numRows >= 2 ? ResultsArchive.Success : ResultsArchive.ChangedByOtherUser);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }