Exemple #1
0
        private void init()
        {
            BO_CHUNG_CHI chungchi     = new BO_CHUNG_CHI();
            DataTable    tbl_chungchi = chungchi.getChungChi_All();

            if (tbl_chungchi.Rows.Count > 0)
            {
                for (int i = 0; i < tbl_chungchi.Rows.Count; i++)
                {
                    TreeNode node = new TreeNode();
                    node.Text = tbl_chungchi.Rows[i]["CHC_Name"].ToString();
                    node.Tag  = "CHC";
                    node.Name = tbl_chungchi.Rows[i]["CHC_ID"].ToString();
                    treeChungchi.Nodes.Add(node);
                    DateTime  fromDates = dateFrom.DateTime;
                    DateTime  endDates  = dateEnd.DateTime;
                    BO_LOP    lop       = new BO_LOP();
                    DataTable tbl_lop   = lop.getLopByChungChiIDFromTo(Convert.ToInt32(node.Name), fromDates, endDates);
                    if (tbl_lop.Rows.Count > 0)
                    {
                        for (int j = 0; j < tbl_lop.Rows.Count; j++)
                        {
                            TreeNode childNode = new TreeNode();
                            childNode.Text = tbl_lop.Rows[j]["LOP_Name"].ToString();
                            childNode.Tag  = "LOP";
                            childNode.Name = tbl_lop.Rows[j]["LOP_ID"].ToString();// +" KHÓA " + tbl_lop.Rows[j]["LOP_Khoa"].ToString();
                            node.Nodes.Add(childNode);
                        }
                    }
                }
            }
        }
Exemple #2
0
 private void initComboboxLopHoc(int vChungChiID)
 {
     balLop = new BO_LOP();
     lookLop_InGCN.Properties.DataSource    = balLop.getLOP_ByCcID(vChungChiID);
     lookLop_InGCN.Properties.ValueMember   = "LOP_ID";
     lookLop_InGCN.Properties.DisplayMember = "LOP_Name";
 }
Exemple #3
0
        private void loadDuration()
        {
            int LOP_ID = int.Parse(lookLopHoc.GetColumnValue("LOP_ID").ToString());

            BAL.BO_LOP dao_lop = new BO_LOP();
            DataRow    row     = dao_lop.getLOP_ByID(LOP_ID).Rows[0];// search by ID, so there is only one row

            txtFromDate.Text = Convert.ToDateTime(row["LOP_Ngay_KG"].ToString()).ToShortDateString();
            txtEndDate.Text  = Convert.ToDateTime(row["LOP_Ngay_KT"].ToString()).ToShortDateString();
        }
Exemple #4
0
        private void vLoadThoiGianHoc()
        {
            boLop = new BO_LOP();
            DataRow  row          = boLop.getLOP_ByID(int.Parse(lookUpLop.GetColumnValue("LOP_ID").ToString())).Rows[0];// search by ID, so there is only one row
            DateTime DateAllocate = Convert.ToDateTime(row["LOP_Ngay_KG"].ToString());
            DateTime DateExpire   = Convert.ToDateTime(row["LOP_Ngay_KT"].ToString());

            txtDateAllocate.Text = DateAllocate.ToString("dd/MM/yyyy");
            txtDateExpire.Text   = DateExpire.ToString("dd/MM/yyyy");
        }
Exemple #5
0
        private void initThongKe()
        {
            int       _nhomCcID   = 0;
            string    _nhomCcName = string.Empty;
            DataTable tblChungChi = new DataTable();

            lop               = new BO_LOP();
            boCapChungChi     = new BO_CAP_CHUNGCHI();
            _vDsThongKeCapGCN = new BcChungChi();
            int _ChcID = -1;

            if (lookupNhomCc.ItemIndex > -1 && lookupNhomCc.Enabled == true)
            {
                _nhomCcID   = int.Parse(lookupNhomCc.GetColumnValue("LOA_ID").ToString());
                _nhomCcName = lookupNhomCc.Text;
                if (lookChungChiTK.ItemIndex > -1 && lookChungChiTK.Enabled == true)
                {
                    _ChcID      = int.Parse(lookChungChiTK.GetColumnValue("CHC_ID").ToString());
                    tblChungChi = lop.getChungChiThongKeWithCcID(dateFrom.DateTime, dateEnd.DateTime, _nhomCcID, _ChcID);
                    initDataSetThongKeCapGCN(tblChungChi, _nhomCcName);
                }
                else
                {
                    tblChungChi = lop.getChungChiThongKe(dateFrom.DateTime, dateEnd.DateTime, _nhomCcID);
                    initDataSetThongKeCapGCN(tblChungChi, _nhomCcName);
                }
            }
            else
            {
                for (int iNhomCc = 0; iNhomCc < tblNhomChungChi.Rows.Count; iNhomCc++)
                {
                    _nhomCcID   = int.Parse(tblNhomChungChi.Rows[iNhomCc]["LOA_ID"].ToString());
                    _nhomCcName = tblNhomChungChi.Rows[iNhomCc]["LOA_Name"].ToString();
                    tblChungChi = lop.getChungChiThongKe(dateFrom.DateTime, dateEnd.DateTime, _nhomCcID);
                    initDataSetThongKeCapGCN(tblChungChi, _nhomCcName);
                }
            }
            rpThongKeCapGCN rpt = new rpThongKeCapGCN();

            rpt.SetDataSource(_vDsThongKeCapGCN.Tables["ThongKeCapChungChi"]);
            rpt.SetParameterValue("_fromDate", dateFrom.Text);
            rpt.SetParameterValue("_toDate", dateEnd.Text);
            rpt.SetParameterValue("_SumCapDoi", _SumCapDoi.ToString("#,##0"));
            rpt.SetParameterValue("_SumCapMoi", _SumCapMoi.ToString("#,##0"));
            rpt.SetParameterValue("_SumCapLai", _SumCapLai.ToString("#,##0"));
            rpt.SetParameterValue("_SumTotal", _SumTotal.ToString("#,##0"));
            crytalThongKe.ReportSource  = rpt;
            crytalThongKe.ToolPanelView = ToolPanelViewType.None;
            _SumCapDoi = 0;
            _SumCapMoi = 0;
            _SumCapLai = 0;
            _SumTotal  = 0;
        }
