public static int Insert(TTRD_AIDSYS_MSG_LOG table) { //Database db = DatabaseFactory.CreateDatabase("ConnectionString.xeq_trd"); Database db = DBFactory.TRD; StringBuilder strSql = new StringBuilder(); strSql.AppendFormat("INSERT INTO {0}", "TTRD_AIDSYS_MSG_LOG"); strSql.Append(@"(M_ID, U_ID, I_ID, M_PLATTYPE, M_SUBID, M_ISSINGLE, M_SERIALNO, M_ERROR, M_SENDDATE, M_STATE, M_S_CONTENT, M_R_CONTENT)"); strSql.AppendFormat(@" VALUES({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11})", db.BuildParameterName("M_ID"), db.BuildParameterName("U_ID"), db.BuildParameterName("I_ID"), db.BuildParameterName("M_PLATTYPE"), db.BuildParameterName("M_SUBID"), db.BuildParameterName("M_ISSINGLE"), db.BuildParameterName("M_SERIALNO"), db.BuildParameterName("M_ERROR"), db.BuildParameterName("M_SENDDATE"), db.BuildParameterName("M_STATE"), db.BuildParameterName("M_S_CONTENT"), db.BuildParameterName("M_R_CONTENT")); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "M_ID", DbType.String, table.M_ID); db.AddInParameter(dbCommand, "U_ID", DbType.String, table.U_ID); db.AddInParameter(dbCommand, "I_ID", DbType.String, table.I_ID); db.AddInParameter(dbCommand, "M_PLATTYPE", DbType.Int32, table.M_PLATTYPE); db.AddInParameter(dbCommand, "M_SUBID", DbType.Int32, table.M_SUBID); db.AddInParameter(dbCommand, "M_ISSINGLE", DbType.String, table.M_ISSINGLE); db.AddInParameter(dbCommand, "M_SERIALNO", DbType.String, table.M_SERIALNO); db.AddInParameter(dbCommand, "M_ERROR", DbType.String, table.M_ERROR); db.AddInParameter(dbCommand, "M_SENDDATE", DbType.String, table.M_SENDDATE); db.AddInParameter(dbCommand, "M_STATE", DbType.String, table.M_STATE); db.AddInParameter(dbCommand, "M_S_CONTENT", DbType.Binary, table.M_S_CONTENT); db.AddInParameter(dbCommand, "M_R_CONTENT", DbType.Binary, table.M_R_CONTENT); return db.ExecuteNonQuery(dbCommand); }
public static int Update(TTRD_AIDSYS_MSG_LOG log) { Database db = DBFactory.TRD; StringBuilder strSql = new StringBuilder(); strSql.AppendFormat("UPDATE {0} SET ", "TTRD_AIDSYS_MSG_LOG"); strSql.AppendFormat("M_STATE={0},", db.BuildParameterName("M_STATE")); strSql.Append(" WHERE "); strSql.AppendFormat(" M_ID={0}", db.BuildParameterName("M_ID")); DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(dbCommand, "M_STATE", DbType.Int32, log.M_STATE); db.AddInParameter(dbCommand, "M_ID", DbType.String, log.M_ID); return db.ExecuteNonQuery(dbCommand); }
private void RecordDB(String result, MessageData msg) { if (msg != null) { TTRD_AIDSYS_MSG_LOG logrow = new TTRD_AIDSYS_MSG_LOG(); logrow.M_ID = msg.MessageID.ToString(); logrow.M_ERROR = result; logrow.M_STATE = "1"; logrow.M_S_CONTENT = msg.CurrentReqPackage.PackageMessage; logrow.M_SUBID = msg.CurrentReqPackage.PackageID; logrow.M_SERIALNO = msg.BizMsgID; logrow.M_ISSINGLE = msg.IsMultiPackage ? "0" : "1"; logrow.M_PLATTYPE = (int)msg.TragetPlatform; logrow.M_SENDDATE = msg.FirstTime.ToString("yyyy-MM-dd HH:mm:ss"); TTRD_AIDSYS_MSG_LOG_Manager manager = new TTRD_AIDSYS_MSG_LOG_Manager(); manager.LogInsert(logrow); } }
private void UpdateLogDB( MessageData msg) { TTRD_AIDSYS_MSG_LOG logrow = new TTRD_AIDSYS_MSG_LOG(); logrow.M_ID = msg.MessageID.ToString(); logrow.M_STATE = "0"; TTRD_AIDSYS_MSG_LOG_Manager manager = new TTRD_AIDSYS_MSG_LOG_Manager(); manager.LogUpdate(logrow); return; }
public int LogUpdate(TTRD_AIDSYS_MSG_LOG log) { return TTRD_AIDSYS_MSG_LOG_Controller.Update(log); }
public int LogInsert(TTRD_AIDSYS_MSG_LOG log) { return TTRD_AIDSYS_MSG_LOG_Controller.Insert(log); }
private void DBActionTest(MessageData msgdata) { String ouno = textBoxOrgNO.Text.TrimStart(); String tellno = textBoxTellerNO.Text.TrimStart(); String internalID = textBoxInternalID.Text.TrimStart(); TTRD_AIDSYS_MSG_LOG row = new TTRD_AIDSYS_MSG_LOG(); row.M_ID = msgdata.MessageID.ToString(); row.M_S_CONTENT = msgdata.CurrentReqPackage.PackageMessage; row.M_ISSINGLE = msgdata.IsMultiPackage ? "0" : "1"; row.M_ERROR = "Test DB msg"; row.M_SENDDATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); row.M_STATE = "1"; row.M_SUBID = 1; row.I_ID = ouno; row.U_ID = tellno; row.M_PLATTYPE = (int)msgdata.TragetPlatform; TTRD_AIDSYS_MSG_LOG_Manager manager = new TTRD_AIDSYS_MSG_LOG_Manager(); manager.LogInsert(row); }