Example #1
0
    private void setGridClose()
    {
        MicroBSC.BSC.Biz.Biz_Bsc_Term_Detail objBSC = new MicroBSC.BSC.Biz.Biz_Bsc_Term_Detail();
        DataSet dsClose = objBSC.GetAllList(PageUtility.GetIntByValueDropDownList(ddlEstTermInfo));

        ugrdClose.Clear();
        ugrdClose.DataSource = dsClose;
        ugrdClose.DataBind();
    }
Example #2
0
    private void SetBscTermDetail()
    {
        MicroBSC.BSC.Biz.Biz_Bsc_Term_Detail objBSC = new MicroBSC.BSC.Biz.Biz_Bsc_Term_Detail();
        DataSet rDs = objBSC.GetAllList(this.IEstTermRefID);

        ugrdClose.Clear();
        ugrdClose.DataSource = rDs;
        ugrdClose.DataBind();
    }
Example #3
0
    private void SetScoreGrid()
    {
        MicroBSC.BSC.Biz.Biz_Bsc_Term_Detail objTerm = new MicroBSC.BSC.Biz.Biz_Bsc_Term_Detail();
        DataSet rDs = objTerm.GetAllList(PageUtility.GetIntByValueDropDownList(ddlEstTermInfo));

        DataSet dsTScore = new DataSet();

        dsTScore.Tables.Add("TSCORE");
        dsTScore.Tables.Add("TSCORE2");

        string strMM = "";

        this.IcntCol = rDs.Tables[0].Rows.Count;

        for (int i = 0; i < this.IcntCol; i++)
        {
            strMM = rDs.Tables[0].Rows[i]["YMD"].ToString();
            dsTScore.Tables[1].Columns.Add("TC_" + strMM + "_01", typeof(string));  // YMD
            dsTScore.Tables[1].Columns.Add("TC_" + strMM + "_02", typeof(string));  // EST_DEPT_REF_ID
            dsTScore.Tables[1].Columns.Add("TC_" + strMM + "_06", typeof(string));  // EST_YN

            dsTScore.Tables[0].Columns.Add("TC_" + strMM + "_03", typeof(string));  // RANK_ID
            dsTScore.Tables[0].Columns.Add("TC_" + strMM + "_04", typeof(string));  // DEPT_NAME
            dsTScore.Tables[0].Columns.Add("TC_" + strMM + "_05", typeof(string));  // SCORE
        }

        MicroBSC.BSC.Biz.Biz_Bsc_Score_Card objSC = new MicroBSC.BSC.Biz.Biz_Bsc_Score_Card();
        DataSet dsRtn = objSC.GetYearlyTotalScoreTrend(PageUtility.GetIntByValueDropDownList(ddlEstTermInfo)
                                                       , PageUtility.GetIntByValueDropDownList(ddlComTypeInfo)
                                                       , PageUtility.GetByValueDropDownList(ddlSumType)
                                                       , (hdfDeptID.Value == "") ? 0 : int.Parse(hdfDeptID.Value)
                                                       , (chkApplyExtScore.Checked) ? "Y" : "N"
                                                       , gUserInfo.Emp_Ref_ID);

        int    cntRow     = dsRtn.Tables[0].Rows.Count;       // 조회행수
        int    cntCol     = dsRtn.Tables[0].Columns.Count;    // 컬럼수
        int    intRowIdx  = 0;                                // DataSet Row Index
        int    intColIdx  = 0;                                // DataSet Col Index
        int    intRowNum  = 0;                                // Row Num
        string strPTmcode = "";                               // 이전행 월코드
        string strCTmcode = "";                               // 현재행 월코드
        string strNTmcode = "";                               // 다음행 월코드
        int    iGrpRow    = 0;
        int    iTotRow    = 0;

        try
        {
            DataRow drRow  = dsTScore.Tables[0].NewRow();
            DataRow drRow2 = dsTScore.Tables[1].NewRow();
            for (int i = 0; i < cntRow; i++)
            {
                strPTmcode = (i > 0) ? dsRtn.Tables[0].Rows[i - 1]["YMD"].ToString() : dsRtn.Tables[0].Rows[i]["YMD"].ToString();
                strCTmcode = dsRtn.Tables[0].Rows[i]["YMD"].ToString();
                strNTmcode = (i >= cntRow - 1) ? dsRtn.Tables[0].Rows[i]["YMD"].ToString() : dsRtn.Tables[0].Rows[i + 1]["YMD"].ToString();

                if (strPTmcode != strCTmcode)
                {
                    iGrpRow = 1;
                }
                else
                {
                    iGrpRow += 1;
                }

                for (int j = 0; j < cntCol; j++)
                {
                    //if (intRowIdx == 0)
                    if (iGrpRow > iTotRow)
                    {
                        if (j == 0 || j == 1 || j == 5)
                        {
                            drRow2[intColIdx + (j == 5 ? 2 : j)] = dsRtn.Tables[0].Rows[i][j];
                        }
                        else
                        {
                            drRow[intColIdx + j - 2] = dsRtn.Tables[0].Rows[i][j];
                        }
                    }
                    else
                    {
                        if (j == 0 || j == 1 || j == 5)
                        {
                            dsTScore.Tables[1].Rows[intRowNum][intColIdx + (j == 5 ? 2 : j)] = dsRtn.Tables[0].Rows[i][j];
                        }
                        else
                        {
                            dsTScore.Tables[0].Rows[intRowNum][intColIdx + j - 2] = dsRtn.Tables[0].Rows[i][j];
                        }
                    }
                }

                //if (intRowIdx == 0)
                if (iGrpRow > iTotRow)
                {
                    dsTScore.Tables[0].Rows.Add(drRow);
                    dsTScore.Tables[1].Rows.Add(drRow2);
                    drRow    = dsTScore.Tables[0].NewRow();
                    drRow2   = dsTScore.Tables[1].NewRow();
                    iTotRow += 1;
                }

                if (strCTmcode != strNTmcode)
                {
                    intRowIdx += 1;
                    intColIdx += 3;
                    intRowNum  = 0;
                }
                else
                {
                    intRowNum += 1;
                }
            }
        }
        catch (Exception e)
        {
            ltrScript.Text = JSHelper.GetAlertScript(e.Message, false);
        }

        ugrdMScore2.DataSource = dsTScore.Tables[1];
        ugrdMScore2.DataBind();

        ugrdMScore.DataSource = dsTScore.Tables[0];
        ugrdMScore.DataBind();

        //if (ugrdMScore.Rows.Count > 0)
        //{
        //    ugrdMScore.Visible = true;
        //    imgNoData.Visible  = false;
        //}
        //else
        //{
        //    ugrdMScore.Visible = false;
        //    imgNoData.Visible  = true;
        //}
    }