Exemple #6
0
        private void loadDuration()
        {
            int LOP_ID = int.Parse(lookUpLop.GetColumnValue("LOP_ID").ToString());

            BAL.BO_LOP dao_lop      = new BO_LOP();
            DataRow    row          = dao_lop.getLOP_ByID(LOP_ID).Rows[0];// search by ID, so there is only one row
            DateTime   DateAllocate = Convert.ToDateTime(row["LOP_Ngay_KG"].ToString());
            DateTime   DateExpire   = Convert.ToDateTime(row["LOP_Ngay_KT"].ToString());

            txtDateAllocate.Text = DateAllocate.ToString("dd/MM/yyyy");
            txtDateExpire.Text   = DateExpire.ToString("dd/MM/yyyy");
        }
Exemple #7
0
        private void loadDurationNew()
        {
            int LOP_ID = int.Parse(lookLopNew.GetColumnValue("LOP_ID").ToString());

            BAL.BO_LOP dao_lop = new BO_LOP();
            DataRow    row     = dao_lop.getLOP_ByID(LOP_ID).Rows[0];// search by ID, so there is only one row

            txtNgayKg.Text      = Convert.ToDateTime(row["LOP_Ngay_KG"].ToString()).ToShortDateString();
            txtNgayKt.Text      = Convert.ToDateTime(row["LOP_Ngay_KT"].ToString()).ToShortDateString();
            txtNgayKg.BackColor = Color.White;
            txtNgayKt.BackColor = Color.White;
        }
