private void exitBtn_Click(object sender, EventArgs e) { this.Hide(); DonorApp d = new DonorApp(); d.Show(); }
private void operate_Click(object sender, EventArgs e) { if (this.Add == true) //insert person function { this.donrlist.Add(new Person(fnameBox.Text, lnameBox.Text, pnumBox.Text, emailBox.Text, addrBox.Text, bloodTypeBox.Text, antigenBox.Text)); } if (this.Add == false) //edit person function { this.donrlist[this.index].fname = fnameBox.Text; this.donrlist[this.index].lname = lnameBox.Text; this.donrlist[this.index].address = addrBox.Text; this.donrlist[this.index].email = emailBox.Text; this.donrlist[this.index].antigen = this.antigenBox.Text; this.donrlist[this.index].phoneNum = pnumBox.Text; this.donrlist[this.index].bloodType = this.bloodTypeBox.Text; } this.Hide(); DonorApp d = new DonorApp(); //back to Donor View d.donlist = this.donrlist; //give attributes of donorapp's current donorlist state to a new window d.ListIntoListboxPopulate(); //update new windows's listbox to list's data d.Show(); //show updated window }