Exemplo n.º 1
0
            static void CreateGroup(string name, bool guest, string parent, byte r, byte g, byte b, string[] nodes, MySQLConnector conn)
            {
                long id;

                using (var bl = new MySQLQueryBuilder(SqlPermissions.SQLSafeName))
                {
                    bl.InsertInto(TableName,
                                  new DataParameter(ColumnNames.Name, name),
                                  new DataParameter(ColumnNames.ApplyToGuests, guest),
                                  new DataParameter(ColumnNames.Parent, parent),
                                  new DataParameter(ColumnNames.Chat_Red, r),
                                  new DataParameter(ColumnNames.Chat_Green, g),
                                  new DataParameter(ColumnNames.Chat_Blue, b)
                                  );

                    id = ((IDataConnector)conn).ExecuteInsert(bl);
                }

                foreach (var nd in nodes)
                {
                    var nodeId = PermissionTable.Insert(conn, nd, false);
                    GroupPermissions.Insert(conn, id, nodeId);
                }
            }