Ejemplo n.º 1
0
        private DataSet vDsThongKeCapGCN()
        {
            boCapChungChi     = new BO_CAP_CHUNGCHI();
            tbl               = new DataTable();
            _vDsThongKeCapGCN = new BcChungChi();
            object vDateCapChungChi;

            if (lookKhoaHoc_InGCN.ItemIndex > -1 && lookKhoaHoc_InGCN.Enabled == true)
            {
                vChcID = int.Parse(lookKhoaHoc_InGCN.GetColumnValue("CHC_ID").ToString());
                tbl    = boCapChungChi.vLoadDataCapChungChiByCHCID(vChcID, dateFrom.DateTime, dateEnd.DateTime);
            }
            else
            {
                tbl = boCapChungChi.vLoadDataCapChungChiByDate(dateFrom.DateTime, dateEnd.DateTime);
            }

            if (tbl.Rows.Count > 0)
            {
                for (int i = 0; i < tbl.Rows.Count; i++)
                {
                    vRow                  = _vDsThongKeCapGCN.TkCapGCN.NewRow();
                    vRow["STT"]           = i + 1;
                    vRow["CHC_Name"]      = tbl.Rows[i]["CHC_Name"];
                    vRow["HOV_FirstName"] = tbl.Rows[i]["HOV_FullName"];
                    vRow["HOV_LastName"]  = tbl.Rows[i]["HOV_LastName"];
                    vRow["HOV_BirthDay"]  = tbl.Rows[i]["HOV_BirthDay"];
                    vRow["TIN_Name"]      = tbl.Rows[i]["TIN_Name"];
                    vRow["CCC_SoCC"]      = tbl.Rows[i]["CCC_SoCC"];
                    vRow["IMG_Image"]     = tbl.Rows[i]["IMG_Image"];
                    if (int.Parse(tbl.Rows[i]["CCC_LOPID"].ToString()) > -1)
                    {
                        vRow["LOP_ShortName"] = tbl.Rows[i]["LOP_ShortName"];
                    }
                    else
                    {
                        vRow["LOP_ShortName"] = tbl.Rows[i]["CCC_SoHieuDoi"];
                    }
                    if (int.Parse(tbl.Rows[i]["CCC_Status"].ToString()) == 1)
                    {
                        vRow["CCC_StatusCap"] = "Cấp mới";
                    }
                    else if (int.Parse(tbl.Rows[i]["CCC_Status"].ToString()) == 2)
                    {
                        vRow["CCC_StatusCap"] = "Cấp lại";
                    }
                    else
                    {
                        vRow["CCC_StatusCap"] = "Cấp đổi";
                    }
                    vDateCapChungChi    = DateTime.Parse(tbl.Rows[i]["CCC_NgayCap"].ToString());
                    vRow["CCC_NgayCap"] = string.Format("{0:dd/MM/yyyy}", vDateCapChungChi).ToString().Substring(0, 10);
                    vRow["fromDate"]    = dateFrom.DateTime.ToShortDateString();
                    vRow["toDate"]      = dateEnd.DateTime.ToShortDateString();
                    _vDsThongKeCapGCN.TkCapGCN.Rows.Add(vRow);
                }
            }
            return(_vDsThongKeCapGCN);
        }
Ejemplo n.º 2
0
        private void initDataSetThongKeCapGCN(DataTable _tblChungChi, string _nhomCcName)
        {
            int _CcID        = 0;
            int _totalCapMoi = 0;
            int _totalCapLai = 0;
            int _totalCapDoi = 0;
            int _Summary     = 0;

            for (int idxCc = 0; idxCc < _tblChungChi.Rows.Count; idxCc++)
            {
                _CcID = int.Parse(_tblChungChi.Rows[idxCc]["CHC_ID"].ToString());
                tbl   = boCapChungChi.vLoadDataCapChungChiByCHCID(_CcID, dateFrom.DateTime, dateEnd.DateTime);
                if (tbl.Rows.Count > 0)
                {
                    for (int i = 0; i < tbl.Rows.Count; i++)
                    {
                        if (int.Parse(tbl.Rows[i]["CCC_Status"].ToString()) == 1)
                        {
                            //vRow["CCC_StatusCap"] = "Cấp mới";
                            _totalCapMoi++;
                        }
                        else if (int.Parse(tbl.Rows[i]["CCC_Status"].ToString()) == 2)
                        {
                            //vRow["CCC_StatusCap"] = "Cấp lại";
                            _totalCapLai++;
                        }
                        else
                        {
                            //vRow["CCC_StatusCap"] = "Cấp đổi";
                            _totalCapDoi++;
                        }
                        _Summary = _totalCapMoi + _totalCapLai + _totalCapDoi;
                    }
                    _SumCapMoi += _totalCapMoi;
                    _SumCapLai += _totalCapLai;
                    _SumCapDoi += _totalCapDoi;
                    _SumTotal  += _Summary;
                }
                vRow = _vDsThongKeCapGCN.ThongKeCapChungChi.NewRow();

                vRow["CHC_Name"]     = _tblChungChi.Rows[idxCc]["CHC_Name"];
                vRow["NhomChungChi"] = _nhomCcName;
                vRow["CCC_CapMoi"]   = _totalCapMoi;
                vRow["CCC_CapLai"]   = _totalCapLai;
                vRow["CCC_CapDoi"]   = _totalCapDoi;
                vRow["Summary"]      = _Summary;
                _vDsThongKeCapGCN.ThongKeCapChungChi.Rows.Add(vRow);
                _Summary     = 0;
                _totalCapDoi = 0;
                _totalCapLai = 0;
                _totalCapMoi = 0;
            }
        }