Exemple #1
0
    public void SetWeight()
    {
        int itxr_user = gUserInfo.Emp_Ref_ID;

        UltraGridRow row;

        Biz_Bsc_Mbo_Kpi_Weight objBSC = new Biz_Bsc_Mbo_Kpi_Weight();

        DataTable dt = new DataTable();

        dt.Columns.Add("ESTTERM_REF_ID", typeof(int));
        dt.Columns.Add("KPI_REF_ID", typeof(int));
        dt.Columns.Add("WEIGHT", typeof(decimal));
        dt.Columns.Add("KPI_CLASS_REF_ID", typeof(string));

        for (int i = 0; i < ugrdMBO.Rows.Count; i++)
        {
            row = ugrdMBO.Rows[i];

            DataRow dr = dt.NewRow();
            dr["ESTTERM_REF_ID"] = DataTypeUtility.GetToInt32(row.Cells.FromKey("ESTTERM_REF_ID").Value);
            dr["KPI_REF_ID"]     = DataTypeUtility.GetToInt32(row.Cells.FromKey("KPI_REF_ID").Value);
            dr["WEIGHT"]         = DataTypeUtility.GetToDouble(row.Cells.FromKey("WEIGHT").Value);

            try
            {
                dr["KPI_CLASS_REF_ID"] = (row.Cells.FromKey("IS_TEAM_KPI").Value.ToString() == "Y" ? "SCO" : "PCO");
            }
            catch { }
            dt.Rows.Add(dr);
        }

        if (objBSC.UpdateMBOWeight(gUserInfo.Emp_Ref_ID, dt))
        {
            PageUtility.AlertMessage("처리하였습니다.");
        }
        else
        {
            PageUtility.AlertMessage("실패하였습니다.");
        }

        DoBinding();
    }
Exemple #2
0
    public void SetMBOKpi(string iType)
    {
        int             itxr_user = gUserInfo.Emp_Ref_ID;
        CheckBox        chk;
        UltraGridRow    row;
        TemplatedColumn col;
        UltraWebGrid    ugrdKpi = (iType == "ADD") ? ugrdKpiList : ugrdChildKpi;
        int             cntRow  = 0;

        Biz_Bsc_Mbo_Kpi_Weight objBSC = new Biz_Bsc_Mbo_Kpi_Weight();

        if (iType == "DEL")
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("ESTTERM_REF_ID", typeof(int));
            dt.Columns.Add("EMP_REF_ID", typeof(int));
            dt.Columns.Add("KPI_REF_ID", typeof(int));

            for (int i = 0; i < ugrdKpi.Rows.Count; i++)
            {
                row = ugrdKpi.Rows[i];
                col = (TemplatedColumn)row.Band.Columns.FromKey("selchk");
                chk = (CheckBox)((CellItem)col.CellItems[row.BandIndex]).FindControl("cBox");

                if (chk.Checked)
                {
                    DataRow dr = dt.NewRow();
                    dr["ESTTERM_REF_ID"] = DataTypeUtility.GetToInt32(row.Cells.FromKey("ESTTERM_REF_ID").Value);
                    dr["EMP_REF_ID"]     = DataTypeUtility.GetToInt32(row.Cells.FromKey("EMP_REF_ID").Value);
                    dr["KPI_REF_ID"]     = DataTypeUtility.GetToInt32(row.Cells.FromKey("KPI_REF_ID").Value);
                    dt.Rows.Add(dr);
                }
            }

            if (dt.Rows.Count > 0)
            {
                if (objBSC.DeleteMBOWeight(dt, gUserInfo.Emp_Ref_ID))
                {
                    this.SetMyKpiList();
                    this.SetKpiListExceptMine();
                    PageUtility.AlertMessage("삭제하였습니다.");
                }
                else
                {
                    PageUtility.AlertMessage("실패하였습니다.");
                }
                return;
            }
        }
        else
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("ESTTERM_REF_ID", typeof(int));
            dt.Columns.Add("KPI_REF_ID", typeof(int));
            dt.Columns.Add("WEIGHT", typeof(decimal));
            dt.Columns.Add("KPI_CLASS_REF_ID", typeof(string));

            for (int i = 0; i < ugrdKpi.Rows.Count; i++)
            {
                row = ugrdKpi.Rows[i];
                col = (TemplatedColumn)row.Band.Columns.FromKey("selchk");
                chk = (CheckBox)((CellItem)col.CellItems[row.BandIndex]).FindControl("cBox");

                if (chk.Checked)
                {
                    DataRow dr = dt.NewRow();
                    dr["ESTTERM_REF_ID"] = DataTypeUtility.GetToInt32(row.Cells.FromKey("ESTTERM_REF_ID").Value);
                    dr["KPI_REF_ID"]     = DataTypeUtility.GetToInt32(row.Cells.FromKey("KPI_REF_ID").Value);
                    if (iType == "ADD")
                    {
                        dr["WEIGHT"] = 0;
                    }
                    else if (iType == "SET")
                    {
                        dr["WEIGHT"] = DataTypeUtility.GetToDecimal(row.Cells.FromKey("WEIGHT").Value);
                    }
                    try
                    {
                        dr["KPI_CLASS_REF_ID"] = (row.Cells.FromKey("IS_TEAM_KPI").Value.ToString() == "Y" ? "SCO" : "PCO");
                    }
                    catch { }
                    dt.Rows.Add(dr);
                }
            }

            if (dt.Rows.Count > 0)
            {
                if (objBSC.UpdateMBOWeight(gUserInfo.Emp_Ref_ID
                                           , dt))
                {
                    this.SetMyKpiList();
                    this.SetKpiListExceptMine();
                    PageUtility.AlertMessage("처리하였습니다.");
                }
                else
                {
                    PageUtility.AlertMessage("실패하였습니다.");
                }
                return;
            }
        }

        if (cntRow < 1)
        {
            PageUtility.AlertMessage("항목을 선택하세요.");
        }
        else
        {
            this.SetMyKpiList();
            this.SetKpiListExceptMine();
            PageUtility.AlertMessage("삭제하였습니다.");
        }
    }