示例#1
0
 public PaperCardverCheckfirst(DsnConnection odbc)
     : base(odbc, Names.schedule_prefix, TableName, true, false)
 {
     Columns.Add("session_number", typeof(int));
     Columns.Add("game_number", typeof(int));
     /// this is equivalent to cardset_range_id
     Columns.Add("cardset_range_id", typeof(int));
     //Create();
     //Fill();
 }
示例#2
0
 public ReceiptPrinterCommands(DsnConnection odbc)
     : base(odbc, "", TableName, true, false, false, false)
 {
     Columns.Add("printer_type_id", typeof(int));
     Columns.Add("command_name", typeof(string));
     Columns.Add("command", typeof(string));
     Create();
     Fill();
     LoadInitValues();
 }
示例#3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            dsn = new DsnConnection("MySQL");
            dsn.AllowFallback = true;
            dsn.DesiredMode   = DsnConnection.ConnectionMode.MySqlNative;

            t          = new Timer();
            t.Interval = 250;
            t.Tick    += new EventHandler(t_Tick);
            t.Start();
        }
示例#4
0
        public Guid AddPlayer()
        {
            Guid    guid;
            DataRow player_row = this.player.NewRow();

            player_row[player.player_idColumn]           = guid = DsnConnection.GetGUID(game_event_dsn);
            player_row[player.session_tracking_idColumn] = stream_state_cache.Rows[0][stream_state_cache.session_tracking_idColumn];
            player.Rows.Add(player_row);
            last_event = DateTime.Now;
            return(guid);
        }
示例#5
0
文件: Form1.cs 项目: d3x0r/xperdex
        private void button1_Click(object sender, EventArgs e)
        {
            DsnConnection source  = new DsnConnection(textBox1.Text);
            DsnConnection dest    = new DsnConnection(textBox2.Text);
            BingoTracking dataset = new BingoTracking();

            DsnSQLUtil.CreateDataTable(dest, dataset);
            DsnSQLUtil.FillDataSet(source, dataset);
            DsnSQLUtil.AppendToDatabase(dest, dataset);
            //DsnSQLUtil.
        }
示例#6
0
 void CheckEvent(DataTable table, String event_name)
 {
     DataRow[] rows = table.Select("event_name='" + event_name + "'");
     if (rows.Length == 0)
     {
         DataRow newrow = table.NewRow();
         newrow[table.Columns[0]] = DsnConnection.GetGUID(game_event_dsn);
         newrow["event_name"]     = event_name;
         table.Rows.Add(newrow);
     }
 }
示例#7
0
 public SessionGameRelation(DsnConnection odbc, DataSet dataset)
     : base(odbc
            , dataset
            , Names.schedule_prefix
            , "session_game"
            , dataset.Tables[SessionTable.TableName]
            , dataset.Tables[GameTable.TableName]
            , false
            )
 {
 }
示例#8
0
        static Local()
        {
            dsn = new DsnConnection(StaticDsnConnection.dsn.DataSource);

            schedule = new ScheduleDataSet(dsn);
            schedule.Create();
            schedule.Fill();

            //schedule.GetSession( DateTime.Now, 1 );

            inited = true;
        }
示例#9
0
        internal DataRow NewTarget(DataRow dataRow, string target)
        {
            DataRow newrow = Target.NewRow();

            newrow["target_id"]  = DsnConnection.GetGUID(null);
            newrow["project_id"] = dataRow["project_id"];
            newrow["name"]       = target;
            Target.Rows.Add(newrow);

            Target.AcceptChanges();
            return(newrow);
        }
示例#10
0
        internal DataRow NewProject(DataRow parent, string project)
        {
            DataRow newrow = Projects.NewRow();

            newrow[Projects.project_idColumn]       = DsnConnection.GetGUID(null);
            newrow[Projects.project_group_idColumn] = parent["project_group_id"];
            newrow[Projects.nameColumn]             = project;
            newrow[Projects.project_group_idColumn] = parent[ProjectGroup.project_group_idColumn];
            Projects.Rows.Add(newrow);
            Projects.AcceptChanges();
            return(newrow);
        }
