示例#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);
        }