public static void OpenNewSession() { if (!opened_for_issue && !opened_for_play && !opened_for_sales) { int tmpval; if (!Int32.TryParse(_current_open_session[PriceExceptionSet.PrimaryKey].ToString(), out tmpval) || tmpval == 0) { Banner.Show("Session not opened correctly,\nprice exception set not picked", false); return; } if (!Int32.TryParse(_current_open_session[PrizeExceptionSet.PrimaryKey].ToString(), out tmpval) || tmpval == 0) { Banner.Show("Session not opened correctly,\nprize exception set not picked", false); return; } Banner.Show("Creating schedule snapshot...\nFor" + (DateTime)_current_open_session["bingoday"] + " session " + (int)_current_open_session["session_order"] + ") " + _current_open_session["session_name"], true); Application.DoEvents(); DataRow row = _current_open_session; DataRow session_pc_row; DataRow[] pc_rows = schedule.price_exception_sets.Select(PriceExceptionSet.PrimaryKey + "='" + _current_open_session[PriceExceptionSet.PrimaryKey] + "'"); DataRow[] pz_rows = schedule.prize_exception_sets.Select(PrizeExceptionSet.PrimaryKey + "='" + _current_open_session[PrizeExceptionSet.PrimaryKey] + "'"); DataRow pc_row = pc_rows[0]; DataRow session_pz_row; DataRow pz_row = pz_rows[0]; DataRow[] current_sessions = schedule.sessions.Select(SessionTable.PrimaryKey + "='" + _current_open_session[SessionTable.PrimaryKey] + "'"); DataRow current_session = current_sessions[0]; DataRow snapshot_current_session; ScheduleDataSet schedule_instance = new ScheduleDataSet(StaticDsnConnection.dsn , schedule , (DateTime)_current_open_session["bingoday"] , Convert.ToInt32(row["session_order"]) , current_session , pc_row , pz_row , out snapshot_current_session ); //schedule_instance.Drop(); //schedule_instance.Create(); row["snapshot_session_id"] = snapshot_current_session[SessionTable.PrimaryKey]; schedule_instance.Dispose(); DsnSQLUtil.CommitChanges(StaticDsnConnection.dsn, session_state); session_state.AcceptChanges(); Banner.End(); } }
public XperdexDefaultForm(string[] args) { bool want_title = false; bool want_page = false; String FirstPage = null; Banner.Show("Initializing...", true); //TopMost = true; InitializeComponent(); canvas = new Canvas(); canvas.Dock = DockStyle.Fill; Process me = Process.GetCurrentProcess(); this.WindowState = FormWindowState.Maximized; foreach (string arg in args) { if (want_page) { want_page = false; FirstPage = arg; continue; } else if (want_title) { want_title = false; Text = arg; continue; } else if (arg.CompareTo("normal") == 0) { this.FormBorderStyle = FormBorderStyle.Sizable; this.WindowState = System.Windows.Forms.FormWindowState.Normal; continue; } else if (arg.CompareTo("noicon") == 0) { ShowInTaskbar = false; continue; } else if (arg.CompareTo("topmost") == 0) { this.TopMost = true; continue; } else if (arg.CompareTo("page") == 0) { want_page = true; continue; } else if (arg.CompareTo("title") == 0) { want_title = true; continue; } core_common.ConfigName = arg; } this.LocationChanged += new EventHandler(Form1_LocationChanged); this.Visible = false; this.Controls.Add(canvas); // the top level form should load a configuration // there are NO pages yet... Banner.Show("Loading...", true); canvas.LoadConfig(); if (FirstPage != null) { canvas.current_page = canvas.FindPage(FirstPage); } //Banner.Show( "Loaded...", true ); this.Visible = true; Banner.End(); }