public static bool Visit(string sysname, string modname, string loginuser, string memo) { if (string.IsNullOrEmpty(sysname)) { return(false); } var sql = SQL_VISIT_LOG; var para = new MySqlParameter[] { new MySqlParameter("@sysname", sysname), new MySqlParameter("@modname", modname), new MySqlParameter("@loginuser", loginuser), new MySqlParameter("@memo", memo), }; int nRet = -1; try { nRet = MySqlClientHelper.ExecuteNonQuery(CustomConfig.ConnStrMain, System.Data.CommandType.Text, sql, para); } catch (Exception ex) { //TODO } return(nRet > 0); }
private static void WriteDBLog(MySqlConnection conn, string msg) { var sql = string.Format(@"insert into task_log (msg,happentime) values('{0}', CURRENT_TIMESTAMP)" , msg); MySqlClientHelper.ExecuteNonQuery(conn, CommandType.Text, sql); }