示例#1
0
        public static void LogHistory(int userId, string userName, PlayerHistoryType type, string desc)
        {
            var sql = "INSERT INTO dbo.AcnClub_LogPlayer VALUES (@userid, @username, @typeCode, @typeDesc, getdate());";

            using (var con = SQLConn.GetConnection())
            {
                var com = new SqlCommand(sql, con);
                com.Parameters.Add(new SqlParameter("@userid", userId));
                com.Parameters.Add(new SqlParameter("@username", userName));
                com.Parameters.Add(new SqlParameter("@typeCode", (int)type));
                com.Parameters.Add(new SqlParameter("@typeDesc", desc));

                con.Open();

                com.ExecuteNonQuery();

                //con.Close();
            }
        }
示例#2
0
        public static void LogHistory(int userId, string userName, PlayerHistoryType type, string desc)
        {
            var sql = "INSERT INTO dbo.AcnClub_LogPlayer VALUES (@userid, @username, @typeCode, @typeDesc, getdate());";

            using (var con = SQLConn.GetConnection())
            {
                var com = new SqlCommand(sql, con);
                com.Parameters.Add(new SqlParameter("@userid", userId));
                com.Parameters.Add(new SqlParameter("@username", userName));
                com.Parameters.Add(new SqlParameter("@typeCode", (int) type));
                com.Parameters.Add(new SqlParameter("@typeDesc", desc));

                con.Open();

                com.ExecuteNonQuery();

                //con.Close();
            }
        }