public SieradzBankTransfer ExampleTwo() { BankTransfer transfer = new SieradzBankTransfer(); transfer = FillTransfer(transfer); transfer = FillSieradzTransfer(transfer); return transfer as SieradzBankTransfer; }
protected override BankTransfer GetTransferEntry(string entry) { BankTransfer bankTransfer = new SieradzBankTransfer(); ((SieradzBankTransfer) bankTransfer).TransferInfo = JsonParser.Parse(((SieradzBankTransfer) bankTransfer).TransferInfo, entry); SetBankNames(bankTransfer); return bankTransfer; }
protected override BankTransfer GetTransferEntry(string entry) { BankTransfer bankTransfer = new SieradzBankTransfer(); ((SieradzBankTransfer)bankTransfer).TransferInfo = JsonParser.Parse(((SieradzBankTransfer)bankTransfer).TransferInfo, entry); SetBankNames(bankTransfer); return(bankTransfer); }
public SieradzBankTransfer ExampleTwo() { BankTransfer transfer = new SieradzBankTransfer(); transfer = FillTransfer(transfer); transfer = FillSieradzTransfer(transfer); return(transfer as SieradzBankTransfer); }
protected override BankTransfer GetTransferEntry(string entry) { SieradzBankTransfer bt = new SieradzBankTransfer(); //SieradzBankTransfersUtils bankDictionary; var ArgList = entry.Split('$'); var bankDictionary = SieradzBankTransfersUtils.Instance; bt.SourceBank = bankDictionary.GetBankName(ArgList[0].Substring(2, 4)); bt.DestinationBank = bankDictionary.GetBankName(ArgList[1].Substring(2, 4)); bt.TransferInfo.SourceAccountNumber = ArgList[0]; bt.TransferInfo.DestinationAccountNumber = ArgList[1]; bt.TransferInfo.Amount = ArgList[2]; bt.TransferInfo.SourcePersonName = ArgList[3]; bt.TransferInfo.DestinationPersonName = ArgList[4]; bt.TransferInfo.TransferTitle = ArgList[5]; bt.TransferInfo.TransferDate = DateTime.Now.ToString(@"MM\/dd\/yyyy h\:mm tt"); return(bt); }
protected override BankTransfer GetTransferEntry(string entry) { SieradzBankTransfer bt = new SieradzBankTransfer(); //SieradzBankTransfersUtils bankDictionary; var ArgList = entry.Split('$'); var bankDictionary = SieradzBankTransfersUtils.Instance; bt.SourceBank = bankDictionary.GetBankName(ArgList[0].Substring(2, 4)); bt.DestinationBank = bankDictionary.GetBankName(ArgList[1].Substring(2, 4)); bt.TransferInfo.SourceAccountNumber = ArgList[0]; bt.TransferInfo.DestinationAccountNumber = ArgList[1]; bt.TransferInfo.Amount = ArgList[2]; bt.TransferInfo.SourcePersonName = ArgList[3]; bt.TransferInfo.DestinationPersonName = ArgList[4]; bt.TransferInfo.TransferTitle = ArgList[5]; bt.TransferInfo.TransferDate = DateTime.Now.ToString(@"MM\/dd\/yyyy h\:mm tt"); return bt; }
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); }
protected override BankTransfer GetTransferEntry(string entry) { BankTransfer transfer = new SieradzBankTransfer(); try { using (var reader = new StringReader(entry)) { var serializer = new XmlSerializer(typeof(SieradzTransferInfo)); var transferInfo = (SieradzTransferInfo)serializer.Deserialize(reader); transfer.SourceBank = SieradzBankTransfersUtils.Instance.GetBankName(transferInfo.SourceAccountNumber.Substring(2,4)); transfer.DestinationBank = SieradzBankTransfersUtils.Instance.GetBankName(transferInfo.DestinationAccountNumber.Substring(2, 4)); } } catch (Exception) { transfer = null; } return transfer; }
protected override BankTransfer GetTransferEntry(string entry) { SieradzBankTransfer mBankTransfer = new SieradzBankTransfer(); #pragma warning disable 618 XmlDocument xmlNode = new XmlDataDocument(); #pragma warning restore 618 string datePattern = "d.m.yyyy"; DateTime currentDate = DateTime.Now; var bankDictionary = SieradzBankTransfersUtils.Instance; xmlNode.LoadXml(entry); //TODO it's possible to reduce that sphagetti? // IT FCKIN IS! @UCTT mBankTransfer.TransferInfo.Amount = xmlNode.GetElementsByTagName("Amount").Item(0).InnerText; mBankTransfer.TransferInfo.DestinationAccountNumber = xmlNode.GetElementsByTagName("DestinationAccountNumber").Item(0).InnerText; mBankTransfer.TransferInfo.DestinationPersonName = xmlNode.GetElementsByTagName("DestinationPersonName").Item(0).InnerText; mBankTransfer.TransferInfo.SourceAccountNumber = xmlNode.GetElementsByTagName("SourceAccountNumber").Item(0).InnerText; mBankTransfer.TransferInfo.TransferDate = currentDate.ToString(datePattern); mBankTransfer.TransferInfo.TransferTitle = xmlNode.GetElementsByTagName("TransferTitle").Item(0).InnerText; mBankTransfer.SourceBank = bankDictionary.GetBankName(mBankTransfer.TransferInfo.SourceAccountNumber.Substring(2, 4)); mBankTransfer.DestinationBank = bankDictionary.GetBankName(mBankTransfer.TransferInfo.DestinationAccountNumber.Substring(2, 4)); return mBankTransfer; }
protected override BankTransfer GetTransferEntry(string entry) { SieradzBankTransfer mBankTransfer = new SieradzBankTransfer(); #pragma warning disable 618 XmlDocument xmlNode = new XmlDataDocument(); #pragma warning restore 618 string datePattern = "d.m.yyyy"; DateTime currentDate = DateTime.Now; var bankDictionary = SieradzBankTransfersUtils.Instance; xmlNode.LoadXml(entry); //TODO it's possible to reduce that sphagetti? // IT FCKIN IS! @UCTT mBankTransfer.TransferInfo.Amount = xmlNode.GetElementsByTagName("Amount").Item(0).InnerText; mBankTransfer.TransferInfo.DestinationAccountNumber = xmlNode.GetElementsByTagName("DestinationAccountNumber").Item(0).InnerText; mBankTransfer.TransferInfo.DestinationPersonName = xmlNode.GetElementsByTagName("DestinationPersonName").Item(0).InnerText; mBankTransfer.TransferInfo.SourceAccountNumber = xmlNode.GetElementsByTagName("SourceAccountNumber").Item(0).InnerText; mBankTransfer.TransferInfo.TransferDate = currentDate.ToString(datePattern); mBankTransfer.TransferInfo.TransferTitle = xmlNode.GetElementsByTagName("TransferTitle").Item(0).InnerText; mBankTransfer.SourceBank = bankDictionary.GetBankName(mBankTransfer.TransferInfo.SourceAccountNumber.Substring(2, 4)); mBankTransfer.DestinationBank = bankDictionary.GetBankName(mBankTransfer.TransferInfo.DestinationAccountNumber.Substring(2, 4)); return(mBankTransfer); }
protected override BankTransfer GetTransferEntry(string entry) { BankTransfer transfer = new SieradzBankTransfer(); try { using (var reader = new StringReader(entry)) { var serializer = new XmlSerializer(typeof(SieradzTransferInfo)); var transferInfo = (SieradzTransferInfo)serializer.Deserialize(reader); transfer.SourceBank = SieradzBankTransfersUtils.Instance.GetBankName(transferInfo.SourceAccountNumber.Substring(2, 4)); transfer.DestinationBank = SieradzBankTransfersUtils.Instance.GetBankName(transferInfo.DestinationAccountNumber.Substring(2, 4)); } } catch (Exception) { transfer = null; } return(transfer); }