示例#11
0
        public Guid AddPackSetToGame(Guid pack_set)
        {
            DataRow game_pack = game_packs.NewRow();
            Guid    guid;

            game_pack[game_packs.game_pack_set_idColumn] = guid = DsnConnection.GetGUID(game_event_dsn);
            game_pack[game_packs.game_tracking_idColumn] = stream_state_cache.Rows[0][stream_state_cache.game_tracking_idColumn];
            game_pack[game_packs.pack_set_idColumn]      = pack_set;
            game_packs.Rows.Add(game_pack);
            last_event = DateTime.Now;
            return(guid);
        }
示例#12
0
        internal DataRow NewProjectGroup(string project, string default_project)
        {
            DataRow newrow = ProjectGroup.NewRow();

            newrow[ProjectGroup.project_group_idColumn] = DsnConnection.GetGUID(null);
            newrow[ProjectGroup.nameColumn]             = project;
            ProjectGroup.Rows.Add(newrow);
            NewProject(newrow, default_project);
            AcceptChanges();
            LoadCMakeLists(project);
            return(newrow);
        }
示例#13
0
        public Guid AddPack(Guid pack_set_id, Guid trans_id)
        {
            DataRow pack_row = this.pack.NewRow();
            Guid    guid;

            pack_row[pack.pack_idColumn]        = guid = DsnConnection.GetGUID(game_event_dsn);
            pack_row[pack.pack_set_idColumn]    = pack_set_id;
            pack_row[pack.transaction_idColumn] = trans_id;
            pack.Rows.Add(pack_row);
            last_event = DateTime.Now;
            return(guid);
        }
示例#14
0
 public PriceEditor2()
 {
     schedule           = ControlList.schedule;
     price_data         = schedule.session_price_data;
     current_price_data = schedule.Tables[CurrentPriceData.TableName] as CurrentPriceData;
     data = ControlList.data;
     data.SetSessionPriceExceptionSetCurrent += new ScheduleCurrents.OnSetCurrent(UpdatedCurrent);
     data.SetSessionCurrent += new ScheduleCurrents.OnSetCurrent(data_SetSessionCurrent);
     dsn = ControlList.schedule.schedule_dsn;
     InitializeComponent();
     Disposed += new EventHandler(PriceEditor2_Disposed);
 }
示例#15
0
 public GameEventBallsProcessedDataTable(DataSet dataSet, DsnConnection database)
 {
     connection = database;
     AddColumns();
     //Create();
     dataSet.Tables.Add(this);
     dataSet.Relations.Add(new DataRelation("game_is_processed"
                                            , dataSet.Tables[GameEventDataTable.TableName]
                                            .Columns[GameEventDataTable.PrimaryKey]
                                            , dataSet.Tables[TableName]
                                            .Columns[GameEventDataTable.PrimaryKey]
                                            ));
 }
示例#16
0
 public DataRow GetPattern(String name)
 {
     DataRow[] pattern = Select(NameColumn + "='" + DsnConnection.Escape(DsnConnection.ConnectionMode.NativeDataTable, DsnConnection.ConnectionFlavor.Unknown, name) + "'");
     if (pattern.Length > 0)
     {
         if (pattern.Length > 1)
         {
             throw new Exception("Multiple patterns with same name");
         }
         return(pattern[0]);
     }
     return(null);
 }
示例#17
0
        //public void AddPack(

        public void AddWinner(Guid card_guid, int win_mask, Decimal prize)
        {
            DataRow winner_row = winner_info.NewRow();

            winner_row[winner_info.card_idColumn]             = card_guid;
            winner_row[winner_info.game_tracking_idColumn]    = stream_state_cache.Rows[0][stream_state_cache.game_tracking_idColumn];
            winner_row[winner_info.session_tracking_idColumn] = stream_state_cache.Rows[0][stream_state_cache.session_tracking_idColumn];
            winner_row[winner_info.winning_maskColumn]        = win_mask;
            winner_row[winner_info.winner_idColumn]           = DsnConnection.GetGUID(game_event_dsn);
            winner_row[winner_info.amountColumn] = prize;
            winner_info.Rows.Add(winner_row);
            last_event = DateTime.Now;
        }
