/// <summary> /// Loads a Country to a given country code. /// </summary> /// <param name="country_code">The given country code.</param> /// <returns>The loaded country.</returns> public Country LoadCountry(ECountry country_code) { // Load searched format from file IEnumerable <XElement> format = LoadData(_fileNameIbanFormat, "country", new KeyValuePair <string, string>("countryCode", country_code.ToString())); // convert data in class object var result = (from ibanFormat in format select new Country { AccountNumberLength = ibanFormat.Element(XmlNamespace + "ktoIdentLength").Value, BankIdentLength = ibanFormat.Element(XmlNamespace + "bankIdentLength").Value, CountryCode = country_code.ToString(), Name = ibanFormat.Element(XmlNamespace + "name").Value, RegExp = ibanFormat.Element(XmlNamespace + "regexp").Value, CountryType = country_code }); return(result.First()); }
public override ActionResult Execute(ISpecialExecutionTaskTestAction testAction) { String bankIdent = testAction.GetParameterAsInputValue("bankIdent", false).Value; if (string.IsNullOrEmpty(bankIdent)) { throw new ArgumentException(string.Format("Es muss eine Bank identifikation angegeben sein.")); } String accountNumber = testAction.GetParameterAsInputValue("accountNumber", false).Value; if (string.IsNullOrEmpty(accountNumber)) { throw new ArgumentException(string.Format("Es muss eine Kontonummer angegeben sein.")); } String buffer = testAction.GetParameterAsInputValue("buffer", false).Value; if (string.IsNullOrEmpty(buffer)) { throw new ArgumentException(string.Format("Es muss ein Puffer angegeben werden in welche die IBAN gespeichert werden soll.")); } // onyl support DE so far ECountry countryCode = ECountry.DE; // DE46 | 5054 0028 | 0420 0861 00 _manager = ContainerBootstrapper.Resolve <IIbanManager>(countryCode.ToString()); iban = _manager.GenerateIban(countryCode, bankIdent, accountNumber); Buffers.Instance.SetBuffer(buffer, iban.IBAN.IBAN, false); testAction.SetResult(SpecialExecutionTaskResultState.Ok, "IBAN generated and saved to buffer."); throw new NotImplementedException(); }
/// <summary> /// Loads a Country to a given country code. /// </summary> /// <param name="country_code">The given country code.</param> /// <returns>The loaded country.</returns> public Country LoadCountry(ECountry country_code) { // Load searched format from file IEnumerable<XElement> format = LoadData(_fileNameIbanFormat, "country", new KeyValuePair<string, string>("countryCode", country_code.ToString())); // convert data in class object var result = (from ibanFormat in format select new Country { AccountNumberLength = ibanFormat.Element(XmlNamespace + "ktoIdentLength").Value, BankIdentLength = ibanFormat.Element(XmlNamespace + "bankIdentLength").Value, CountryCode = country_code.ToString(), Name = ibanFormat.Element(XmlNamespace + "name").Value, RegExp = ibanFormat.Element(XmlNamespace + "regexp").Value, CountryType = country_code }); return result.First(); }
/// <summary> /// Asynchronous method to generate an iban code. /// </summary> /// <param name="countryCode">Country for which the code should be generated.</param> /// <param name="bankIdent">Band ident for which the code should be generated.</param> /// <param name="accountNumber">Account number for which the code should be generated.</param> /// <returns>The generated iban code and bic code.</returns> public async Task <IbanBic> GenerateIbanAsync(ECountry countryCode, string bankIdent, string accountNumber) { _manager = ContainerBootstrapper.Resolve <IIbanManager>(countryCode.ToString()); return(await _manager.GenerateIbanAsync(countryCode, bankIdent, accountNumber)); }
/// <summary> /// Synchronous method to generate an iban code. /// </summary> /// <param name="countryCode">Country for which the code should be generated.</param> /// <param name="bankIdent">Band ident for which the code should be generated.</param> /// <param name="accountNumber">Account number for which the code should be generated.</param> /// <returns>The generated iban code and bic code.</returns> public IbanBic GenerateIban(ECountry countryCode, string bankIdent, string accountNumber) { _manager = ContainerBootstrapper.Resolve <IIbanManager>(countryCode.ToString()); return(_manager.GenerateIban(countryCode, bankIdent, accountNumber)); }
/// <summary> /// Asynchronous method to generate an iban code. /// </summary> /// <param name="countryCode">Country for which the code should be generated.</param> /// <param name="bankIdent">Band ident for which the code should be generated.</param> /// <param name="accountNumber">Account number for which the code should be generated.</param> /// <returns>The generated iban code and bic code.</returns> public async Task<IbanBic> GenerateIbanAsync(ECountry countryCode, string bankIdent, string accountNumber) { _manager = ContainerBootstrapper.Resolve<IIbanManager>(countryCode.ToString()); return await _manager.GenerateIbanAsync(countryCode, bankIdent, accountNumber); }
/// <summary> /// Synchronous method to generate an iban code. /// </summary> /// <param name="countryCode">Country for which the code should be generated.</param> /// <param name="bankIdent">Band ident for which the code should be generated.</param> /// <param name="accountNumber">Account number for which the code should be generated.</param> /// <returns>The generated iban code and bic code.</returns> public IbanBic GenerateIban(ECountry countryCode, string bankIdent, string accountNumber) { _manager = ContainerBootstrapper.Resolve<IIbanManager>(countryCode.ToString()); return _manager.GenerateIban(countryCode, bankIdent, accountNumber); }