コード例 #1
0
    private void EstDeptStgDataBinding(int ver_id, int estterm_ref_id, int est_dept_ref_id)
    {
        Biz_PDTAndAHPStgEstDeptDatas pdtAhpEstDept = new Biz_PDTAndAHPStgEstDeptDatas();
        DataSet ds = pdtAhpEstDept.GetPDTAndAHPEstDeptStgList(ver_id
                                                              , estterm_ref_id
                                                              , est_dept_ref_id
                                                              , "Y");

        DataGrid2.DataSource = ds;
        DataGrid2.DataBind();

        lblStgCount.Text = ds.Tables[0].Rows.Count.ToString();

        if (ds.Tables[0].Rows.Count <= 1)
        {
            DataGrid1.Visible = false;
            DataGrid3.Visible = false;
            iBtnSave.Visible  = false;
        }
        else
        {
            DataGrid1.Visible = true;
            DataGrid3.Visible = true;
            iBtnSave.Visible  = true;
        }
    }
コード例 #2
0
    private void DeployGridDataBinding(int ver_id
                                       , int estterm_ref_id
                                       , int est_dept_ref_id
                                       , bool isSubDept)
    {
        Biz_PDTAndAHPStgEstDeptDatas pDTAndAHPStgEstDeptDatas = new Biz_PDTAndAHPStgEstDeptDatas();
        DataSet ds = pDTAndAHPStgEstDeptDatas.GetPDTAndAHPDeployList(ver_id
                                                                     , estterm_ref_id
                                                                     , est_dept_ref_id
                                                                     , 0
                                                                     , isSubDept);

        DataGrid1.DataSource = ds;
        DataGrid1.DataBind();
    }
コード例 #3
0
    protected void iBtnDeploy_Click(object sender, ImageClickEventArgs e)
    {
        Biz_PDTAndAHPStgEstDeptDatas pDTAndAHPStgEstDeptDatas = new Biz_PDTAndAHPStgEstDeptDatas();

        DataTable stgdData = new DataTable();
        DataRow   dr       = null;

        //stgdData.Columns.Add("STG_REF_ID"   , typeof(int));

        //foreach (DataGridItem item in DataGrid1.Items)
        //{
        //    dr                  = stgdData.NewRow();
        //    dr["STG_REF_ID"]    = (item.Cells[0].FindControl("lblStgRefID") as Label).Text;
        //    stgdData.Rows.Add(dr);
        //}
    }
コード例 #4
0
    private void AHPDataBinding(int ver_id, int estterm_ref_id, int est_dept_ref_id)
    {
        Biz_PDTAndAHPStgEstDeptDatas pdtAhpStgEstDept = new Biz_PDTAndAHPStgEstDeptDatas();

        DataGrid1.DataSource = pdtAhpStgEstDept.GetAHPEstDeptStgList(ver_id
                                                                     , estterm_ref_id
                                                                     , est_dept_ref_id);
        DataGrid1.DataBind();

        DataTable dt = GetAHPPointDataTable();

        if (dt != null)
        {
            DataGrid3.DataSource = dt;
            DataGrid3.DataBind();

            DataGrid3.Visible = true;

            GraphAvailablePointBinding(dt);

            pdtAhpStgEstDept.ModifyPDTAndAHPWeight(VER_ID
                                                   , ESTTERM_REF_ID
                                                   , int.Parse(txtDeptID.Text)
                                                   , EMP_REF_ID
                                                   , dt);
        }
        else
        {
            lblCI.Text = "0";
            lblCR.Text = "0";

            lblMsg.Text = "";

            //DataGrid3.Visible   = false;

            //GraphNullPointBinding();
        }
    }
