public void addNew() { CDInformation cd = new CDInformation( txtID.Text, txtAlbum.Text, txtSinger.Text, cbxGenre.Text, int.Parse(txtDuration.Text) ); for (int i = 0; i < listSongs.Items.Count; i++) { cd.Song.Add(listSongs.Items[i].ToString()); } FormManage owner = (FormManage)this.Owner; foreach (CDInformation CD in owner.ListCD) { if (owner.ListCD.Count == 0) { break; } if (CD.ID1.Equals(txtID.Text)) { ErrorID.SetError(txtID, "This ID is already existed!!"); return; } } ErrorID.Clear(); owner.ListCD.Add(cd); owner.loadListData(); btnReset_Click(this, null); }
public bool validarEB() { bool noError = true; int count = 0; count = count + 1; if (count != 0) { ErrorID.Clear(); } if (textBox2.Text == "") { ErrorID.SetError(textBox2, "Elija Chofer"); noError = false; } if (textBoxDescripcioE.Text == "") { ErrorID.SetError(textBoxDescripcioE, "Ingrese la descripcion de la Ruta"); noError = false; } if (textBoxNumeroBusE.Text == "") { ErrorID.SetError(textBoxNumeroBusE, "Ingrese el numero del bus"); noError = false; } if (textBoxPlacaBusE.Text == "") { ErrorID.SetError(textBoxPlacaBusE, "Ingrese la placa del bus"); noError = false; } return(noError); }
public bool valid() { bool isError = false; if (txtID.Text.Equals("")) { ErrorID.SetError(txtID, "ID must not be empty!"); isError = true; } if (txtAlbum.Text.Equals("")) { ErrorAlbum.SetError(txtAlbum, "Album must not be empty!"); isError = true; } if (txtSinger.Text.Equals("")) { ErrorSinger.SetError(txtSinger, "Singer must not be empty!"); isError = true; } if (listSongs.Items.Count == 0) { ErrorSong.SetError(listSongs, "You must add at least one song"); isError = true; } if (isError) { return(false); } else { ErrorID.Clear(); ErrorAlbum.Clear(); ErrorDuration.Clear(); ErrorSinger.Clear(); ErrorSong.Clear(); return(true); } }//end of valid()