private void btnCreateCompetition_Click(object sender, EventArgs e) { //lấy thông tin từ các textbox đề tạo 1 kỳ thi mới //kiểm tra text box giờ thi //tạo 1 cái date time mới. DateTime dt = new DateTime(dtDateBegin.Value.Year, dtDateBegin.Value.Month, dtDateBegin.Value.Day, inputHour.Value, inputMin.Value, 0); COMPETION cNew = new COMPETION(); cNew.id = Convert.ToInt32(txtidtest.Text); cNew.subtractID = cbSubtractCom.SelectedValue.ToString(); cNew.testDateBegin = dt; cNew.testTimeToLive = intTTL.Value; cNew.gradeid = Convert.ToInt32(cbgradeid.SelectedValue); cNew.idtest = Convert.ToInt32(cbDe.SelectedValue); //gọi hàm thêm kỳ thi TracNghiem.ThemKyThiThat(cNew); OnLoad(e); }