コード例 #5
0
    private DataTable GetAHPPointDataTable()
    {
        int est_dept_ref_id = int.Parse(txtDeptID.Text);

        Biz_AHPEstDeptStgDatas       ahpEstDept    = new Biz_AHPEstDeptStgDatas();
        Biz_PDTAndAHPStgEstDeptDatas pdtAhpEstDept = new Biz_PDTAndAHPStgEstDeptDatas();
        DataSet ds = pdtAhpEstDept.GetPDTAndAHPEstDeptStgList(VER_ID
                                                              , ESTTERM_REF_ID
                                                              , est_dept_ref_id
                                                              , "Y");

        int stg_count = ds.Tables[0].Rows.Count;

        if (stg_count == 0 || stg_count == 1)
        {
            return(null);
        }

        DataTable dataTable = new DataTable();
        DataRow   dr        = null;

        dataTable.Columns.Add("VER_ID", typeof(int));
        dataTable.Columns.Add("ESTTERM_REF_ID", typeof(int));
        dataTable.Columns.Add("EST_DEPT_REF_ID", typeof(int));
        dataTable.Columns.Add("STG_REF_ID", typeof(int));
        dataTable.Columns.Add("STG_NAME", typeof(string));
        dataTable.Columns.Add("MULTIPLY", typeof(float));
        dataTable.Columns.Add("GEOMEAN", typeof(double));
        dataTable.Columns.Add("WEIGHT", typeof(float));
        dataTable.Columns.Add("SUM", typeof(float));
        dataTable.Columns.Add("WS", typeof(double));
        dataTable.Columns.Add("CI", typeof(float));
        dataTable.Columns.Add("CR", typeof(float));

        double total_geomean = 0;

        foreach (DataRow dataRow in ds.Tables[0].Rows)
        {
            double multi_point = ahpEstDept.GetAHPEstDeptStgMultiPlyPoint(VER_ID
                                                                          , ESTTERM_REF_ID
                                                                          , est_dept_ref_id
                                                                          , int.Parse(dataRow["STG_REF_ID"].ToString()));

            double sum_point = ahpEstDept.GetAHPEstDeptStgSumPoint(VER_ID
                                                                   , ESTTERM_REF_ID
                                                                   , est_dept_ref_id
                                                                   , int.Parse(dataRow["STG_REF_ID"].ToString()));

            if (multi_point == 0)
            {
                return(null);
            }

            dr = dataTable.NewRow();

            dr["VER_ID"]          = VER_ID;
            dr["ESTTERM_REF_ID"]  = ESTTERM_REF_ID;
            dr["EST_DEPT_REF_ID"] = est_dept_ref_id;
            dr["STG_REF_ID"]      = dataRow["STG_REF_ID"];
            dr["STG_NAME"]        = dataRow["STG_NAME"];
            dr["MULTIPLY"]        = multi_point;
            dr["GEOMEAN"]         = Math.Pow((double)multi_point, (double)1 / (double)stg_count);

            total_geomean += Convert.ToDouble(dr["GEOMEAN"]);

            dr["WEIGHT"] = 0;
            dr["SUM"]    = sum_point;
            dr["WS"]     = 0;
            dr["CI"]     = 0;
            dr["CR"]     = 0;
            dataTable.Rows.Add(dr);
        }

        double lambda_max = 0;
        double c_i        = 0;
        double rci        = 0;
        double ratio      = 0;

        float[] rciArr = new float[10];

        for (int i = 0; i < dataTable.Rows.Count; i++)
        {
            DataRow drRow = dataTable.Rows[i];

            drRow["WEIGHT"] = (double)drRow["GEOMEAN"] / total_geomean;
            drRow["WS"]     = double.Parse(drRow["WEIGHT"].ToString()) * double.Parse(drRow["SUM"].ToString());
            drRow["WEIGHT"] = Math.Round(double.Parse(drRow["WEIGHT"].ToString()) * 100.00, 2);

            lambda_max += double.Parse(drRow["WS"].ToString());
        }

        rciArr[0] = 0;
        rciArr[1] = 0;
        rciArr[2] = 0.58f;
        rciArr[3] = 0.9f;
        rciArr[4] = 1.12f;
        rciArr[5] = 1.24f;
        rciArr[6] = 1.32f;
        rciArr[7] = 1.41f;
        rciArr[8] = 1.45f;
        rciArr[9] = 1.49f;

        c_i   = (lambda_max - stg_count) / (stg_count - 1);
        rci   = rciArr[stg_count - 1];
        ratio = c_i / rci;

        for (int i = 0; i < dataTable.Rows.Count; i++)
        {
            DataRow drRow = dataTable.Rows[i];

            drRow["CI"] = c_i;
            drRow["CR"] = ratio;
        }

        if (Math.Round(c_i * 100.00, 2) > 10)
        {
            lblMsg.ForeColor = Color.Red;
            lblCI.ForeColor  = Color.Red;
            lblCR.ForeColor  = Color.Red;
            lblMsg.Text      = "귀하의 선택은 논리적 문제가 있으니<br>재 점검 바랍니다.";
        }
        else
        {
            lblMsg.ForeColor = Color.Blue;
            lblCI.ForeColor  = Color.Blue;
            lblCR.ForeColor  = Color.Blue;
            lblMsg.Text      = "귀하의 선택은 논리적 일관성이 있습니다.";
        }

        lblCI.Text = Convert.ToString(Math.Round(c_i * 100.00, 2)) + "%";
        lblCR.Text = Convert.ToString(Math.Round(ratio * 100.00, 2)) + "%";

        return(dataTable);
    }
