private void cbbChonKhoa_SelectedValueChanged(object sender, EventArgs e)
 {
     if (this.cbbChonKhoa.Text != "")
     {
         this.dgcGiaoVien.DataSource = gvBUS.getGVTheoMaKhoa(this.cbbChonKhoa.SelectedValue.ToString());
         DataBind();
     }
 }
        private void cbbMaKhoa_SelectedValueChanged(object sender, EventArgs e)
        {
            var k = khoaBUS.getKTheoMaKhoa(this.cbbMaKhoa.SelectedValue.ToString());

            if (k.Count != 0)
            {
                // lcg Khoa
                var trgKhoa = gvBUS.getGVTheoMaKhoa(k[0].MaKhoa);
                trgKhoa.Insert(0, new spGetGVTheoMaKhoa_Result {
                    MaGV = "", TenGV = "-- Select --"
                });
                this.cbbTruongKhoa.DataSource    = trgKhoa;
                this.cbbTruongKhoa.DisplayMember = "TenGV";
                this.cbbTruongKhoa.ValueMember   = "MaGV";

                this.txtTenKhoa.Text                     = k[0].TenKhoa;
                this.cbbTruongKhoa.SelectedValue         = k[0].CNKhoa == null ? "" : k[0].CNKhoa;
                this.txtSDTKhoa.Text                     = k[0].SDTKhoa;
                this.cbbMaKhoa_ChuyenNganh.SelectedValue = k[0].MaKhoa;

                // lcg Chuyen Nganh
                var listCN = cnBUS.getCNTheoKhoa(k[0].MaKhoa);

                if (listCN.Count == 0)
                {
                    this.lcgChuyenNganh.Enabled = false;
                    this.cbbMaChuyenNganh.Text  = "";
                    this.lcgLop.Enabled         = false;
                    this.cbbMaLop.Text          = "";
                    this.lcgSV.Enabled          = false;
                    dgcSinhVien.DataSource      = null;
                }
                else
                {
                    this.lcgChuyenNganh.Enabled         = true;
                    this.cbbMaChuyenNganh.DataSource    = listCN;
                    this.cbbMaChuyenNganh.DisplayMember = "MaChuyenNganh";
                    this.cbbMaChuyenNganh.ValueMember   = "MaChuyenNganh";
                }
            }
        }
Пример #3
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);
        }