//-----------------------THỐNG KÊ---------------------- private void btn_in1_Click(object sender, EventArgs e) { try { Object_LopHocPhan lhp = new Object_LopHocPhan(); lhp.Malhp = txt_malhp2.Text; DataTable dt = Bus.GetTenMon_MaLHP(lhp); label6.ResetText(); label7.ResetText(); label8.ResetText(); label9.ResetText(); label10.ResetText(); label11.ResetText(); label7.Text = "Lớp Học Phần "; label8.ResetText(); label8.Text = DateTime.Now.ToShortDateString(); label6.Text += "Môn học: " + dt.Rows[0].Field <string>("TenMH"); label9.Text += "Học kì: " + dt.Rows[0].Field <string>("hocki"); label10.Text += "Năm học: " + dt.Rows[0].Field <string>("namhoc"); dgr_thongkediem.DataSource = Bus.ThongKeDiem_MaLHP(lhp); //Export ex = new Export(); //ex.ExportExcel_MaLHP(Bus.ThongKeDiem_MaLHP(lhp), "lớp học phần " + txt_malhp2.Text, " Bảng Điểm Lớp Học Phần " + txt_malhp2.Text + " - " + label6.Text+"\n "+label9.Text+" - "+label10.Text+"\n Giảng viên: "+dt.Rows[0].Field<string>(3)); } catch (Exception ex) { MessageBox.Show("Lỗi biên dịch\nKiểm tra dữ liệu nhập vào!"); } }
private void btn_xem_Click(object sender, EventArgs e) { if (txt_nhapmagv.Text == "" || txt_nhapnamhoc.Text == "" || txt_nhaphocki.Text == "") { MessageBox.Show("Mời bạn điền đủ thông tin!"); } else { try { Object_GiangVien gv = new Object_GiangVien(); Object_LopHocPhan lhp = new Object_LopHocPhan(); gv.MaGV = txt_nhapmagv.Text; lhp.Namhoc = txt_nhapnamhoc.Text; lhp.Hocki = txt_nhaphocki.Text; dgr_lichgiangday.DataSource = Bus.GetLichDay(gv, lhp); dgr_lichgiangday.AutoResizeColumns(); dgr_lichgiangday.AutoResizeRows(); DoiTen(); } catch (Exception ex) { MessageBox.Show("record empty!"); } } }
private void btn_xem1_Click(object sender, EventArgs e) { Object_LopHocPhan lhp = new Object_LopHocPhan(); lhp.Malhp = txt_malhp1.Text; dgr_bangdiem.DataSource = Bus.ThongKeDiem_MaLHP(lhp); }
// click button capnhat private void btn_capnhat_Click(object sender, EventArgs e) { Object_LopHocPhan lhp = new Object_LopHocPhan(); lhp.Malhp = txt_malhp.Text; dgr_bangdiem.DataSource = Bus.GetDiem_LHP(lhp); }
// -------------------ADMIN BẢNG ĐIỂM----------------- //select bảng điểm public static DataTable GetDiem_LHP(Object_LopHocPhan lhp) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@malhp", lhp.Malhp) }; return(DataProvider.GetDatadk("CapNhatDiem", para)); }
//Thống kê theo lhp public static DataTable ThongKeDiem_MaLHP(Object_LopHocPhan lhp) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@malhp", lhp.Malhp) }; return(DataProvider.GetDatadk("thongkediem_malhp", para)); }
//lấy tên môn học: public static DataTable GetTenMon_MaLHP(Object_LopHocPhan lhp) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@malhp", lhp.Malhp) }; return(DataProvider.GetDatadk("GetTenMon_malhp", para)); }
public static DataTable GetThongTinSV_ThongKe(Object_SinhVien sv, Object_LopHocPhan lhp) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@masv", sv.MaSV), new SqlParameter("@hocki", lhp.Hocki), new SqlParameter("@namhoc", lhp.Namhoc) }; return(DataProvider.GetDatadk("getthongtinsv", para)); }
public static DataTable ThongKeDiem_MaSV_NamHoc_HocKi(Object_SinhVien sv, Object_LopHocPhan lhp) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@masv", sv.MaSV), new SqlParameter("@hocki", lhp.Hocki), new SqlParameter("@namhoc", lhp.Namhoc) }; return(DataProvider.GetDatadk("ThongKeDiem_masv_hk_namhoc", para)); }
// Lịch giảng dạy public static DataTable GetLichDay(Object_GiangVien gv, Object_LopHocPhan lhp) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@magv", gv.MaGV), new SqlParameter("@namhoc", lhp.Namhoc), new SqlParameter("@hocki", lhp.Hocki) }; return(DataProvider.GetDatadk("xemlichgiangday", para)); }
public static DataTable GetThongTinSV_ThongKe(Object_SinhVien sv, Object_LopHocPhan lhp) { return(Dao.GetThongTinSV_ThongKe(sv, lhp)); }
private void btn_in3_Click(object sender, EventArgs e) { Object_SinhVien sv = new Object_SinhVien(); Object_LopHocPhan lhp = new Object_LopHocPhan(); DataTable dt = new DataTable(); string pattern = @"([0-9]{4,4}[\s][-][\s][0-9])"; Regex myregex = new Regex(pattern); if (string.IsNullOrEmpty(txt_masv2.Text)) { MessageBox.Show("Nhập vào mã sinh viên!"); } else if (string.IsNullOrEmpty(txt_namhoc2.Text)) { MessageBox.Show("Nhập vào năm học!"); } else if (cbo_hocki2.SelectedIndex == -1) { MessageBox.Show("Chọn học kì!"); } else if (!myregex.IsMatch(txt_namhoc2.Text)) { MessageBox.Show("Nhập đúng định dạng : yyyy - yyyy"); } else { try { sv.MaSV = txt_masv2.Text; lhp.Namhoc = txt_namhoc2.Text; lhp.Hocki = cbo_hocki2.SelectedItem.ToString(); dt = Bus.GetThongTinSV_ThongKe(sv, lhp); dgr_thongkediem.DataSource = Bus.ThongKeDiem_MaSV_NamHoc_HocKi(sv, lhp); label6.ResetText(); label7.ResetText(); label8.ResetText(); label9.ResetText(); label10.ResetText(); label11.ResetText(); label8.Text = DateTime.Now.ToShortDateString(); label7.Text = "Sinh Viên ,Học Kì " + cbo_hocki2.SelectedItem.ToString() + ", Năm học " + txt_namhoc2.Text; label6.Text = "Sinh Viên: " + dt.Rows[0].Field <string>("tensv"); //label9.Text = "Số TC Nợ: " + Convert.ToSingle( dt.Rows[0].Field<int?>("tcno")); //label10.Text = "TB Học Kì: " +Convert.ToDouble( dt.Rows[0].Field<float>("tbhk")); //label11.Text = "Điểm Tích Lũy: " +Convert.ToDouble (dt.Rows[0].Field<float>("diemtichluy")); if (dt.Rows[0].Field <int?>(2) == null) { label9.Text = "Số TC Nợ: 0"; } else { label9.Text = "Số TC Nợ: " + dt.Rows[0].Field <int?>(2); } label10.Text = "TB Học Kì: " + dt.Rows[0].Field <double?>(3); label11.Text = "Điểm Tích Lũy: " + dt.Rows[0].Field <double?>(1); Export ex = new Export(); ex.ExportExcel_MaSV(Bus.ThongKeDiem_MaSV_NamHoc_HocKi(sv, lhp), txt_masv2.Text, string.Format(label7.Text + "\n" + label6.Text + "\n" + label10.Text + "\n" + label9.Text + "\n" + label11.Text)); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
//------------------ ADMIN BẢNG ĐIỂM ----------------- public static DataTable GetDiem_LHP(Object_LopHocPhan lhp) { return(Dao.GetDiem_LHP(lhp)); }
//thống kê điểm theo mã LHP public static DataTable ThongKeDiem_MaLHP(Object_LopHocPhan lhp) { return(Dao.ThongKeDiem_MaLHP(lhp)); }
// public static DataTable GetTenMon_MaLHP(Object_LopHocPhan lhp) { return(Dao.GetTenMon_MaLHP(lhp)); }
//-----------GIẢNG VIÊN---------------- // public static DataTable GetLichDay(Object_GiangVien gv, Object_LopHocPhan lhp) { return(Dao.GetLichDay(gv, lhp)); }
public static DataTable ThongKeDiem_MaSV_NamHoc_HocKi(Object_SinhVien sv, Object_LopHocPhan lhp) { return(Dao.ThongKeDiem_MaSV_NamHoc_HocKi(sv, lhp)); }