コード例 #6
0
    private void SavePDTData()
    {
        Biz_PDTAndAHPStgEstDeptDatas pDTAndAHPStgEstDeptDatas = new Biz_PDTAndAHPStgEstDeptDatas();

        DataTable stgdData = new DataTable();
        DataRow   dr       = null;

        stgdData.Columns.Add("STG_REF_ID", typeof(int));
        stgdData.Columns.Add("UP_STG_ID", typeof(int));
        stgdData.Columns.Add("STG_MAP_YN", typeof(string));
        stgdData.Columns.Add("F_YN", typeof(string));
        stgdData.Columns.Add("C_YN", typeof(string));
        stgdData.Columns.Add("P_YN", typeof(string));
        stgdData.Columns.Add("L_YN", typeof(string));

        /* 2011-08-29 수정 : Grid에서 UltraWebGrid로 변경에 따른 수정 필요
         * foreach (DataGridItem item in DataGrid1.Items)
         * {
         *  dr                  = stgdData.NewRow();
         *  dr["STG_REF_ID"]    = (item.Cells[0].FindControl("lblStgRefID") as Label).Text;
         *  dr["UP_STG_ID"]     = 0;
         *  dr["STG_MAP_YN"]    = ((item.Cells[1].FindControl("cBoxStgMap") as CheckBox).Checked) ? "Y":"N";
         *  dr["F_YN"]          = ((item.Cells[2].FindControl("cBoxF") as CheckBox).Checked)? "Y":"N";
         *  dr["C_YN"]          = ((item.Cells[2].FindControl("cBoxC") as CheckBox).Checked)? "Y":"N";
         *  dr["P_YN"]          = ((item.Cells[2].FindControl("cBoxP") as CheckBox).Checked)? "Y":"N";
         *  dr["L_YN"]          = ((item.Cells[2].FindControl("cBoxL") as CheckBox).Checked)? "Y":"N";
         *  stgdData.Rows.Add(dr);
         * }
         */

        DataTable estDeptData = new DataTable();

        estDeptData.Columns.Add("EST_DEPT_REF_ID", typeof(int));
        estDeptData.Columns.Add("STG_REF_ID", typeof(int));
        estDeptData.Columns.Add("CHECK_YN", typeof(string));

        DeptInfos deptInfo = new DeptInfos();

        if (txtDeptID.Text != "")
        {
            DataSet ds = deptInfo.GetEstDeptListByLevel(int.Parse(txtDeptID.Text));

            foreach (DataRow deptRow in ds.Tables[0].Rows)
            {
                /* 2011-08-29 수정 : Grid에서 UltraWebGrid로 변경에 따른 수정 필요
                 * foreach (DataGridItem item in DataGrid1.Items)
                 * {
                 *  CheckBox cBox_YN = item.FindControl("C_" + deptRow["EST_DEPT_REF_ID"].ToString()) as CheckBox;
                 *
                 *  if (cBox_YN != null)
                 *  {
                 *      dr                      = estDeptData.NewRow();
                 *      dr["EST_DEPT_REF_ID"]   = deptRow["EST_DEPT_REF_ID"].ToString();
                 *      dr["STG_REF_ID"]        = (item.Cells[0].FindControl("lblStgRefID") as Label).Text;
                 *      dr["CHECK_YN"]          = (cBox_YN.Checked) ? "Y" : "N";
                 *      dr["CHECK_YN"]          = (!cBox_YN.Visible) ? "N" : dr["CHECK_YN"].ToString();
                 *      estDeptData.Rows.Add(dr);
                 *  }
                 * }
                 */
            }
        }
        else
        {
        }

        bool isOK = pDTAndAHPStgEstDeptDatas.AddPDTAndAHPStgEstDeptDatas(PageUtility.GetIntByValueDropDownList(ddlStgVersion)
                                                                         , PageUtility.GetIntByValueDropDownList(ddlEstTermInfo)
                                                                         , stgdData
                                                                         , estDeptData
                                                                         , int.Parse(DeptID)
                                                                         , EMP_REF_ID);



        if (isOK)
        {
            ltrScript.Text = JSHelper.GetAlertScript("정상적으로 등록되었습니다.", false);
        }
        else
        {
            ltrScript.Text = JSHelper.GetAlertScript("처리 중 오류가 발생하였습니다.", false);
        }
    }
