public SessionSchedule(SessionInfo session) { prize_names = new PrizeLevelNames(); this.TableName = "Prize Grid"; this.Columns.Add("Game", typeof(string)); // cols passed in is the current prize type names.... prizes = session.Prizes(); games = session.Games(); foreach (DataRow col in prizes) { DataRow row = prize_names[Convert.ToInt64(col["prize_level_id"])]; this.Columns.Add(new DataColumn((string)row["prize_level_name"], typeof(Money))); } // games is session_games in session foreach (DataRow game in games) { DataRow dr = this.NewRow(); dr[0] = (string)game["game_name"]; //dr[1] = (Money)"1234"; this.Rows.Add(dr); } //this.Rows. this.AcceptChanges(); //this. //this.Rows[0] = "default"; //this.Columns. //this.Columns.Add("Game 1", typeof(Money)); }
private void Form1_Load(object sender, EventArgs e) { FormClosing += new FormClosingEventHandler(ScheduleDesigner_FormClosing); tabControl1.TabPages.Remove(tabPage16); // Items //tabControl1.TabPages.Remove( tabPage15 ); // session -pack/prize ordering tabControl1.TabPages.Remove(tabPageTreeEditor); // tree editor expiramental //tabControl1.TabPages.Remove( tabPageSessionBundles ); //tabControl1.TabPages.Remove( tabPage6 ); //tabControl1.TabPages.Remove( tabpage if (schedule.PacksRelateToPrizes) { tabControl1.TabPages.Remove(tabPageGameGroupPacks); } if (schedule.GamesInSessions) { tabControl1.TabPages.Remove(tabPageGameGroupsGames); tabControl1.TabPages.Remove(tabPageSessionGameGroupGameOrder); // tabPage11.Hide(); } else { tabControl1.TabPages.Remove(tabPageGameGameGroups); tabControl1.TabPages.Remove(tabPageSessionGame); //tabControl1.TabPages.Remove( tabPage1 ); } //------------------------------------ BindingSourceSessionGameGroupGame = new BindingSource(); if (schedule.GamesInSessions) { BindingSourceSessionGameGroupGame.DataSource = schedule.session_games; } else { BindingSourceSessionGameGroupGame.DataSource = schedule.session_game_group_game_order; } textBoxGameNumber.DataBindings.Add(new Binding("Text", BindingSourceSessionGameGroupGame, "game_number", true)); textBoxBallTimer.DataBindings.Add(new Binding("Text", BindingSourceSessionGameGroupGame, "ball_timer", true)); checkBoxProgressive.DataBindings.Add(new Binding("Checked", BindingSourceSessionGameGroupGame, "progressive", true)); //checkBoxPoker.DataBindings.Add( new Binding( "Checked", BindingSourceSessionGameGroupGame, "poker", true ) ); checkBoxHotball.DataBindings.Add(new Binding("Checked", BindingSourceSessionGameGroupGame, "single_hotball", true)); checkBoxBonanza.DataBindings.Add(new Binding("Checked", BindingSourceSessionGameGroupGame, "bonanza", true)); checkBoxOverlapped.DataBindings.Add(new Binding("Checked", BindingSourceSessionGameGroupGame, "overlap_prior", true)); //checkBoxGameDoubleAction.DataBindings.Add( new Binding( "Checked", BindingSourceSessionGameGroupGame, "double_action", true ) ); checkBoxSingleWild.DataBindings.Add(new Binding("Checked", BindingSourceSessionGameGroupGame, "wild", true)); checkBoxDoubleWild.DataBindings.Add(new Binding("Checked", BindingSourceSessionGameGroupGame, "double_wild", true)); checkBoxBlind.DataBindings.Add(new Binding("Checked", BindingSourceSessionGameGroupGame, "blind", true)); //------------------------------------ BindingSourceSessionGame = new BindingSource(); BindingSourceSessionGame.DataSource = schedule.session_games; textBoxGameNumber2.DataBindings.Add(new Binding("Text", BindingSourceSessionGame, "game_number", true)); textBoxBallTimer2.DataBindings.Add(new Binding("Text", BindingSourceSessionGame, "ball_timer", true)); checkBoxProgressive2.DataBindings.Add(new Binding("Checked", BindingSourceSessionGame, "progressive", true)); checkBoxHotball2.DataBindings.Add(new Binding("Checked", BindingSourceSessionGame, "single_hotball", true)); checkBoxBonanza2.DataBindings.Add(new Binding("Checked", BindingSourceSessionGame, "bonanza", true)); checkBoxSingleWild2.DataBindings.Add(new Binding("Checked", BindingSourceSessionGame, "wild", true)); checkBoxDoubleWild2.DataBindings.Add(new Binding("Checked", BindingSourceSessionGame, "double_wild", true)); checkBoxBlind2.DataBindings.Add(new Binding("Checked", BindingSourceSessionGame, "blind", true)); comboBoxGameColor2.DataBindings.Add(new Binding("SelectedValue", BindingSourceSessionGame , schedule.colors.PrimaryKeyName, true)); //comboBoxGameColor2 //------------------------------------ BindingSourcePrizeLevels = new BindingSource(); BindingSourcePrizeLevels.DataSource = schedule.prize_level_names; checkBoxLastBallWin.DataBindings.Add(new Binding("Checked", BindingSourcePrizeLevels, "lastball_wins", true)); checkBoxBallCountWin.DataBindings.Add(new Binding("Checked", BindingSourcePrizeLevels, "ballcount_wins", true)); checkBoxValueAdded.DataBindings.Add(new Binding("Checked", BindingSourcePrizeLevels, "value_added", true)); //------------------------------------ //schedule.packs.Bind( textBox1, "Text", "onsize" ); BindingSourcePack = new BindingSource(); BindingSourcePack.DataSource = schedule.packs; textBoxPackMultiplier.DataBindings.Add(new Binding("Text", BindingSourcePack, "multiplier", true)); textBox1.DataBindings.Add(new Binding("Text", BindingSourcePack, "onsize", true)); textBoxWidth.DataBindings.Add(new Binding("Text", BindingSourcePack, "width", true)); textBoxHeight.DataBindings.Add(new Binding("Text", BindingSourcePack, "height", true)); checkBoxJumpingJackpot.DataBindings.Add(new Binding("Checked", BindingSourcePack, "jumping_jackpot", true)); checkBoxBonusLine.DataBindings.Add(new Binding("Checked", BindingSourcePack, "_3_number", true)); checkBoxPackDoubleAction.DataBindings.Add(new Binding("Checked", BindingSourcePack, "double_action", true)); checkBoxOddNumberBonus.DataBindings.Add(new Binding("Checked", BindingSourcePack, "odd_count_bonus", true)); checkBoxEvenNumberBonus.DataBindings.Add(new Binding("Checked", BindingSourcePack, "even_count_bonus", true)); comboBoxPackColor.DataBindings.Add(new Binding("SelectedValue", BindingSourcePack , schedule.colors.PrimaryKeyName, true)); //comboBoxPackPrizeLevel.DataBindings.Add( new Binding( "SelectedValue", BindingSourcePack // , schedule.prize_level_names.PrimaryKeyName, true ) ); listBoxPackRanges.DataSource = schedule_currents.current_pack_cardset_ranges; listBoxPackRanges.DisplayMember = schedule_currents.current_pack_cardset_ranges.NameColumn; comboBoxCardset.DataSource = schedule.cardset_info; comboBoxCardset.DisplayMember = CardsetInfo.NameColumn; if (schedule.UseGuid) { XDataTable.DefaultAutoKeyType = typeof(Guid); } current_colors = new ColorInfoTable(); if (schedule.UseGuid) { XDataTable.DefaultAutoKeyType = typeof(int); } current_colors.Columns[ColorInfoTable.PrimaryKey].AllowDBNull = true; //------------------------------------ foreach (DataRow color in schedule.colors.Rows) { DataRow newrow = current_colors.NewRow(); newrow[ColorInfoTable.NameColumn] = color[ColorInfoTable.NameColumn]; newrow[ColorInfoTable.PrimaryKey] = color[ColorInfoTable.PrimaryKey]; current_colors.Rows.Add(newrow); } if (schedule.UseGuid) { XDataTable.DefaultAutoKeyType = typeof(Guid); } DataRow no_color = current_colors.NewRow(); //if( schedule.UseGuid ) // XDataTable.DefaultAutoKeyType = typeof( int ); comboBoxPackColor.DataSource = current_colors; comboBoxPackColor.DisplayMember = ColorInfoTable.NameColumn; comboBoxPackColor.ValueMember = schedule.colors.PrimaryKeyName; DataTable levels = new PrizeLevelNames(); levels.Columns[PrizeLevelNames.PrimaryKey].AllowDBNull = true; foreach (DataRow prize in schedule.prize_level_names.Rows) { DataRow newrow = levels.NewRow(); newrow[PrizeLevelNames.NameColumn] = prize[PrizeLevelNames.NameColumn]; newrow[PrizeLevelNames.PrimaryKey] = prize[PrizeLevelNames.PrimaryKey]; levels.Rows.Add(newrow); } comboBoxPackPrizeLevel.DataSource = schedule.prize_level_names; comboBoxPackPrizeLevel.DisplayMember = PrizeLevelNames.NameColumn; comboBoxPackPrizeLevel.ValueMember = schedule.prize_level_names.PrimaryKeyName; comboBoxCardsetRange.DataSource = schedule_currents.current_cardset_ranges; comboBoxCardsetRange.DisplayMember = OpenSkieScheduler.BingoGameDefs.CurrentCardsetRanges.DisplayName; if (schedule.PacksRelateToPrizes) { // remove the page for game_group:packs tabControl1.TabPages.Remove(tabPageGameGroupPacks); } else { // remove the page for game_group-prize:packs tabControl1.TabPages.Remove(tabPage17); } listBoxCurrentPackPrizeLevels.DataSource = schedule_currents.current_pack_prize_level; listBoxCurrentPackPrizeLevels.DisplayMember = schedule_currents.current_pack_prize_level.NameColumn; listBoxCurrentPackPrizeLevels.ValueMember = schedule_currents.current_pack_prize_level.PrimaryKeyName; }