Example #1
0
        // Report Thong Ke RenLuyen
        public frmReport(string maSV, string hoTen, string maLop, string namHoc, int hocKy, string tongDiem, string xepLoai)
        {
            InitializeComponent();

            RenLuyenBUS rlBUS = new RenLuyenBUS();

            ReportDataSource reportDataSource = new ReportDataSource();

            reportDataSource.Name  = "dsRenLuyen_By_MSSV";
            reportDataSource.Value = rlBUS.getHDRLByMaSV_NamHoc_HocKy(maSV, namHoc, hocKy);
            reportViewer1.LocalReport.DataSources.Add(reportDataSource);

            this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpRenLuyen_By_MSSV.rdlc";
            ReportParameter[] rp = new ReportParameter[7];
            rp[0] = new ReportParameter("MaSV", maSV);
            rp[1] = new ReportParameter("HoTen", hoTen);
            rp[2] = new ReportParameter("NamHoc", namHoc);
            rp[3] = new ReportParameter("HocKy", hocKy.ToString());
            rp[4] = new ReportParameter("TongDiem", tongDiem);
            rp[5] = new ReportParameter("XepLoai", xepLoai);
            rp[6] = new ReportParameter("MaLop", maLop);
            reportViewer1.LocalReport.SetParameters(rp);
        }
Example #2
0
        private void TimThongTin()
        {
            var sv = svBUS.getSVTheoMaSV(this.txtNhapMSSV.Text);

            if (sv.Count == 0)
            {
                MessageBox.Show("Không tìm thấy SINH VIÊN.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            else
            {
                // Can use btnReload btnReport
                this.btnReLoad.Enabled = true;
                this.btnIn.Enabled     = true;

                this.txtMSSV.Text     = sv[0].MaSV;
                this.txtHoTen.Text    = sv[0].HoTen;
                this.txtNgaySinh.Text = sv[0].NgaySinh.ToString();
                this.txtDiaChi.Text   = sv[0].DiaChi;
                this.txtGioiTinh.Text = sv[0].GioiTinh;
                this.txtDanToc.Text   = sv[0].DanToc;
                this.txtQueQuan.Text  = sv[0].QueQuan;
                this.txtLop.Text      = sv[0].MaLop;

                if (ktButton == 7)
                {
                    this.dgcTK_HoatDong.DataSource = ctxhBUS.getHDCTXHByMaSV(this.txtNhapMSSV.Text);

                    int?tong = dsCTXHBUS.getTongDiemHDCTXHByMaSV(this.txtMSSV.Text)[0];
                    this.txtTong.Text = tong == null ? "0" : tong.ToString();
                }
                else
                {
                    if (ktButton == 8)
                    {
                        this.dgcTK_HoatDong.DataSource = rlBUS.getHDRLByMaSV_NamHoc_HocKy(this.txtNhapMSSV.Text,
                                                                                          this.cbbNamHoc.SelectedValue.ToString(),
                                                                                          Convert.ToInt32(this.cbbHocKy.SelectedValue.ToString()));

                        int?tongDRL = 0;

                        int?diemCong = dsRLBUS.getTongDiemCongRLByMaSV_NamHoc_HocKy(this.txtMSSV.Text,
                                                                                    this.cbbNamHoc.SelectedValue.ToString(),
                                                                                    Convert.ToInt32(this.cbbHocKy.SelectedValue.ToString()))[0];
                        if (diemCong != null)
                        {
                            tongDRL += diemCong;
                        }

                        int?diemTru = dsRLBUS.getTongDiemTruRLByMaSV_NamHoc_HocKy(this.txtMSSV.Text,
                                                                                  this.cbbNamHoc.SelectedValue.ToString(),
                                                                                  Convert.ToInt32(this.cbbHocKy.SelectedValue.ToString()))[0];
                        if (diemTru != null)
                        {
                            tongDRL -= diemTru;
                        }
                        this.txtTong.Text = tongDRL.ToString();

                        if (tongDRL >= 90)
                        {
                            this.txtXLRL.Text = "Xuất sắc";
                        }
                        else
                        {
                            if (tongDRL >= 80)
                            {
                                this.txtXLRL.Text = "Tốt";
                            }
                            else
                            {
                                if (tongDRL >= 70)
                                {
                                    this.txtXLRL.Text = "Khá";
                                }
                                else
                                {
                                    if (tongDRL >= 50)
                                    {
                                        this.txtXLRL.Text = "Trung Bình";
                                    }
                                    else
                                    {
                                        this.txtXLRL.Text = "Yếu";
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        if (ktButton == 12)
                        {
                            this.dgcTK_HoatDong.DataSource = hpBUS.getHPByMaSV(this.txtNhapMSSV.Text);
                            this.txtTong.Text = hpBUS.getTongNoHPByMaSV(this.txtNhapMSSV.Text)[0].ToString() == ""
                                ? "0" : hpBUS.getTongNoHPByMaSV(this.txtNhapMSSV.Text)[0].ToString();
                        }
                        else
                        {
                            this.dgcTK_HoatDong.DataSource = vpBUS.getVPByMaSV(this.txtNhapMSSV.Text);
                        }
                    }
                }
            }
            this.txtNhapMSSV.SelectAll();
        }