protected override bool OnParse(string action, StringDictionary arguments)
        {
            string sPayeeName = arguments["-payeename"];
            if (string.IsNullOrEmpty(sPayeeName))
            {
                Io.Error.Write("Parameter -payeename fehlt!");
                return false;
            }

            string sPayeeAcctNo = arguments["-payeeacctno"];
            if (string.IsNullOrEmpty(sPayeeAcctNo))
            {
                Io.Error.Write("Parameter -payeeacctno fehlt!");
                return false;
            }

            string sPayeeBankCode = arguments["-payeebankcode"];
            if (string.IsNullOrEmpty(sPayeeBankCode))
            {
                Io.Error.Write("Parameter -payeebankcode fehlt!");
                return false;
            }

            decimal dAmount = 0M;
            try
            {
                dAmount = SwiftAmt.Parse(arguments["-amount"]);
            }
            catch { /* IGNORE */ }
            if (dAmount == 0M)
            {
                Io.Error.Write("Parameter -amount fehlt oder fehlerhaft!");
                return false;
            }

            string sTextKey = arguments["-textkey"];
            string sTextKeyExt = arguments["-textkeyext"];
            string[] vsPurpose = arguments["-purpose"].Split('|');

            if (sTextKey == null)
            {
                sTextKey = "51";
            }

            m_aRemitt = new FinRemitt
                            {
                                PayeePayerAcct = new FinAcct(sPayeeAcctNo, "280", sPayeeBankCode),
                                PayeePayerName1 = sPayeeName,
                                Amount = new SwiftAmt(dAmount, "EUR"),
                                TextKey = sTextKey,
                                TextKeyExt = sTextKeyExt,
                                PaymtPurpose = vsPurpose
                            };

            return true;
        }
Ejemplo n.º 2
0
        protected override bool OnParse(string action, StringDictionary arguments)
        {
            string sPayeeName = arguments["-payeename"];

            if (string.IsNullOrEmpty(sPayeeName))
            {
                Io.Error.Write("Parameter -payeename fehlt!");
                return(false);
            }

            string sPayeeAcctNo = arguments["-payeeacctno"];

            if (string.IsNullOrEmpty(sPayeeAcctNo))
            {
                Io.Error.Write("Parameter -payeeacctno fehlt!");
                return(false);
            }

            string sPayeeBankCode = arguments["-payeebankcode"];

            if (string.IsNullOrEmpty(sPayeeBankCode))
            {
                Io.Error.Write("Parameter -payeebankcode fehlt!");
                return(false);
            }

            decimal dAmount = 0M;

            try
            {
                dAmount = SwiftAmt.Parse(arguments["-amount"]);
            }
            catch { /* IGNORE */ }
            if (dAmount == 0M)
            {
                Io.Error.Write("Parameter -amount fehlt oder fehlerhaft!");
                return(false);
            }

            string sTextKey    = arguments["-textkey"];
            string sTextKeyExt = arguments["-textkeyext"];

            string[] vsPurpose = arguments["-purpose"].Split('|');

            if (sTextKey == null)
            {
                sTextKey = "51";
            }

            m_aRemitt = new FinRemitt
            {
                PayeePayerAcct  = new FinAcct(sPayeeAcctNo, "280", sPayeeBankCode),
                PayeePayerName1 = sPayeeName,
                Amount          = new SwiftAmt(dAmount, "EUR"),
                TextKey         = sTextKey,
                TextKeyExt      = sTextKeyExt,
                PaymtPurpose    = vsPurpose
            };

            return(true);
        }