public int InsertRow(OracleConnection connection, UPRow item, string ordernumber, string filename, out string msg) { int ret = 0; msg = null; DateTime dt; try { string query = "INSERT INTO RCD.VALID_BELWEBDATA (RRN, Amount, FeeAmount, CardNumber, TransDate, Postingdate, SetLmDate, OperType, PayDocNumber, FileName, Tags) " + "values (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11)"; OracleCommand command = new OracleCommand(query, connection); command.Parameters.Add(crp(OracleType.Char, item.rrn, "1", false)); command.Parameters.Add(crp(OracleType.Number, Math.Round(item.transAmount, 2), "2", false)); command.Parameters.Add(crp(OracleType.Number, Math.Round(item.feeAmount, 2), "3", false)); command.Parameters.Add(crp(OracleType.Char, item.targetNumber, "4", false)); DateTime.TryParse(item.transDate.Replace('T', ' '), out dt); command.Parameters.Add(crp(OracleType.DateTime, dt, "5", false)); DateTime.TryParse(item.postingDate, out dt); command.Parameters.Add(crp(OracleType.DateTime, dt, "6", false)); DateTime.TryParse(item.settlmDate, out dt); command.Parameters.Add(crp(OracleType.DateTime, dt, "7", false)); int opercode = get_opercode(item.requestCategory); command.Parameters.Add(crp(OracleType.Int32, opercode, "8", false)); command.Parameters.Add(crp(OracleType.Char, ordernumber, "9", false)); command.Parameters.Add(crp(OracleType.Char, filename, "10", false)); command.Parameters.Add(crp(OracleType.Char, get_tags(item), "11", false)); command.ExecuteNonQuery(); } catch (Exception ex) { msg = ex.Message; return(-1); } return(ret); }
private string get_tags(UPRow item) { string ret = null; try { if (!string.IsNullOrEmpty(item.transDetails)) { ret += string.Format("<TDT={0}>", item.transDetails); } } catch (Exception ex) { MessageBox.Show(ex.Message); } return(ret); }