Exemplo n.º 1
0
        // Report Quan Ly GiangVien / Diem Thi & HocPhan / CTXH / HDRL
        public frmReport(string ma, int ktra)
        {
            InitializeComponent();

            // QL CTXH
            if (ktra == 10)
            {
                DSSV_CTXHBUS dsCTXHBUS = new DSSV_CTXHBUS();

                ReportDataSource reportDataSource = new ReportDataSource();
                reportDataSource.Name  = "dsQLCTXH";
                reportDataSource.Value = dsCTXHBUS.getSVByMaCTXH(ma);
                reportViewer1.LocalReport.DataSources.Add(reportDataSource);

                this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpQLCTXH.rdlc";
            }
            else
            {
                // QL HDRL
                if (ktra == 11)
                {
                    DSSV_RLBUS dsHDRL = new DSSV_RLBUS();

                    ReportDataSource reportDataSource = new ReportDataSource();
                    reportDataSource.Name  = "dsQLHDRL";
                    reportDataSource.Value = dsHDRL.getSVByMaRL(ma);
                    reportViewer1.LocalReport.DataSources.Add(reportDataSource);

                    this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpQLHDRL.rdlc";
                }
                else
                {
                    // QL Giang Vien
                    if (ktra == 12)
                    {
                        GiangVienBUS gvBUS = new GiangVienBUS();

                        ReportDataSource reportDataSource = new ReportDataSource();
                        reportDataSource.Name  = "dsQLGiangVien";
                        reportDataSource.Value = gvBUS.getGVTheoMaKhoa(ma);
                        reportViewer1.LocalReport.DataSources.Add(reportDataSource);

                        this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpQLGiangVien.rdlc";
                    }
                    else
                    {
                        // QL Diem Thi
                        if (ktra == 13)
                        {
                            SinhVienBUS svBUS = new SinhVienBUS();

                            ReportDataSource reportDataSource = new ReportDataSource();
                            reportDataSource.Name  = "dsDiemThi";
                            reportDataSource.Value = svBUS.getSVTheoMaHP(ma);
                            reportViewer1.LocalReport.DataSources.Add(reportDataSource);

                            this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpQLDiemThi.rdlc";
                        }
                        // QL Hoc Phan
                        else
                        {
                            SinhVienBUS svBUS = new SinhVienBUS();

                            ReportDataSource reportDataSource = new ReportDataSource();
                            reportDataSource.Name  = "dsQLHocPhan";
                            reportDataSource.Value = svBUS.getSVTheoMaHP(ma);
                            reportViewer1.LocalReport.DataSources.Add(reportDataSource);

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

            ReportParameter rp = new ReportParameter("Ma", ma);

            reportViewer1.LocalReport.SetParameters(rp);
        }
Exemplo n.º 2
0
        private void TimThongTin()
        {
            if (ktButton == 10)
            {
                var listCTXH = ctxhBUS.getHDByMaHD(this.txtNhapMaHD.Text);

                if (listCTXH.Count == 0)
                {
                    MessageBox.Show("Không tìm thấy Hoạt Động Công Tác Xã Hội", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.txtNhapMaHD.SelectAll();
                }
                else
                {
                    this.lcgTTHD.Enabled   = true;
                    this.lcgNhapSV.Enabled = true;

                    this.txtMaHD.Enabled = false;

                    this.txtMaHD.Text       = listCTXH[0].MaHDCTXH;
                    this.txtTenHD.Text      = listCTXH[0].TenHDCTXH;
                    this.txtNgayTC.Text     = listCTXH[0].NgayTC.ToString();
                    this.txtDiaDiem.Text    = listCTXH[0].DiaDiem;
                    this.txtSoDiemCong.Text = listCTXH[0].SoDiemCTXH.ToString();

                    this.dgcDSSV.DataSource = dsCTXHBUS.getSVByMaCTXH(this.txtNhapMaHD.Text);
                    this.btnXoa.Enabled     = true;
                    this.btnSua.Enabled     = true;

                    this.btnReLoad.Enabled = true;
                    this.btnIn.Enabled     = true;

                    DataBinding();
                }
            }
            else
            {
                var listRL = rlBUS.getHDRLByMaHD(this.txtNhapMaHD.Text);

                if (listRL.Count == 0)
                {
                    MessageBox.Show("Không tìm thấy Hoạt Động Rền Luyện", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.txtNhapMaHD.SelectAll();
                }
                else
                {
                    this.lcgTTHD.Enabled   = true;
                    this.lcgNhapSV.Enabled = true;

                    this.txtMaHD.Enabled = false;

                    this.txtMaHD.Text       = listRL[0].MaHDRL;
                    this.txtTenHD.Text      = listRL[0].TenHDRL;
                    this.txtNgayTC.Text     = listRL[0].NgayTC.ToString();
                    this.txtDiaDiem.Text    = listRL[0].DiaDiem;
                    this.txtSoDiemCong.Text = listRL[0].SoDiemRL.ToString();
                    this.txtNamHoc.Text     = listRL[0].NamHoc;
                    this.txtHocKy.Text      = listRL[0].HocKy.ToString();

                    this.dgcDSSV.DataSource = dsRLBUS.getSVByMaRL(this.txtNhapMaHD.Text);
                    this.btnXoa.Enabled     = true;
                    this.btnSua.Enabled     = true;

                    this.btnReLoad.Enabled = true;
                    this.btnIn.Enabled     = true;

                    DataBinding();
                }
            }
        }