AppendLineToFile() public method

public AppendLineToFile ( string filePath, string lineToAppend ) : string
filePath string
lineToAppend string
return string
コード例 #1
0
        public string Serialize()
        {
            string xmlHeader = "<?xml version='1.0' encoding='utf-8'?>\r\n<litleRequest version=\"9.3\"" +
                               " xmlns=\"http://www.litle.com/schema\" " +
                               "numBatchRequests=\"" + numOfLitleBatchRequest + "\">";

            string xmlFooter = "\r\n</litleRequest>";

            string filePath;

            finalFilePath = litleFile.createRandomFile(requestDirectory, Path.GetFileName(finalFilePath), ".xml", litleTime);
            filePath      = finalFilePath;

            litleFile.AppendLineToFile(finalFilePath, xmlHeader);
            litleFile.AppendLineToFile(finalFilePath, authentication.Serialize());

            if (batchFilePath != null)
            {
                litleFile.AppendFileToFile(finalFilePath, batchFilePath);
            }
            else
            {
                throw new LitleOnlineException("No batch was added to the LitleBatch!");
            }

            litleFile.AppendLineToFile(finalFilePath, xmlFooter);

            finalFilePath = null;

            return(filePath);
        }
コード例 #2
0
        public string Serialize()
        {
            string xmlHeader = generateXmlHeader();
            string xmlFooter = generateXmlFooter();

            string filePath;

            finalFilePath = litleFile.createRandomFile(requestDirectory, Path.GetFileName(finalFilePath), ".xml", litleTime);
            filePath      = finalFilePath;

            litleFile.AppendLineToFile(finalFilePath, xmlHeader);
            litleFile.AppendLineToFile(finalFilePath, authentication.Serialize());

            if (batchFilePath != null)
            {
                litleFile.AppendFileToFile(finalFilePath, batchFilePath);
            }
            else
            {
                throw new LitleOnlineException("No batch was added to the LitleBatch!");
            }

            litleFile.AppendLineToFile(finalFilePath, xmlFooter);

            finalFilePath = null;

            return(filePath);
        }
コード例 #3
0
        public string Serialize()
        {
            string xmlHeader = "\r\n<RFRRequest xmlns=\"http://www.litle.com/schema\">";
            string xmlFooter = "\r\n</RFRRequest>";

            string filePath = litleFile.createRandomFile(requestDirectory, null, "_RFRRequest.xml", litleTime);

            string xmlBody = "";

            if (accountUpdateFileRequestData != null)
            {
                xmlBody += "\r\n<accountUpdateFileRequestData>";
                xmlBody += accountUpdateFileRequestData.Serialize();
                xmlBody += "\r\n</accountUpdateFileRequestData>";
            }
            else
            {
                xmlBody += "\r\n<litleSessionId>" + litleSessionId + "</litleSessionId>";
            }
            litleFile.AppendLineToFile(filePath, xmlHeader);
            litleFile.AppendLineToFile(filePath, xmlBody);
            litleFile.AppendLineToFile(filePath, xmlFooter);

            return(filePath);
        }
コード例 #4
0
        public String Serialize()
        {
            string xmlHeader = generateXmlHeader();

            string xmlFooter = "</batchRequest>\r\n";

            batchFilePath = litleFile.createRandomFile(requestDirectory, null, "_batchRequest.xml", litleTime);

            litleFile.AppendLineToFile(batchFilePath, xmlHeader);
            litleFile.AppendFileToFile(batchFilePath, tempBatchFilePath);
            litleFile.AppendLineToFile(batchFilePath, xmlFooter);

            tempBatchFilePath = null;

            return(batchFilePath);
        }
コード例 #5
0
        private string saveElement(litleFile litleFile, litleTime litleTime, string filePath, transactionRequest element)
        {
            string fPath;

            fPath = litleFile.createRandomFile(requestDirectory, Path.GetFileName(filePath), "_temp_batchRequest.xml", litleTime);

            litleFile.AppendLineToFile(fPath, element.Serialize());

            return(fPath);
        }
コード例 #6
0
        private string saveElement(litleFile litleFile, litleTime litleTime, string filePath, transactionRequest element)
        {
            string fPath;
            fPath = litleFile.createRandomFile(requestDirectory, Path.GetFileName(filePath), "_temp_batchRequest.xml", litleTime);

            litleFile.AppendLineToFile(fPath, element.Serialize());

            return fPath;
        }