Beispiel #1
0
        List <CardHolderHistoryItem> ICardHolderService.GetCardHistory(String CardHolderName, int CardID)
        {
            using (GiftEntities GiftEntity = new GiftEntities())
            {
                List <CardHolderHistoryItem> Results = new List <CardHolderHistoryItem>();
                ICardHolderRepository        tCardHolderRepository = new CardHolderRepository(GiftEntity);
                CardHolder  DBCardHolder       = tCardHolderRepository.GetCardHolder(CardHolderName);
                IHistoryDAO tHistoryRepository = new HistoryDAO(GiftEntity);

                List <CardHistory> cHistory = tHistoryRepository.GetCardHistory(CardID);
                foreach (CardHistory ch in cHistory)
                {
                    if (ch.TransType != "SHIP")
                    {
                        CardHolderHistoryItem HI = new CardHolderHistoryItem();
                        HI.When         = ch.When.ToShortDateString();
                        HI.Where        = ch.MerchWhere;
                        HI.WhatHappened = ch.Transaction;
                        HI.Amount       = ch.Amount.ToString();
                        if (ch.PointsGranted != null)
                        {
                            HI.PointsAwarded = ch.PointsGranted.ToString();
                        }
                        HI.Description = ch.Text;
                        Results.Add(HI);
                    }
                }
                return(Results);
            }
        }
        private List <History> GetHistoryData(DateTime EndDate, DateTime StartDate, String Period, String Reseller, String Chain, String MerchantGroup, String Merchant)
        {
            List <History> Results = new List <History>();
            HistoryDAO     HistoryRepositoryInstance = new HistoryDAO(GiftEntity);

            return(HistoryRepositoryInstance.GetHistoryForPeriod(EndDate, StartDate, Period, Reseller, Chain, MerchantGroup, Merchant));
        }
Beispiel #3
0
        // D e t a i l   R e p o r t


        DetailReportInformation ITransactionService.DetailReport(
            String MerchantID, String ClerkID, char WhereFrom,
            String MerchSeqNum, String TerminalID, DateTime LocalTime)
        {
            DetailReportInformation DRI = new DetailReportInformation();
            IHistoryDAO             HistoryRepositoryInstance = new HistoryDAO();

            DetailHistory DHI = HistoryRepositoryInstance.DetailReport(MerchantID, ClerkID,
                                                                       Convert.ToString(WhereFrom), MerchSeqNum,
                                                                       TerminalID, LocalTime);

            DRI.When               = DateTime.Now;
            DRI.ResponseCode       = (char)DHI.ResponseCode;
            DRI.ErrorCode          = (string)DHI.ErrorCode;
            DRI.SummaryInformation = DHI.Summary;


            DRI.Details = new List <TransactionDetailInformation>();
            foreach (CardHistory ch in DHI.DetailItems)
            {
                TransactionDetailInformation TDI = new TransactionDetailInformation();
                TDI.CardNumber = ch.CardNumber;
                TDI.Amount     = ch.Amount.ToString();
                TDI.ID         = ch.ID.ToString();
                if (ch.LocalTime != null)
                {
                    TDI.When = ch.LocalTime.ToString();
                }
                else
                {
                    TDI.When = ch.When.ToString();
                }
                TDI.Clerk       = ch.Clerk;
                TDI.TransType   = ch.TransType;
                TDI.Transaction = ch.Transaction;
                TDI.MerchWhere  = ch.MerchWhere;
                if (ch.Text != null)
                {
                    if (ch.Text.Trim().Length > 0)
                    {
                        TDI.Text = ch.Text;
                    }
                }
                if (ch.InvoiceNumber != null)
                {
                    TDI.InvoiceNumber = ch.InvoiceNumber.Trim();
                }
                else
                {
                    TDI.InvoiceNumber = "";
                }
                DRI.Details.Add(TDI);
            }
            return(DRI);
        }
Beispiel #4
0
        //****************************************************************
        //
        //            R e p o r t s


        /// <summary>
        /// Daily Report
        /// </summary>
        /// <param name="MerchantID"></param>
        /// <param name="ClerkID"></param>
        /// <param name="MerchSeqNum"></param>
        /// <param name="WhereFrom"></param>
        /// <returns></returns>
        DailySalesInformation ITransactionService.DailyReport(
            String MerchantID, String ClerkID, char WhereFrom,
            String MerchSeqNum, String TerminalID, DateTime LocalTime)
        {
            DailySalesInformation DSI = new DailySalesInformation();
            IHistoryDAO           IHR = new HistoryDAO();
            gp_DailyReport_Result DRR = IHR.DailyReport(MerchantID, ClerkID, Convert.ToString(WhereFrom), MerchSeqNum, TerminalID, LocalTime);

            IHR.DailyReportToWeb(DRR, DSI, LocalTime);
            return(DSI);
        }
Beispiel #5
0
        bool ITransactionService.CloseBatch(
            String MerchantID, String ClerkID, char WhereFrom,
            String MerchSeqNum, String TerminalID, DateTime LocalTime)
        {
            IHistoryDAO HistoryRepositoryInstance = new HistoryDAO();

            bool CloseBatchResults = HistoryRepositoryInstance.CloseDay(MerchantID, ClerkID,
                                                                        Convert.ToString(WhereFrom), MerchSeqNum,
                                                                        TerminalID, LocalTime);

            return(CloseBatchResults);
        }
Beispiel #6
0
        //   Get prior day close times for the last X days
        List <PriorDays> ITransactionService.GetPriorCloses(String MerchantID)
        {
            IHistoryDAO      IHR       = new HistoryDAO();
            List <PriorDays> Results   = new List <PriorDays>();
            List <DateTime>  OldCloses = IHR.GetPastCloses(MerchantID);

            foreach (DateTime OC in OldCloses)
            {
                PriorDays tDate = new PriorDays();
                tDate.DisplayDate = OC.Month.ToString() + "/" + OC.Day.ToString("00") + "/" + OC.Year.ToString() + "." +
                                    OC.Hour.ToString() + ":" + OC.Minute.ToString("00");
                tDate.RequestDate = OC.Year.ToString() + "-" + OC.Month.ToString("00") + "-" + OC.Day.ToString("00") + "." +
                                    OC.Hour.ToString("00") + OC.Minute.ToString("00");
                Results.Add(tDate);
            }
            return(Results);
        }
Beispiel #7
0
        ReceiptInformation ITransactionService.LastTransaction(String MerchantID, long TransactionID)
        {
            ReceiptInformation Results = new ReceiptInformation();
            IHistoryDAO        TransactionHistoryRepository = new HistoryDAO();
            LastHistoryItem    LastHistory = TransactionHistoryRepository.GetLastHistoryItem(MerchantID, TransactionID);

            if (LastHistory.ResponseCode != 'A')
            {
                Results.ErrorCode = LastHistory.ErrorCode;
                return(Results);
            }
            Results.TransactionType = LastHistory.LastItem.Transaction;
            Results.When            = LastHistory.LastItem.When;
            Results.CardNumber      = "XXXXXXXXXXXXX" + LastHistory.LastItem.CardNumber;
            Results.Amount          = LastHistory.LastItem.Amount;
            Results.Description     = LastHistory.LastItem.Text;
            return(Results);
        }