protected void addShow_Click(object sender, EventArgs e) { Show show = new Show(); show.setVenue("Enter venue"); show.setDate("01-01-2000"); //Add band selectedBand.addShow(show); //save save(); //Reload the page Response.Redirect(String.Format("~/band.aspx?b={0}", selectedBand.getName())); }
protected void submit_Click(object sender, EventArgs e) { //Get all the data for band members int index = 0; foreach(GridViewRow row in memberGrid.Rows) { if (index < selectedBand.getMembers().Length) { selectedBand.getMembers()[index].setName(((TextBox)row.Cells[0].Controls[1]).Text); selectedBand.getMembers()[index].setInstrument(((TextBox)row.Cells[1].Controls[1]).Text); selectedBand.getMembers()[index].setJoinDate(((TextBox)row.Cells[2].Controls[1]).Text); } else { Member temp = new Member(((TextBox)row.Cells[0].Controls[1]).Text, ((TextBox)row.Cells[1].Controls[1]).Text); temp.setJoinDate(((TextBox)row.Cells[2].Controls[1]).Text); selectedBand.addMember(temp); } index++; } //Get all the data for shows index = 0; foreach (GridViewRow row in showGridView.Rows) { if (index < selectedBand.getShows().Length) { selectedBand.getShows()[index].setVenue(((TextBox)row.Cells[0].Controls[1]).Text); selectedBand.getShows()[index].setDate(((TextBox)row.Cells[1].Controls[1]).Text); } else { Show temp = new Show(); temp.setVenue(((TextBox)row.Cells[0].Controls[1]).Text); temp.setDate(((TextBox)row.Cells[1].Controls[1]).Text); selectedBand.addShow(temp); } index++; } //If band name is difference if (bandPageLabel.Text != selectedBand.getName()) { //Change the name selectedBand.setName(bandPageLabel.Text); //Save save(); //Reload the page Response.Redirect(String.Format("~/band.aspx?b={0}", selectedBand.getName())); } save(); }