示例#18
0
        public SessionPrizeOrder(DsnConnection odbc, DataSet dataSet)
            : base(odbc
                   , dataSet
                   , dataSet.Tables[SessionTable.TableName]
#if direct_translate
                   , new MySQLRelationMap(new object[] {
            MySQLRelationMap.MapOp.SaveRelationPoint
            , MySQLRelationMap.MapOp.FollowToChild
            , "session_has_game_group"
            , MySQLRelationMap.MapOp.InvokNameChangeEvent
            , MySQLRelationMap.MapOp.FollowToParent
            , "game_group_in_session"
            , MySQLRelationMap.MapOp.InvokNameChangeEvent
            , MySQLRelationMap.MapOp.FollowToChild
            , "game_group_has_prize_level"
            , MySQLRelationMap.MapOp.InvokNameChangeEvent
            , MySQLRelationMap.MapOp.FollowToParent
            , "prize_level_in_game_group"
            , MySQLRelationMap.MapOp.InvokNameChangeEvent
        }).ToString()
#endif
                   , new MySQLRelationMap(new object[] {
            dataSet.Tables[SessionTable.TableName]
            , MySQLRelationMap.MapOp.InvokNameChangeEvent
            , MySQLRelationMap.MapOp.FollowToChild
            , "session_has_game"
            , MySQLRelationMap.MapOp.FollowToChild
            , "session_game_has_session_pack_group"
            , MySQLRelationMap.MapOp.FollowToParent
            , "session_pack_group_in_session_game"
            , MySQLRelationMap.MapOp.FollowToParent
            , "pack_group_in_session"
            , MySQLRelationMap.MapOp.FollowToParent
            , "pack_group_has_pack"
            , MySQLRelationMap.MapOp.FollowToParent
            , "pack_in_pack_group"
            , MySQLRelationMap.MapOp.FollowToChild
            , "pack_has_prize_level"
            , MySQLRelationMap.MapOp.FollowToParent
            , "prize_level_in_pack"
            , MySQLRelationMap.MapOp.InvokNameChangeEvent
        }).ToString()
                   //, "./session_has_game_group$\\game_group_in_session$/game_group_has_prize_level$\\prize_level_in_game_group$"
                   , false
                   , false
                   , new DataColumn[] { new DataColumn(NameColumn, typeof(String))
                                        , new DataColumn(SessionPrizeOrder.NumberColumn, typeof(int)) }
                   )
        {
            Init();
        }
示例#19
0
 public SessionPackOrder(DsnConnection odbc, DataSet dataSet)
     : base(odbc
            , dataSet
            , dataSet.Tables[SessionTable.TableName]
            , session_game_packs_map.ToString()
            //, "./session_has_game_group$\\game_group_in_session$/game_group_has_pack$\\pack_in_game_group$"
            , false  // add number column (table name is bad, so we define our own)
            , false  // auto fill
            , new DataColumn[] { new DataColumn(NameColumn, typeof(string))
                                 , new DataColumn(SessionPackOrder.NumberColumn, typeof(int)) }
            )
 {
     this.unique = true;
     Init();
 }
示例#20
0
        static Local()
        {
            input_db = StaticDsnConnection.dsn;
#if this_was_moved___
            points           = new MySQLDataTable(new DsnConnection(Local.output_dsn));
            points.TableName = "rate_rank_points2";
            DataColumn dc = points.Columns.Add("rate_rank_point_id", typeof(int));
            points.PrimaryKey    = new DataColumn[] { dc };
            dc.AutoIncrement     = true;
            dc.AutoIncrementSeed = 1;
            points.Columns.Add("away_count", typeof(int));
            points.Columns.Add("points", typeof(int));
            points.Create();
            points.Fill();
#endif
        }
示例#21
0
        public static void Fill(DsnConnection dsn, SessionMacroSchedule table, DateTime bingoday)
        {
            table.Clear();
            DateTime date;
            Object   obj = dsn.ExecuteScalar("select max(" + DayColumn + ") from " + table.FullTableName + " where " + DayColumn + "<='" + bingoday.ToString("yyyy-MM-dd") + "'");

            if (obj != DBNull.Value)
            {
                date = Convert.ToDateTime(obj);
            }
            else
            {
                date = bingoday;
            }
            //DsnSQLUtil.FillDataTable( dsn, table, "select * from " + table.FullTableName + " where " + DayColumn + "='" + DsnSQLUtil.MakeDate( dsn, date ) + "'" );
            DsnSQLUtil.FillDataTable(dsn, table, DayColumn + "='" + DsnSQLUtil.MakeDate(dsn, date) + "'");
        }
