Esempio n. 1
0
        //.................................

        public void LogException(FileLogger.LogErrorLevel inErrorLevel, FileLogger.LogErrorLevelFile inErrorLevelFile,
                                 string inMessage, Exception inException)
        {
            try
            {
                string str = GetLogErrorStr(inErrorLevel, inErrorLevelFile, inMessage);

                //getLoggerScrErr().Log(LogLevel.Error, str);
                //getLoggerFileErr().LogException(LogLevel.Error, str, inException);

                string detail = @"";
                try
                {
                    detail = string.Format(@"{0}: {1}", inException.Message, inException.StackTrace);

                    //detail = inException.InnerException.Message;
                }
                catch (Exception)
                {
                }

                AddMailBoxEntryError(inErrorLevel, inErrorLevelFile, inMessage, detail);
            }
            catch (Exception)
            {
            }
        }
Esempio n. 2
0
        public Summa(string outputFilePath, string outputFilePathIsAccessDoor, bool doorAccessFlag)
        {
            _outputFilePath             = outputFilePath;
            _outputFilePathIsAccessDoor = outputFilePathIsAccessDoor;
            _isDoorAccess = doorAccessFlag;


            XmlDocument doc = null;

            try
            {
                doc = new XmlDocument();

                //XmlTextReader reader = new XmlTextReader(Application.StartupPath + System.IO.Path.DirectorySeparatorChar + @"summaIdMap.xml");
                //XmlTextReader reader = new XmlTextReader( StartupPath.text + System.IO.Path.DirectorySeparatorChar + @"summaIdMap.xml" );

                XmlTextReader reader = new XmlTextReader(_singletonConfigFile.ConfigPath);

                reader.Read();
                doc.Load(reader);
                reader.Close();

                Summa.BuildSummaIdMap(doc);
            }
            catch (System.Xml.XmlException xe)
            {
                _errorLevel     = FileLogger.LogErrorLevel.SiteIDMapFailed;
                _errorLevelFile = FileLogger.LogErrorLevelFile.ConfigFile;

                _errorStr       = @"Error loading Summa site id map file (problem with XML format?)";
                _errorStrDetail = @"";

                _singletonLogger.LogException(_errorLevel, _errorLevelFile, _errorStr, xe);
            }
            catch (Exception e)
            {
                _errorLevel     = FileLogger.LogErrorLevel.SiteIDMapFailed;
                _errorLevelFile = FileLogger.LogErrorLevelFile.ConfigFile;

                _errorStr = @"Error loading Summa site id map file";

                _singletonLogger.LogException(_errorLevel, _errorLevelFile, _errorStr, e);
            }
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="data"></param>
        void ProcessSummaBI(XmlDocument inDocument)
        {
            string documentType = inDocument.DocumentElement.Name;

            //CheckCustomerID.Clear();

            switch (documentType)
            {
                #region Version

            case "Version":
                CsvMulti vcsv = new VersionCsv(_outputFilePath);
                vcsv.SetupData(inDocument);
                vcsv.WriteDataToCSV();
                break;

                #endregion

                #region Transaction Files

            case "Transaction":
                CsvMulti tcsv = new TransactionCSV(_outputFilePath);
                tcsv.SetupData(inDocument);
                tcsv.WriteDataToCSV();

                CsvMulti tdcsv = new TransactionDetailCSV(_outputFilePath);
                tdcsv.SetupData(inDocument);
                tdcsv.WriteDataToCSV();

                CsvMulti tpmcsv = new TransactionPaymentMethodsCSV(_outputFilePath);
                tpmcsv.SetupData(inDocument);
                tpmcsv.WriteDataToCSV();
                break;

                #endregion

                #region List Files

            case "ListPaymentTypes":
                CsvMulti lptcsv = new PaymentMethodTypesCSV(_outputFilePath);
                lptcsv.SetupData(inDocument);
                lptcsv.WriteDataToCSV();
                break;

            case "CategoryGroups":
                CsvMulti gcsv = new GroupsCSV(_outputFilePath);
                gcsv.SetupData(inDocument);
                gcsv.WriteDataToCSV();
                break;

            case "ListStaff":
                CsvMulti ocsv = new OperatorsCSV(_outputFilePath);
                ocsv.SetupData(inDocument);
                ocsv.WriteDataToCSV();
                break;

            case "ListCategories":
                CsvMulti ccsv = new DepartmentsCSV(_outputFilePath);
                ccsv.SetupData(inDocument);
                ccsv.WriteDataToCSV();
                break;

            case "ListProductTypes":
                CsvMulti pcsv = new ProductsCSV(_outputFilePath);
                pcsv.SetupData(inDocument);
                pcsv.WriteDataToCSV();
                break;

            case "ListDiscounts":
                CsvMulti dcsv = new FreeListCSV(_outputFilePath);
                dcsv.SetupData(inDocument);
                dcsv.WriteDataToCSV();
                break;

            case "ListCalculated":
                CsvMulti listCalcCsv = new FixedListCSV(_outputFilePath);
                listCalcCsv.SetupData(inDocument);
                listCalcCsv.WriteDataToCSV();
                break;

            case "ListPatronTypes":
                //CsvMulti listPatronTypes = new FixedListPatrons(_outputFilePath);
                //listPatronTypes.SetupData(document);
                //listPatronTypes.WriteDataToCSV();
                break;

                #endregion

                #region Totals Files

            case "TotalsPayments":
                //CsvMulti tpcsv = new PaymentMethodTotalsCSV(_outputFilePath);
                //tpcsv.SetupData(document);
                //tpcsv.WriteDataToCSV();
                break;

            case "TotalsStaff":
                //CsvMulti tscsv = new OperatorTotalsCSV(_outputFilePath);
                //tscsv.SetupData(document);
                //tscsv.WriteDataToCSV();
                break;

            case "TotalsGroups":
                //CsvMulti tgcsv = new GroupTotalsCSV(_outputFilePath);
                //tgcsv.SetupData(document);
                //tgcsv.WriteDataToCSV();
                break;

            case "TotalsProducts":
                //CsvMulti tprdcsv = new ProductTotalsCSV(_outputFilePath);
                //tprdcsv.SetupData(document);
                //tprdcsv.WriteDataToCSV();
                break;

            case "TotalsCategories":
                //CsvMulti tccsv = new DepartmentTotalsCSV(_outputFilePath);
                //tccsv.SetupData(document);
                //tccsv.WriteDataToCSV();
                break;

            case "TotalsDiscounts":
                CsvMulti fltcsv = new FreeListTotalsCSV(_outputFilePath);
                fltcsv.SetupData(inDocument);
                fltcsv.WriteDataToCSV();
                break;

            case "TotalsCalculated":
                //CsvMulti fixedListCsv = new FixedListTotals(_outputFilePath);
                //fixedListCsv.SetupData(document);
                //fixedListCsv.WriteDataToCSV();
                break;

            case "TotalsHourlySales":
                //CsvMulti hourlySalesCsv = new HourlySalesCSV(_outputFilePath);
                //hourlySalesCsv.SetupData(document);
                //hourlySalesCsv.WriteDataToCSV();
                break;

            case "TotalsPatron":
                //CsvMulti patronTotals = new PatronTotals(_outputFilePath);
                //patronTotals.SetupData(document);
                //patronTotals.WriteDataToCSV();
                break;
                #endregion

                #region Membership
            case "UpdateMember":
                CsvMulti membersListCsv = new CustomersCSV(_outputFilePath);
                membersListCsv.SetupData(inDocument);
                membersListCsv.WriteDataToCSV();
                break;

            case "ListMemberGroups":
                CsvMulti groupsListCsv = new SummaGroupsCSV(_outputFilePath);
                groupsListCsv.SetupData(inDocument);
                groupsListCsv.WriteDataToCSV();
                break;
                #endregion

                #region Roster

            case "ListRoster":
                CsvMulti rosterCsv = new RosterCSV(_outputFilePath);
                rosterCsv.SetupData(inDocument);
                rosterCsv.WriteDataToCSV();
                break;

                #endregion

            default:
            {
                _errorLevel     = FileLogger.LogErrorLevel.InternalXMLError;
                _errorLevelFile = FileLogger.LogErrorLevelFile.None;

                _errorStr       = @"Unknown Summa message type: " + documentType;
                _errorStrDetail = @"";

                _singletonLogger.LogError(_errorLevel, _errorLevelFile, _errorStr, _errorStrDetail);
                _singletonLogger.LogWarning(@"Summa failed processing a Menumate XML file.  See the log file for details");

                throw new SummaException(_errorStr);
            }
            }
        }