示例#1
0
        // Report Thong Ke HocPhi, CTXH, ViPham
        public frmReport(string maSV, string hoTen, string maLop, string tong, int ktra)
        {
            InitializeComponent();

            if (ktra == 12)
            {
                HocPhanBUS hpBUS = new HocPhanBUS();

                ReportDataSource reportDataSource = new ReportDataSource();
                reportDataSource.Name  = "dsNoHocPhi_By_MSSV";
                reportDataSource.Value = hpBUS.getHPByMaSV(maSV);
                reportViewer1.LocalReport.DataSources.Add(reportDataSource);

                this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpNoHocPhi_By_MSSV.rdlc";
            }
            else
            {
                if (ktra == 7)
                {
                    CTXHBUS ctxhBUS = new CTXHBUS();

                    ReportDataSource reportDataSource = new ReportDataSource();
                    reportDataSource.Name  = "dsCTXH_By_MSSV";
                    reportDataSource.Value = ctxhBUS.getHDCTXHByMaSV(maSV);
                    reportViewer1.LocalReport.DataSources.Add(reportDataSource);

                    this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpCTXH_By_MSSV.rdlc";
                }
                else
                {
                    tong = "0";
                    ViPhamBUS vpBUS = new ViPhamBUS();

                    ReportDataSource reportDataSource = new ReportDataSource();
                    reportDataSource.Name  = "dsViPham_By_MSSV";
                    reportDataSource.Value = vpBUS.getVPByMaSV(maSV);
                    reportViewer1.LocalReport.DataSources.Add(reportDataSource);

                    this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpViPham_By_MSSV.rdlc";
                }
            }

            ReportParameter[] rp = new ReportParameter[4];
            rp[0] = new ReportParameter("MaSV", maSV);
            rp[1] = new ReportParameter("HoTen", hoTen);
            rp[2] = new ReportParameter("Tong", tong);
            rp[3] = new ReportParameter("MaLop", maLop);
            reportViewer1.LocalReport.SetParameters(rp);
        }
示例#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();
        }