private void frmCapNhatThongTinLopDangKy_Load(object sender, EventArgs e) { cbCLB.DataSource = CLBServices.LayDanhSachCLB(); cbCLB.DisplayMember = "TenCLB"; cbCLB.ValueMember = "MaCLB"; foreach (TextBox tb in this.Controls.OfType <TextBox>()) { tb.TextChanged += Tb_TextChanged; } txtHocPhi.Text = _TTLop[2].ToString(); txtTenLop.Text = _TTLop[1].ToString(); txtLichHoc.Text = _TTLop[3].ToString(); txtNamHoc.Text = _TTLop[6].ToString(); cbCLB.SelectedIndex = cbCLB.FindStringExact(_TTLop[4].ToString()); }
private void btnComfirmEdit_Click(object sender, EventArgs e) { int Change = 0; Change = CLBServices.UpdateTTCLB(txtTenCLB.Tag.ToString(), txtTenCLB.Text); if (Change > 0) { MessageBox.Show("Sửa Tên CLB thành công"); onload(); UC_QuanLyLopvaCLB.Instance.onload(); UC_DKHOC.Instance.btnPickStd.PerformClick(); btnComfirmEdit.Enabled = false; } else { MessageBox.Show("Lỗi không thể cập nhật Vào CSDL"); } }
private void btnCOmfirmThem_Click(object sender, EventArgs e) { int Change = 0; Change = CLBServices.ThemCLB(txtTenCLB.Text); if (Change > 0) { MessageBox.Show($"Thêm thành công CLB {txtTenCLB.Text}"); onload(); UC_QuanLyLopvaCLB.Instance.onload(); UC_DKHOC.Instance.btnPickStd.PerformClick(); btnCOmfirmThem.Enabled = false; } else { MessageBox.Show("Thêm không thành công"); } }
private void onload() { bdCLB.DataSource = CLBServices.LayDanhSachCLB(); }
private void btnDuLieu_Click(object sender, EventArgs e) { if (cbChart.SelectedIndex < 0 || cbQuyThongKe.SelectedIndex < 0 || string.IsNullOrEmpty(txtNam.Text)) { MessageBox.Show("Vui lòng chọn các trường để load dữ liệu"); } else { chrBaoCaoSoLuongDangky.Series.Clear(); int Thang = (cbQuyThongKe.SelectedIndex + 1) * 3; List <Series> DanhSachSeries = new List <Series>(); DanhSachSeries.Add(new Series($"Tháng {(Thang - 2).ToString()}", ViewType.Bar)); DanhSachSeries.Add(new Series($"Tháng {(Thang - 1).ToString()}", ViewType.Bar)); DanhSachSeries.Add(new Series($"Tháng {Thang.ToString()}", ViewType.Bar)); if (cbChart.SelectedIndex == 0) { DataTable dtLA = LopDangKyServices.DanhsachLopDangKyVaSoHocSinh(Int32.Parse(txtNam.Text), Thang - 2); DataTable dtLB = LopDangKyServices.DanhsachLopDangKyVaSoHocSinh(Int32.Parse(txtNam.Text), Thang - 1); DataTable dtLC = LopDangKyServices.DanhsachLopDangKyVaSoHocSinh(Int32.Parse(txtNam.Text), Thang); if (dtLA.Rows.Count != 0 || dtLB.Rows.Count != 0 || dtLC.Rows.Count != 0) { DanhSachSeries[0].DataSource = dtLA; DanhSachSeries[1].DataSource = dtLB; DanhSachSeries[2].DataSource = dtLC; DanhSachSeries.ForEach( x => { chrBaoCaoSoLuongDangky.Series.Add(x); x.ArgumentScaleType = ScaleType.Auto; x.ArgumentDataMember = "TenVaMaLop"; x.ValueDataMembers.AddRange(new string[] { "Count" }); }); } else { MessageBox.Show("Không có dữ liệu nào"); } } else { DataTable dtclbA = CLBServices.DanhSachCLBvaSoHocSinh(Int32.Parse(txtNam.Text), Thang - 2); DataTable dtclbB = CLBServices.DanhSachCLBvaSoHocSinh(Int32.Parse(txtNam.Text), Thang - 1); DataTable dtclbC = CLBServices.DanhSachCLBvaSoHocSinh(Int32.Parse(txtNam.Text), Thang); if (dtclbA.Rows.Count != 0 || dtclbB.Rows.Count != 0 || dtclbC.Rows.Count != 0) { DanhSachSeries[0].DataSource = dtclbA; DanhSachSeries[1].DataSource = dtclbB; DanhSachSeries[2].DataSource = dtclbC; DanhSachSeries.ForEach( x => { chrBaoCaoSoLuongDangky.Series.Add(x); x.ArgumentScaleType = ScaleType.Auto; x.ArgumentDataMember = "ID"; x.ValueDataMembers.AddRange(new string[] { "Count" }); }); } else { MessageBox.Show("khoong co data"); } } } }