private void btnOk_Click(object sender, EventArgs e) { if (Validation()) { Student std = new Student(); std.FullName = txtFullName.Text; std.StudentCode = txtStudentCode.Text; std.ClassName = txtClassName.Text; std.Nation = txtNation.Text; if (radioNam.Checked == true) { std.Gender = radioNam.Text; } else { std.Gender = radioNu.Text; } std.DateOfBirth = DateTime.Parse(dateTimePicker1.Text); StudentService.AddNew(std); this.Close(); } }
private void FormChart_Load(object sender, EventArgs e) { chart1.Series["Series1"].Points.AddXY("Nam", StudentService.CountSv()); chart1.Series["Series1"].Points.AddXY("Nữ", StudentService.lstStudent.Count - StudentService.CountSv()); }
//thêm tự động private void btnAutoAdd_Click(object sender, EventArgs e) { StudentService.AutoData(); BindData(); }
private void SearchResult_Load(object sender, EventArgs e) { dataGridView1.DataSource = StudentService.Search(StudentService.txt); }