示例#22
0
 public GameEventDataSet(DsnConnection database)
 {
     games      = new GameEventDataTable(this, database);
     game_balls = new GameEventBallsDataTable(this, database);
     if (!use_alt_game_processed)
     {
         games_processed     = new GameEventBallsProcessedDataTable(this, database);
         alt_games_processed = null;
         GamesProcessed      = games_processed;
     }
     else
     {
         games_processed     = null;
         alt_games_processed = new GameEventBallsProcessedAltDataTable(this, database);
         GamesProcessed      = alt_games_processed;
     }
 }
示例#23
0
        public ItemInstance(DataSet dataSet, DsnConnection dsn)
            : base(dsn)
        {
            AddColumns();
            dataSet.Tables.Add(this);
            DataTable descip = dataSet.Tables[ItemDescription.TableName];

            if (descip != null)
            {
                if (dataSet.Tables.Contains(ItemDescription.TableName))
                {
                    dataSet.Relations.Add(
                        new DataRelation("item_is_item_description"
                                         , descip.Columns[XDataTable.ID(descip)]
                                         , this.Columns[XDataTable.ID(descip)]));
                }
            }
        }
示例#24
0
        public PlayerTrack(DsnConnection odbc)
            : base(odbc, "", TableName, false, false, false, false)
        {
            Columns.Add("transnum", typeof(long));
            Columns.Add("void_trans", typeof(long));
            Columns.Add("card", typeof(string));
            Columns.Add("value", typeof(int));
            Columns.Add("points", typeof(int));
            Columns.Add("session", typeof(int));
            Columns.Add("cashier", typeof(string));
            DataColumn dc = new DataColumn("bingoday", typeof(DateTime));

            dc.Namespace = "date";
            Columns.Add(dc);
            Columns.Add("dummy_timestamp", typeof(DateTime));
            Columns.Add("transaction_whenstamp", typeof(DateTime));
            Create();
        }
示例#25
0
            public GameEventBallsDataTable(DataSet dataSet, DsnConnection database)
            {
                connection = database;
                AddColumns();
                //Create();
                dataSet.Tables.Add(this);
                DataRelation dr;

                dataSet.Relations.Add(dr = new DataRelation("game_has_ball"
                                                            , dataSet.Tables[GameEventDataTable.TableName]
                                                            .Columns[GameEventDataTable.PrimaryKey]
                                                            , dataSet.Tables[TableName]
                                                            .Columns[GameEventDataTable.PrimaryKey]
                                                            ));
                //ForeignKeyConstraint fkc = this.Constraints["game_has_ball"] as ForeignKeyConstraint;
                //if( fkc != null )
                //	fkc.DeleteRule = Rule.SetNull;
                //dr.chil
            }
示例#26
0
        public RankPlayerPayout(DsnConnection odbc)
            : base(odbc, "", TableName, true, false, false)
        {
            Columns.Add("position", typeof(int));
            DataColumn dc = new DataColumn("date_prize", typeof(DateTime));

            dc.Namespace = "date";
            Columns.Add(dc);
            Columns.Add("card", typeof(string));
            Columns.Add("total_points", typeof(int));
            Columns.Add("cash_prize", typeof(xperdex.classes.Money));
            Columns.Add("point_prize", typeof(int));
            Columns.Add("paid", typeof(int));
            Columns.Add("void", typeof(int));
            Columns.Add("removed", typeof(int));
            Columns.Add("created_on", typeof(DateTime));
            Columns.Add("paid_on", typeof(DateTime));
            Columns.Add("void_on", typeof(DateTime));
            Columns.Add("removed_on", typeof(DateTime));
            Create();
            Fill();
        }
示例#27
0
        public DataRow GetPackGroup(String name)
        {
            String name_column = XDataTable.Name(this);

            if (name_column != null)
            {
                String safe_name = DsnConnection.Escape(DsnConnection.ConnectionMode.NativeDataTable, DsnConnection.ConnectionFlavor.Unknown, name);
                if (Columns[name_column].Unique)
                {
                    DataRow[] rows = Select(name_column + "='" + safe_name + "'");
                    if (rows.Length > 1)
                    {
                        throw new ConstraintException("unique name column has already been violated, while attempting to add [" + name + "]");
                    }
                    if (rows.Length == 1)
                    {
                        return(rows[0]);
                    }
                }
            }
            return(null);
        }
