Exemplo n.º 1
0
        public override List <BankTransfer> GetBankTransfers()
        {
            BankFileOperation = new FileOperationFoonesh();
            var lines = BankFileOperation.GetFileContent(UserPath.find() + "\\SuperBank.txt").Split(new[] { "\n" }, StringSplitOptions.None);

            return(lines.Select(GetTransferEntry).ToList());
        }
Exemplo n.º 2
0
        //private string path =

        protected override bool Send(BankTransfer transfer)
        {
            // FindFile();
            StreamWriter       sw;
            KsebalBankTransfer tr = (KsebalBankTransfer)transfer;


            if (File.Exists(UserPath.find() + "\\raport.txt"))
            {
                using (sw = File.AppendText(UserPath.find() + "\\raport.txt"))
                {
                    sw.WriteLine(tr.SenderTransferSurname + " to " + tr.ConsumerTransferSurname);
                    sw.Close();
                    tr.IsTransferSuccessful = true;
                }
            }

            else
            {
                sw = new StreamWriter(UserPath.find() + "\\raport.txt");
                sw.WriteLine(tr.SenderTransferSurname + " to " + tr.ConsumerTransferSurname);
                sw.Close();
                tr.IsTransferSuccessful = true;
            }
            return(true);
        }