protected void Button1_Click(object sender, EventArgs e) { int ID = 0; if (TextBox1.Text != "" || TextBox2.Text != "" || TextBox3.Text != "") { if (MUSICmethods.isexistbyname(TextBox1.Text) == 1) { ConsoleApp4.MUSICmethods.addmusic(TextBox1.Text.ToString(), num); ID = MUSICmethods.getIDbyname(TextBox1.Text.ToString()); } else { ID = MUSICmethods.getIDbyname(TextBox1.Text.ToString()); } performermethods.addperformer(TextBox2.Text, ID); ConsoleApp4.reviewsmethods.addreview(TextBox3.Text.ToString(), ID, usermethods.getidbyuser(Session["Value"].ToString())); Response.Redirect("homepage.aspx"); } else { Label1.Text = "you did not fill all of the fields! fill them and the press the button!"; } }
protected void Button3_Click(object sender, EventArgs e) { reviewsmethods.removereview(int.Parse(GridView2.SelectedRow.Cells[1].Text)); DataTable dt = reviewsmethods.getByid(int.Parse(GridView1.SelectedRow.Cells[1].Text)); if (dt.Rows.Count == 0) { performermethods.removeperformer(int.Parse(GridView1.SelectedRow.Cells[1].Text)); MUSICmethods.removemusic(int.Parse(GridView1.SelectedRow.Cells[1].Text)); } }
protected void Button2_Click(object sender, EventArgs e) { performermethods.removeperformer(int.Parse(GridView1.SelectedRow.Cells[1].Text)); reviewsmethods.removereviewbymusic(int.Parse(GridView1.SelectedRow.Cells[1].Text)); MUSICmethods.removemusic(int.Parse(GridView1.SelectedRow.Cells[1].Text)); }
protected void Page_Load(object sender, EventArgs e) { Label1.Text = "welcome " + Session["value"].ToString() + " to the reviews site ! bellow you can see all the songs or albums that have a review by clicking on the select button next to them and you can add a review of your own to an existing song or a new song by clicking on the button below!"; GridView1.DataSource = MUSICmethods.getallmusic(); GridView1.DataBind(); }