コード例 #7
0
    private void StgVerDataBinding(int estterm_ref_id, int ver_id)
    {
        if (DeptID == "0" || DeptID == "")
        {
            return;
        }

        Biz_PDTAndAHPStgInfos stgInfo = new Biz_PDTAndAHPStgInfos();
        DataSet ds = stgInfo.GetPDTAndAHPStgInfo(ver_id, estterm_ref_id, 0);

        Biz_PDTAndAHPStgEstDeptDatas pdtAhpStgEst = new Biz_PDTAndAHPStgEstDeptDatas();

        dsDeptData = pdtAhpStgEst.GetPDTAndAHPStgEstDeptData(ver_id, estterm_ref_id, int.Parse(DeptID), 0);

        DataRow dr = null;

        if (ds.Tables[0].Rows.Count == 0)
        {
            return;
        }

        DataTable stgVerData = new DataTable();

        stgVerData.Columns.Add("STG_REF_ID", typeof(int));
        stgVerData.Columns.Add("UP_STG_ID", typeof(int));
        stgVerData.Columns.Add("STG_NAME", typeof(string));
        stgVerData.Columns.Add("LEVEL", typeof(int));
        stgVerData.Columns.Add("STG_MAP_YN", typeof(string));
        stgVerData.Columns.Add("F_YN", typeof(string));
        stgVerData.Columns.Add("C_YN", typeof(string));
        stgVerData.Columns.Add("P_YN", typeof(string));
        stgVerData.Columns.Add("L_YN", typeof(string));

        ds.Relations.Add("NodeRelation", ds.Tables[0].Columns["STG_REF_ID"], ds.Tables[0].Columns["UP_STG_ID"], false);

        int level = 0;

        foreach (DataRow dbRow in ds.Tables[0].Rows)
        {
            if (Convert.ToInt32(dbRow["UP_STG_ID"]) == 0)
            {
                dr = stgVerData.NewRow();
                dr["STG_REF_ID"] = int.Parse(dbRow["STG_REF_ID"].ToString());
                dr["UP_STG_ID"]  = int.Parse(dbRow["UP_STG_ID"].ToString());
                dr["STG_NAME"]   = dbRow["STG_NAME"].ToString();
                dr["LEVEL"]      = level;
                dr["STG_MAP_YN"] = dbRow["STG_MAP_YN"].ToString();
                dr["F_YN"]       = dbRow["F_YN"].ToString();
                dr["C_YN"]       = dbRow["C_YN"].ToString();
                dr["P_YN"]       = dbRow["P_YN"].ToString();
                dr["L_YN"]       = dbRow["L_YN"].ToString();
                stgVerData.Rows.Add(dr);

                PopulateSubTree(dbRow, ref stgVerData, level);
            }
        }

        DataGrid1.DataSource = stgVerData;
        DataGrid1.DataBind();

        if (stgVerData.Rows.Count > 0)
        {
            iBtnSave.Visible = true;
        }
    }