示例#1
0
        public static void Update(Alignment alignment)
        {
            const string query = "UPDATE alignments SET Type=@Type, Honor=@Honor," +
                                 "Deshonor=@Deshonor, Level=@Level, Grade=@Grade, Enabled=@Enabled " +
                                 "WHERE id=@Id";

            Base.Repository.ExecuteQuery(query, GameDbManager.GetDatabaseConnection(),
                (command) =>
                {
                    command.Parameters.Add(new MySqlParameter("@Id", alignment.Id));
                    command.Parameters.Add(new MySqlParameter("@Type", alignment.Type));
                    command.Parameters.Add(new MySqlParameter("@Honor", alignment.Honor));
                    command.Parameters.Add(new MySqlParameter("@Deshonor", alignment.Deshonor));
                    command.Parameters.Add(new MySqlParameter("@Level", alignment.Level));
                    command.Parameters.Add(new MySqlParameter("@Grade", alignment.Grade));
                    command.Parameters.Add(new MySqlParameter("@Enabled", alignment.Enabled));
                });
        }
示例#2
0
        public static void Create(Alignment alignment)
        {
            const string query = "INSERT INTO alignments SET Id=@Id, Type=@Type, Honor=@Honor," +
                                 "Deshonor=@Deshonor, Level=@Level, Grade=@Grade, Enabled=@Enabled";

            Base.Repository.ExecuteQuery(query, GameDbManager.GetDatabaseConnection(),
                (command) =>
                {
                    command.Parameters.Add(new MySqlParameter("@Id", alignment.Id));
                    command.Parameters.Add(new MySqlParameter("@Type", alignment.Type));
                    command.Parameters.Add(new MySqlParameter("@Honor", alignment.Honor));
                    command.Parameters.Add(new MySqlParameter("@Deshonor", alignment.Deshonor));
                    command.Parameters.Add(new MySqlParameter("@Level", alignment.Level));
                    command.Parameters.Add(new MySqlParameter("@Grade", alignment.Grade));
                    command.Parameters.Add(new MySqlParameter("@Enabled", alignment.Enabled));
                });

            lock (DatabaseProvider.Alignments)
                DatabaseProvider.Alignments.Add(alignment);
        }
示例#3
0
 public static void Remove(Alignment alignment)
 {
 }