Exemple #8
0
 private void DeleteLevel(int levelID)
 {
     boLop = new BO_LOP();
     try
     {
         boLop.DeleteLevel(LevelID);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Lỗi xóa cấp độ: " + ex.Message, "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #9
0
 private bool saveLevel(int LevelID, int LopID, int LevelNumber)
 {
     boLop = new BO_LOP();
     try
     {
         boLop.SaveLevel(LevelID, LopID, LevelNumber, -1);
         return(true);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Có lỗi khi lưu cấp độ: " + ex.Message, "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(false);
     }
 }
Exemple #10
0
 private bool DeletedLop(DataRow selectedRow, int lopId)
 {
     boLop = new BO_LOP();
     try
     {
         selectedRow.Delete();
         boLop.delete(lopId);
         return(true);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Lỗi khi xóa lớp học: " + ex.Message, "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(false);
     }
 }
Exemple #11
0
        private void vLoadLopHoc()
        {
            boLop = new BO_LOP();
            DataTable vtb = new System.Data.DataTable();

            vtb = boLop.getLOP_ByCcID(gChungChiID);
            if (vtb.Rows.Count > 0)
            {
                lookUpLop.Properties.DataSource    = vtb.DefaultView;
                lookUpLop.Properties.ValueMember   = "LOP_ID";
                lookUpLop.Properties.DisplayMember = "LOP_Name";
            }
            else
            {
                MessageBox.Show("Không tìm thấy lớp học", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
        }
Exemple #12
0
        private void loadLevelByLopID(int iLop)
        {
            boLop = new BO_LOP();
            DataTable tbl = new DataTable();

            try
            {
                tbl = boLop.LoadLevelByLopID(iLop);
                if (tbl.Rows.Count > 0)
                {
                    LevelID             = int.Parse(tbl.Rows[0]["LEV_ID"].ToString());
                    lookLevel.EditValue = tbl.Rows[0]["LEV_Number"];
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Lỗi hiển thị cấp độ: " + ex.Message, "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
Exemple #13
0
        private void initThongKeDangKiHoc()
        {
            vDsThongKeLopHoc _dsThongKeLopHoc = new vDsThongKeLopHoc();
            int       totalChungchi           = 0;
            int       numLop          = 0;
            int       numHocvien      = 0;
            int       numHocChuaCapCc = 0;
            int       index           = 1;
            int       CHC_ID          = 0;
            string    CHC_Name        = string.Empty;
            int       totalLop        = 0;
            int       LOP_ID          = 0;
            string    LOP_Name        = string.Empty;
            DataTable tableHocvien    = new DataTable();;

            lop = new BO_LOP();
            int       _SoHvChuaCapCC = 0;
            int       _SoHvDaCapCc   = 0;
            DataTable TableChungChi  = new DataTable();
            DataTable tableLop       = new DataTable();
            string    _NhomCc        = string.Empty;
            int       _nhomCcID      = 0;

            for (int iLoaiCc = 1; iLoaiCc < tblLoaiChungChi().Rows.Count + 1; iLoaiCc++)
            {
                _NhomCc        = tblLoaiChungChi().Rows[iLoaiCc - 1]["LOA_Name"].ToString();
                _nhomCcID      = int.Parse(tblLoaiChungChi().Rows[iLoaiCc - 1]["LOA_ID"].ToString());
                TableChungChi  = lop.getChungChiThongKe(dateFrom.DateTime, dateEnd.DateTime, _nhomCcID);
                totalChungchi += TableChungChi.Rows.Count;

                for (int iChcID = 0; iChcID < TableChungChi.Rows.Count; iChcID++)
                {
                    CHC_Name  = TableChungChi.Rows[iChcID]["CHC_Name"].ToString();
                    CHC_ID    = int.Parse(TableChungChi.Rows[iChcID]["CHC_ID"].ToString());
                    tableLop  = lop.getLopThongKe(CHC_ID, dateFrom.DateTime, dateEnd.DateTime);
                    totalLop += tableLop.Rows.Count;
                    numLop   += totalLop;
                    for (int iLopID = 0; iLopID < tableLop.Rows.Count; iLopID++)
                    {
                        LOP_ID = int.Parse(tableLop.Rows[iLopID]["LOP_ID"].ToString());
                        //LOP_Name = tableLop.Rows[iLopID]["LOP_ShortName"].ToString();
                        tableHocvien = lop.getHocVienThongKe(LOP_ID);
                        numHocvien  += tableHocvien.Rows.Count;
                        for (int i = 0; i < tableHocvien.Rows.Count; i++)
                        {
                            if (tableHocvien.Rows[i]["CCC_SoCc"].ToString() == string.Empty)
                            {
                                _SoHvChuaCapCC++;
                            }
                            else
                            {
                                _SoHvDaCapCc++;
                            }
                        }

                        DataRow row = _dsThongKeLopHoc.tblThongKeLopHoc.NewRow();
                        row["STT"]                 = (index).ToString();
                        row["CHC_Name"]            = CHC_Name;
                        row["TotalLop"]            = totalLop;
                        row["LopName"]             = LOP_Name;
                        row["TotalHocvien"]        = tableHocvien.Rows.Count;
                        row["TotalHocVienDaCapCc"] = _SoHvDaCapCc;
                        row["NhomChungChi"]        = _NhomCc;
                        _dsThongKeLopHoc.tblThongKeLopHoc.Rows.Add(row);
                        index++;
                        numHocChuaCapCc += _SoHvDaCapCc;
                        _SoHvChuaCapCC   = 0;
                        _SoHvDaCapCc     = 0;
                        totalLop         = 0;
                    }
                }
            }

            rptStatistics rpt = new rptStatistics();

            rpt.SetDataSource(_dsThongKeLopHoc);
            rpt.SetParameterValue("totalChungChi", totalChungchi.ToString("#,##0"));
            rpt.SetParameterValue("numHocChuaCapCc", numHocChuaCapCc.ToString("#,##0"));
            rpt.SetParameterValue("totalLop", numLop.ToString("#,##0"));
            rpt.SetParameterValue("totalHocvien", numHocvien.ToString("#,##0"));
            rpt.SetParameterValue("fromDate", dateFrom.Text);
            rpt.SetParameterValue("endDate", dateEnd.Text);
            crytalThongKe.ReportSource  = rpt;
            crytalThongKe.ToolPanelView = ToolPanelViewType.None;
        }
Exemple #14
0
 private DataTable getLopHoc(int lookCcID_selected_index)
 {
     BAL.BO_LOP bal = new BO_LOP();
     return(bal.getLOP_ByCcID(lookCcID_selected_index));
 }
Exemple #15
0
 private DataTable getLopHoc()
 {
     BAL.BO_LOP bal = new BO_LOP();
     //return bal.getLop_Alls();
     return(bal.getLOP_ByCcID(int.Parse(lookChungChi.GetColumnValue("CHC_ID").ToString())));
 }
Exemple #16
0
 private DataTable getLopHoc()
 {
     BAL.BO_LOP bal = new BO_LOP();
     return(bal.getLop_Alls());
 }