private void btnXoa_Click(object sender, EventArgs e) { if (System.Windows.Forms.MessageBox.Show("Xóa KTX", "KTX", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { KTXInfo ktx = new KTXInfo(); ktx.MaKTX = txtMa.Text; ktx.TenKTX = txtTen.Text; ctrl.Xoa(ktx); ctrl.HienThi(dataKyTucXa, binKyTucXa, txtMa, txtTen, txtSoDay); } }
public DayInfo DuLieuToDay(TextBox ma, TextBox ten, TextBox soluong, ComboBoxEx cmbKTX, ComboBoxEx cmbCoDo) { DayInfo day = new DayInfo(); day.MaDay = ma.Text; day.TenDay = ten.Text; day.SoLuongPhong = Convert.ToInt32(soluong.Text); SinhVienInfo codo = new SinhVienInfo(); codo.MaKTX = (cmbCoDo.SelectedValue == null?"":cmbCoDo.SelectedValue.ToString()); codo.HoTen = (cmbCoDo.Text == null?"":cmbCoDo.Text); KTXInfo ktx = new KTXInfo(); ktx.MaKTX = cmbKTX.SelectedValue.ToString(); ktx.TenKTX = cmbKTX.Text; day.KTX = ktx; day.CoDo = codo; return(day); }