public BankAccountStatement GenerateStatement(string AccountNumber, string BankCode, string Password, string StatementType) { BankAccountStatement statement = new BankAccountStatement(); DataTable dt = dh.GetAccountStatement(AccountNumber, BankCode, StatementType); if (dt.Rows.Count > 0) { List <string> allTransactions = new List <string>(); foreach (DataRow dr in dt.Rows) { string BankId = dr["BankTranId"].ToString(); string Amount = dr["TranAmount"].ToString(); string PaymentDate = DateTime.Parse(dr["PaymentDate"].ToString()).ToString("ddMMyyyy"); string TranType = dr["TranType"].ToString(); string line = BankId + "," + Amount + "," + TranType + "," + PaymentDate; allTransactions.Add(line); } statement.statement = allTransactions; statement.StatusCode = "0"; statement.StatusDesc = "SUCCESS"; } else { statement.StatusCode = "100"; statement.StatusDesc = "NO TRANSACTIONS FOUND DONE AGAINIST " + AccountNumber; } return(statement); }
private string DoGetMiniStatementOperation(string[] DE) { string response = ""; try { string AccountNumber = DE[103]; string BankCode = GetBankCode(DE[2]); string Password = DE[47]; BankAccountStatement state = client.GetMiniStatement(AccountNumber, BankCode, Password); if (state.StatusCode == "0") { response = ReturnMiniStatementSuccessResponse(state, AccountNumber); } else { response = ReturnMiniStatementFailureResponse(state, AccountNumber); } } catch (Exception ex) { response = GetErrorResponse(DE, ex.Message); } return(response); }
private string GetStatementString(BankAccountStatement state) { string line = ""; foreach (string statement in state.statement) { line += statement.Replace(',', ' ').Replace("12:00:00 AM", string.Empty) + "|"; } return(line); }
public BankAccountStatement GetMiniStatement(string AccountNumber, string BankCode, string Password) { BankAccountStatement statement = new BankAccountStatement(); try { statement = bll.GenerateStatement(AccountNumber, BankCode, Password, "MINI"); } catch (Exception ex) { statement.StatusCode = "100"; statement.StatusDesc = "FAILED: " + ex.Message; } return(statement); }
private string ReturnMiniStatementSuccessResponse(BankAccountStatement state, string AccountNumber) { string response = ""; string MTI = "0510"; //2.Create an object BIM-ISO8583.ISO8583 BIM_ISO8583.NET.ISO8583 Buildiso8583 = new BIM_ISO8583.NET.ISO8583(); //3. Create Arrays string[] ResponseDE = new string[130]; //4. Assign corresponding data to each array // Ex: ISO8583 Data Element No.2 (PAN) shall assign to newly created array, DE[2]; ResponseDE[39] = "00";//success response code ResponseDE[47] = state.StatusDesc; ResponseDE[48] = ""; ResponseDE[125] = GetStatementString(state); //5.Use "Build" method of object iso8583 to create a new message. response = Buildiso8583.Build(ResponseDE, MTI); return(response); }
public BankAccountStatement GenerateStatement(string AccountNumber, string BankCode, string Password, string StatementType) { BankAccountStatement statement = new BankAccountStatement(); DataTable dt = dh.GetAccountStatement(AccountNumber, BankCode, StatementType); if (dt.Rows.Count > 0) { List <string> allTransactions = new List <string>(); string Header = "BankId,Amount,PayDate,ToAccount,FromAccount,TransactionType"; allTransactions.Add(Header); foreach (DataRow dr in dt.Rows) { string BankId = dr["VendorTranId"].ToString(); string Amount = dr["TranAmount"].ToString(); string PaymentDate = dr["PaymentDate"].ToString(); string toAccount = dr["toAccount"].ToString(); string fromAccount = dr["fromAccount"].ToString(); string TranType = dr["TranType"].ToString(); string line = BankId + "," + Amount + "," + PaymentDate + "," + toAccount + "," + fromAccount + "," + TranType; allTransactions.Add(line); } statement.statement = allTransactions; statement.StatusCode = "0"; statement.StatusDesc = "SUCCESS"; } else { statement.StatusCode = "100"; statement.StatusDesc = "NO TRANSACTIONS FOUND DONE AGAINIST " + AccountNumber; } return(statement); }