Example #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text.IndexOf(' ') != -1 || textBox2.Text.IndexOf(' ') != -1 || textBox3.Text.IndexOf(' ') != -1 || textBox4.Text.IndexOf(' ') != -1)
     {
         label5.Text = "No blank is permitted!";
     }
     else if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "")
     {
         label5.Text = "No box cannot be vacant!";
     }
     else if (abc.DeleteTrack(title, artist, playlist) == 1 && abc.AddTrack(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, playlist, Public.Checked == true ? "Y" : "N") == 1)  // 需修改
     {
         this.DialogResult = DialogResult.OK;
     }
     else
     {
         abc.AddTrack(title, artist, album, genre, playlist, "Y");
         label5.Text = "Fail to update!";
     }
 }
Example #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text.IndexOf(' ') != -1 || textBox2.Text.IndexOf(' ') != -1 || textBox3.Text.IndexOf(' ') != -1 || textBox4.Text.IndexOf(' ') != -1)
     {
         label5.Text = "No blank is permitted!";
     }
     else if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "")
     {
         label5.Text = "No box cannot be vacant!";
     }
     else if (abc.AddTrack(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, playlist, Public.Checked == true?"Y":"N") == 1)
     {
         this.DialogResult = DialogResult.OK;
     }
     else
     {
         label5.Text = "Fail to add or had been created!";
     }
 }