示例#28
0
            static CreateTables()
            {
                dsn_me     = new DsnConnection("odds.db");
                dsn_public = new DsnConnection("mysql-vertest");

                play_db           = new MySQLDataTable();
                play_db.TableName = "Odds_GamePlay";
                play_db.AddDefaultColumns(true);
                play_db.Columns.Add("Odds_GamePlay_id", typeof(int));
                play_db.Columns.Add("player_id", typeof(int));
                play_db.Columns.Add("start_card", typeof(int));
                play_db.Columns.Add("card_count", typeof(int));
                play_db.Columns.Add("card_base", typeof(int));
                //play_db.Create();


                //Schedule.GetMacroSchedule

                game_db = new MySQLDataTable("Odds_Games");
                game_db.AddDefaultColumns(true);
                game_db.Columns.Add("Balls", typeof(String));
                game_db.Columns.Add("session", typeof(int));
                game_db.Columns.Add("game", typeof(int));
                game_db.Columns.Add("bingoday", typeof(DateTime));
                game_db.Columns.Add("pattern_id_1", typeof(int));
                game_db.Columns.Add("pattern_id_2", typeof(int));
                game_db.Columns.Add("pattern_id_3", typeof(int));
                game_db.Columns.Add("pattern_id_4", typeof(int));
                game_db.Columns.Add("pattern_id_5", typeof(int));
                //game_db.Create();

                ds = new DataSet();
                ds.Tables.Add(play_db);
                ds.Tables.Add(game_db);
                ds.Relations.Add(new DataRelation("game_play"
                                                  , game_db.Columns[0]
                                                  , play_db.Columns[XDataTable.Name(game_db)])
                                 );
            }
示例#29
0
        public SessionGameOrder(DsnConnection odbc, DataSet dataset)
            : base(odbc, dataset
                   , new DataColumn[] { new DataColumn("ball_timer", typeof(int))
                                        , new DataColumn("overlap_prior", typeof(bool))
                                        , new DataColumn("progressive", typeof(bool))
                                        , new DataColumn("bonanza", typeof(bool))
                                        , new DataColumn("wild", typeof(bool))
                                        , new DataColumn("double_wild", typeof(bool))
                                        , new DataColumn("blind", typeof(bool))
                                        , new DataColumn("single_hotball", typeof(bool))
                                        , new DataColumn(ColorInfoTable.PrimaryKey, XDataTable.DefaultAutoKeyType) }
                   )
        {
            if (dataset != null)
            {
                DataTable child;

                /*
                 * dataset.Relations.Add( SessionGameGroupGameOrder.color_name = MySQLDataTable.StripPlural( MySQLDataTable.StripInfo( SessionGameGroupGameOrder.TableName ) )
                 + "_is_"
                 + MySQLDataTable.StripPlural( MySQLDataTable.StripInfo( ColorInfoTable.TableName ) )
                 + , dataset.Tables[ColorInfoTable.TableName].Columns[ColorInfoTable.PrimaryKey]
                 + , ( child = dataset.Tables[SessionGameGroupGameOrder.TableName] ).Columns[ColorInfoTable.PrimaryKey]
                 + );
                 + ForeignKeyConstraint fkc = child.Constraints[color_name] as ForeignKeyConstraint;
                 + if( fkc != null )
                 + fkc.DeleteRule = Rule.SetNull;
                 */
            }

            //number_column = NumberColumn;
            AddingRow += new OnNewRow(initrow);
            FixupRow  += new OnFixupRow(SessionGameGroupGameOrder_FixupRow);

            //Create();
            //base.Fill(null, NumberColumn+",overlap_prior");

            ColumnChanged += new DataColumnChangeEventHandler(SessionGameGroupGameOrder_ColumnChanged);
        }
示例#30
0
        void ButtonCreateItem_Click(object sender, ReflectorButtonEventArgs e)
        {
            String newname = QueryNewName.Show("Enter new inventory type");

            if (newname != null && newname != "")
            {
                DataRow[] existing = ItemManagmentState.inventory_types.Select("inv_type='"
                                                                               + DsnConnection.Escape(DsnConnection.ConnectionMode.NativeDataTable, DsnConnection.ConnectionFlavor.Unknown, newname)
                                                                               + "'");
                if (existing.Length < 1)
                {
                    DataRow row = ItemManagmentState.inventory_types.NewRow();
                    row["inv_type"] = newname;
                    ItemManagmentState.inventory_types.Rows.Add(row);
                    ItemManagmentState.current_inventory_type = row;
                }
                else
                {
                    MessageBox.Show("Inventory type already exists.");
                }
            }
        }