Exemple #1
0
    private void GridDataBinding()
    {
        string query = @"
                SELECT ISNULL(CE.EMP_REF_ID,0) as EMP_REF_ID,
				       RTRIM(ISNULL(DE.DEPT_NAME,'')) as DEPT_NAME,
	                   ISNULL(CE.EMP_NAME,'') as EMP_NAME,
					   MAX(ISNULL(CE.EMP_EMAIL,'')) as EMP_EMAIL
                  FROM KPI_INFO KI, 
                       COM_EMP_INFO CE, 
	                   COM_DEPT_INFO DE, 
	                   REL_DEPT_EMP RD,
					   KPI_RESULT KR,
	                  (SELECT "     + hdnMM.Value + @" as TMCODE,  MON_" + hdnMM.Value + @"_FLAG as  CHECK_YN, KPI_REF_ID FROM KPI_TERM WHERE KPI_TERM_TYPE = 0) TM
                 WHERE KI.KPI_REF_ID *= KR.KPI_REF_ID
				   AND KI.KPI_REF_ID *= TM.KPI_REF_ID
                   AND KI.CHAMPION_EMP_ID *= CE.EMP_REF_ID
                   AND RD.EMP_REF_ID = CE.EMP_REF_ID
                   AND RD.DEPT_REF_ID = DE.DEPT_REF_ID
				   AND TM.CHECK_YN = 1
				   AND KR.CHECKSTATUS IN ("                 + ddlApplyYN.SelectedValue + @")
				   AND KR.TMCODE = "                 + hdnMM.Value + @"
				 GROUP BY DE.DEPT_REF_ID,DE.DEPT_NAME,CE.EMP_REF_ID, CE.EMP_NAME

        ";

        MicroBSC.Data.DBAgent gDbAgent = new MicroBSC.Data.DBAgent(System.Configuration.ConfigurationManager.ConnectionStrings["MainDB"].ConnectionString);
        DataSet  ds  = gDbAgent.FillDataSet(query, "data");
        EmpInfos emp = new EmpInfos();

        UltraWebGrid1.DataSource = ds.Tables[0].DefaultView;
        UltraWebGrid1.DataBind();
    }
Exemple #2
0
    protected static DataSet GetDataSet(string query)
    {
        MicroBSC.Data.DBAgent dbAgent = new MicroBSC.Data.DBAgent(System.Configuration.ConfigurationManager.ConnectionStrings["MainDB"].ConnectionString);
        DataSet ds = dbAgent.FillDataSet(query, "Data");

        return(ds);
    }
Exemple #3
0
    private void setFormData()
    {
        int    intKpi_Ref_ID = int.Parse(hdnKpiRefID.Value.ToString());
        string strSQL        = @"
                SELECT KI.KPI_NAME,
                       KL.QRY_DATA,
	                   KL.QRY_MS,
	                   KL.QRY_TS,
                       KI.KPI_REF_ID
                  FROM KPI_INFO KI, KPI_LOW KL
                 WHERE KI.KPI_REF_ID = KL.KPI_REF_ID
                   AND KI.KPI_REF_ID = " + intKpi_Ref_ID + @"
        ";

        MicroBSC.Data.DBAgent gDbAgent = new MicroBSC.Data.DBAgent(System.Configuration.ConfigurationManager.ConnectionStrings["MainDB"].ConnectionString);
        DataSet dsClose = gDbAgent.FillDataSet(strSQL, "tblClose");

        if (dsClose.Tables[0].Rows.Count > 0)
        {
            txtKPIName.Text  = dsClose.Tables[0].Rows[0]["KPI_NAME"].ToString();
            txtQRY_DATA.Text = dsClose.Tables[0].Rows[0]["QRY_DATA"].ToString();
            txtQRY_MS.Text   = dsClose.Tables[0].Rows[0]["QRY_MS"].ToString();
            txtQRY_TS.Text   = dsClose.Tables[0].Rows[0]["QRY_TS"].ToString();
        }
        else
        {
            txtKPIName.Text  = "";
            txtQRY_DATA.Text = "";
            txtQRY_MS.Text   = "";
            txtQRY_TS.Text   = "";
        }
    }
Exemple #4
0
    private void setGridClose()
    {
        string strSQL = @"
                SELECT KI.KPI_CODE as KPI_CODE, 
                       KI.KPI_NAME as KPI_NAME,
	                   CD.DEPT_NAME as DEPT_NAME, 
	                   CE.EMP_NAME as EMP_NAME,
	                   KR.RESULT   as MS_RESULT,
	                   KR.COLRESULT as TS_RESULT,
	                   KR.CAL_MS_RESULT as CAL_MS_RESUTL, 
	                   KR.CAL_TS_RESULT as CAL_TS_RESULT,
	                   KR.CAL_MODIFY_REASON as MREASON
                  FROM KPI_INFO KI,
                       KPI_RESULT KR,
	                   COM_EMP_INFO CE,
	                   COM_DEPT_INFO CD,
	                   REL_DEPT_EMP RD
                 WHERE KI.KPI_REF_ID = KR.KPI_REF_ID
                   AND KI.CHAMPION_EMP_ID = CE.EMP_REF_ID
                   AND RD.DEPT_REF_ID = CD.DEPT_REF_ID
                   AND RD.EMP_REF_ID = CE.EMP_REF_ID
                   AND KR.TMCODE = " + ddlMonthInfo.SelectedValue.ToString() + @"
                   AND KR.CAL_APPLY_YN = 0            --RESULT NOT APPLY
                   AND KI.RESULT_INPUT_METHOD = 'SYS' --SYSTEM
                   AND KR.CONFIRMSTATUS = 1           --CONFIRM
                   AND KI.ESTTERM_REF_ID = " + ddlEstTermInfo.SelectedValue.ToString() + @"
        ";

        MicroBSC.Data.DBAgent gDbAgent = new MicroBSC.Data.DBAgent(System.Configuration.ConfigurationManager.ConnectionStrings["MainDB"].ConnectionString);
        DataSet dsClose = gDbAgent.FillDataSet(strSQL, "tblClose");

        ugrdClose.DataSource = dsClose;
        ugrdClose.DataBind();
    }
Exemple #5
0
    private void setGridClose()
    {
        string strSQL = @"
                SELECT KPI_REF_ID,
                       KPI_CODE,
	                   KPI_NAME
                  FROM KPI_INFO
                 WHERE KPI_CODE LIKE ('" + txtSKpiCode.Text + @"'+'%')
                   AND KPI_NAME LIKE ('" + txtSKpiName.Text + @"'+'%')
                   AND RESULT_INPUT_METHOD = 'SYS'
                 ORDER BY KPI_NAME
        ";

        MicroBSC.Data.DBAgent gDbAgent = new MicroBSC.Data.DBAgent(System.Configuration.ConfigurationManager.ConnectionStrings["MainDB"].ConnectionString);
        DataSet dsClose = gDbAgent.FillDataSet(strSQL, "tblClose");

        ugrdClose.DataSource = dsClose;
        ugrdClose.DataBind();
    }