protected override bool Send(BankTransfer transfer)
 {
     var subject = "Transfer to " + BankName;
     var body = CreateMessageForTransfer(transfer);
     transfer.IsTransferSuccessful = true; //DjEmailSender.SendEmail(subject, body);
     return transfer.IsTransferSuccessful;
 }
 protected override BankTransfer GetTransferEntry(string entry)
 {
     BankTransfer bankTransfer = new BankTransfer();
     bankTransfer.SourceBank = entry.Split(';')[0];
     bankTransfer.DestinationBank = entry.Split(';')[1];
     return bankTransfer;
 }
Exemple #3
0
 /* public FTPcs(string serverpath, string login, string pass)
  {
      _login = login;
      _pass = pass;
      _server = serverpath; //ftp::jakisserwer.pl/folder/
  }*/
 public static bool Send(BankTransfer transfer)
 {
     string bankname = transfer.DestinationBank;
     var sender = new SendFile();
     var desinationfilepath = _server + bankname + ".txt"; //ftp::jakisserwer.pl/folder/plik.txt
     var file = bankname + ".txt";
     return sender.Send(file, desinationfilepath, _login, _pass);
 }
 protected override bool Send(BankTransfer transfer)
 {
     var tr = (SeRaBankTransfer) transfer;
     using(TextWriter writer = new StreamWriter(@"F:\KURS C#\REPO\Hornets\training\Toci.Hornets.GhostRider\Toci.Hornets.Rzeszow\SemiRafista\KIR\demo\SeRaRaport2.txt",true))
     {
         const string linePattern = "WYkonano przelew od: {0} do: {1} w dniu {2} na kwote {3}\n";
         writer.WriteLine(linePattern, tr.SourceClientName,tr.DestinationClientName,tr.TransferDate,tr.TransferAmount);
     }
     return true;
 }
 protected override BankTransfer GetTransferEntry(string entry)
 {
     //stringa na bank transfer
     //parser '\t' adfds dsa dsa /jakassciezka/asdsad/
     BankTransfer transfer = new BankTransfer();
     var tab = entry.Split('\t');
     transfer.SourceBank = tab[0];
     transfer.DestinationBank = tab[1];
     transfer.IsTransferSuccessful = true;
     return transfer;
 }
 protected override bool Send(BankTransfer transfer)
 {
     string path = @"..\..\..\Toci.Hornets.Rzeszow\Agata\Kir\BankTransferFiles\YaghaTransfersResult.txt";
     if (!File.Exists(path))
     {
         File.Create(path);
     }
     var message = new StringBuilder("Przelerw nr " + ((YaghaBankTransfer)transfer).TransferNumber + " zostal wykonany");
     TextWriter executeTransfer = new StreamWriter(path);
     executeTransfer.WriteLine(message);
     executeTransfer.Close();
     return true;
 }
        protected override bool Send(BankTransfer transfer)
        {
            string transferFilename = SaveFilePath+transfer.SourceBank+"_TO_"+BankName+".txt";

            File.WriteAllText(transferFilename,transfer.ToString());
            transfer.IsTransferSuccessful = true;

            //pomysl
            //zaleznie od nazwy banku wywoluje rozne funkcje(inaczej zapisuje transfer)
            //rozne opcje zapisane w slowniku i wywolywane przez delegaty, w ktorych wywolane konkretne metody

            //zapis transferu do pliku w folderze z transferami
            return true;
        }
        protected override bool Send(BankTransfer transfer)
        {
            //zapisuje w UnitTestach bin\Debug przy testowaniu
            const string path = "..\\..\\..\\Toci.Hornets.Rzeszow\\Terry\\TrainingThree\\TerryBank\\transfers\\TerryBankAllTransfers.txt";
            var tr = (TerryBankTransfer) transfer;

            if (!transfer.IsTransferSuccessful) return false;

            using (var writer = new StreamWriter(@path, true))
            {
                writer.WriteLine("{0}.{1}.{2}.{3}.{4}.{5}.{6}.{7}.{8}/", tr.Amount, tr.DestinationBank, tr.DestinationAccountInfo.AccNr,
                    tr.DestinationAccountInfo.OwnersName, tr.SourceBank, tr.SourceAccountInfo.AccNr, tr.SourceAccountInfo.OwnersName, tr.Title, tr.IsTransferSuccessful);

            }
            return true;
        }
        protected bool GenerateTransferPDF(BankTransfer transfer)
        {
            lock (this)
            {
                PdfDocument transferDetails = new PdfDocument();
                //transferDetails.
                Font pdfFont = new Font("Arial", 18f);
                PdfTrueTypeFont trueTypeFont = new PdfTrueTypeFont(pdfFont, true);

                PdfPageBase TransferPage = transferDetails.Pages.Add();
                PdfBitmap logo = new PdfBitmap(SieradzBankFilesPathHolder.TransferFilesPath + @"..\mBank\logo.jpg");
                TransferPage.Canvas.DrawImage(logo, new RectangleF(new PointF(25.0f, 25.0f), new SizeF(140f, 85f)));
                TransferPage.Canvas.DrawString("\tPotwierdzenie przelewu:", new PdfFont(PdfFontFamily.Helvetica, 20f), new PdfSolidBrush(new PdfRGBColor(0, 0, 0)), 10, 150f);
                TransferPage.Canvas.DrawString(TransferDetailsString(transfer), trueTypeFont, new PdfSolidBrush(new PdfRGBColor(0, 0, 0)), 50, 180f);
                SavePDF(transferDetails);
            }

            return true;
        }
        protected override bool Send(BankTransfer transfer)
        {
            var outTransfer = (SieradzBankTransfer) transfer;
            string performedTransfers =

                "Numer konta nadawcy przelewu: " +outTransfer.TransferInfo.SourceAccountNumber +
                " \n Nazwisko nadawcy: " + outTransfer.TransferInfo.SourcePersonName +
                " \n Numer konta odbiorcy przelewu: " + outTransfer.TransferInfo.DestinationAccountNumber +
                " \n Nazwisko odbiorcy: " + outTransfer.TransferInfo.DestinationPersonName +
                " \n Tytułem: " + outTransfer.TransferInfo.TransferTitle +
                " \n Kwota: " + outTransfer.TransferInfo.Amount +
                " \n Data wykonania: " + outTransfer.TransferInfo.TransferDate;

            System.IO.StreamWriter file = new System.IO.StreamWriter(SieradzBankFilesPathHolder.TransferFilesPath + @"..\BPH\QuicksilverPerformed.txt",true);
            file.WriteLine(performedTransfers);

            file.Close();
            transfer.IsTransferSuccessful = true;
            return transfer.IsTransferSuccessful;
        }
 protected string TransferDetailsString(BankTransfer transfer)
 {
     SieradzBankTransfer extendedTransfer = (SieradzBankTransfer)transfer;
     string[] transferArray = {   "Nr konta nadawcy: "+extendedTransfer.TransferInfo.SourceAccountNumber+"\n",
                                      "Bank nadawcy: "+extendedTransfer.SourceBank+"\n",
                                      "Adres nadawcy: "+extendedTransfer.TransferInfo.SourcePersonName+"\n",
                                      "Nr konta odbiorcy: "+extendedTransfer.TransferInfo.DestinationAccountNumber+"\n",
                                      "Bank odbiorcy: " + extendedTransfer.DestinationBank+"\n",
                                      "Adres odbiorcy: "+ extendedTransfer.TransferInfo.DestinationPersonName+"\n",
                                      "Kwota przelewu: "+extendedTransfer.TransferInfo.Amount+"zł\n",
                                      "Tytuł przelewu: "+extendedTransfer.TransferInfo.TransferTitle+"\n",
                                      "Data przyjęcia: "+extendedTransfer.TransferInfo.TransferDate+"\n"
                                  };
     string transferDetail = null;
     foreach (var label in transferArray)
     {
         transferDetail += label;
     }
     return transferDetail;
 }
        //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;
        }
        //private string path =
        protected override bool Send(BankTransfer transfer)
        {
            // FindFile();
            StreamWriter sw;
            SzaryBankTransfer tr =(SzaryBankTransfer) 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;
            }*/
            //Sa ERRORY! DO POPRAWKI
            return true;
        }
        protected override bool Send(BankTransfer transfer)
        {
            transfer.IsTransferSuccessful = true;

            return transfer.IsTransferSuccessful;
        }
 public bool SeRaSendTransfers(BankTransfer transfer)
 {
     return Send(transfer);
 }
 protected override bool Send(BankTransfer transfer)
 {
     Debug.WriteLine("Euros transfered: {0}",transfer.IsTransferSuccessful);
     return transfer.IsTransferSuccessful;
 }
