//constructor public frmNumberNightsPrompt(frmSeatingChart existingChart) { InitializeComponent(); //assign local from constructor this.existingChart = existingChart; }
//constructor public frmSeatInfo(frmSeatingChart MainChart, string SeatNum) { InitializeComponent(); //assign vars from constructor this.MainChart = MainChart; this.SeatNum = SeatNum; this.Night = MainChart.currentNight.night; }
private void btnOpen_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { //make sure we're actually reading from a file if (openFileDialog.FileName != null) { //create serialization object SerializeObject openMe = new SerializeObject(openFileDialog.FileName); //attempt to read the file if (openMe.readFile()) { try { //create new show from read data aShow openedShow = (aShow)openMe.obj; frmSeatingChart chart = new frmSeatingChart(openedShow, openFileDialog.FileName); //display that form chart.Show(); //hide this form this.Visible = false; }//end try catch { MessageBox.Show("Error while opening file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }//end catch }//end if else { //otherwise, throw error MessageBox.Show("Unable to open file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }//end else }//end inner if }//end outer if }
//non-default constructor public frmReserveTickets(frmSeatingChart seatingChart) { InitializeComponent(); this.SeatingChart = seatingChart; }
private void doSeatingChart(int numNights, string showName) { //create new show with selected number of nights aShow show = new aShow(cmboNumNights.SelectedIndex + 1, showName); if (existingChart != null) { //set the chart form's current show to the one just made existingChart.currentShow = show; //close this form this.Close(); //re-enable the form existingChart.Enabled = true; //reset the form to night 1 existingChart.updateNight(1); }//end if else if (existingChart == null) { //create new form and pass it the show that was just created frmSeatingChart seatingChartMain = new frmSeatingChart(show); //close this form this.Close(); //show new form seatingChartMain.Show(); }//end else if }