Exemple #17
0
        public void DoTransfer(BankTransfer transfer)
        {
            bool result = Handle.SendTransfer(transfer);

            Logger.Log(transfer, result);
        }
 public BankTransfer FillSieradzTransfer(BankTransfer transfer)
 {
     (transfer as SieradzBankTransfer).TransferInfo.Amount = "mnóstwo";
     return transfer;
 }
 public BankTransfer FillTransfer(BankTransfer transfer)
 {
     transfer.DestinationBank = "destination";
     transfer.SourceBank = "source";
     return transfer;
 }
 protected virtual string GetFormattedResult(BankTransfer transfer)
 {
     return string.Format("{0} => {1} : {2} ", transfer.SourceBank, transfer.DestinationBank,
         transfer.IsTransferSuccessful ? "Powodzenie" : "Błąd");
 }
 public bool TerrySendTransfers(BankTransfer transfer)
 {
     return Send(transfer);
 }
 protected override bool Send(BankTransfer transfer)
 {
     throw new System.NotImplementedException();
 }
 protected override bool Send(BankTransfer transfer)
 {
     GenerateTransferPDF(transfer); //suck too much to put it there
     transfer.IsTransferSuccessful = true;
     return transfer.IsTransferSuccessful;
 }
 protected virtual void TryToSendTransfer(BankTransfer transfer)
 {
     var handler = SieradzTransferHandlesDictionary.GetTransferHandleByBankName(transfer.DestinationBank);
     if (handler != null) handler.SendTransfer(transfer);
     ResultList.Add(GetFormattedResult(transfer));
 }
 protected virtual void SetBankNames(BankTransfer bankTransfer)
 {
     bankTransfer.SourceBank = BankName;
     bankTransfer.DestinationBank = GetDestinationBankName(((SieradzBankTransfer) bankTransfer).TransferInfo);
 }
Exemple #26
0
 protected override bool Send(BankTransfer transfer)
 {
     return true;
 }
Exemple #27
0
        public static void OverWriteFile(BankTransfer transfer, string newline)
        {
            Get("asd");

            Send(transfer);
        }
 private static string CreateMessageForTransfer(BankTransfer transfer)
 {
     return "Transfer pieniędzy z banku " + transfer.SourceBank + " do naszego banku, " + transfer.DestinationBank + ".\n";
 }
 protected override bool Send(BankTransfer transfer)
 {
     AlmostLikeADatebase.SaveBankTransfer((LegnicaBankTransfer)transfer);
     return true;
 }
 protected override bool Send(BankTransfer transfer)
 {
     return IsMyDestination(transfer);
 }