Пример #1
0
    protected void ugrdKpiList_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)
    {
        TemplatedColumn cCol = (TemplatedColumn)e.Row.Band.Columns.FromKey("USE_YN");

        System.Web.UI.WebControls.Image objImg = (System.Web.UI.WebControls.Image)((CellItem)cCol.CellItems[e.Row.BandIndex]).FindControl("imgUseYn");
        objImg.ImageUrl = (e.Row.Cells.FromKey("USE_YN").Value.ToString() == "Y") ?
                          "../images/icon_o.gif" : "../images/icon_x.gif";

        //cCol = (TemplatedColumn)e.Row.Band.Columns.FromKey("APPROVAL_STATUS");
        //objImg = (Image)((CellItem)cCol.CellItems[e.Row.BandIndex]).FindControl("imgUseYn");
        //objImg.ImageUrl = (e.Row.Cells.FromKey("APPROVAL_STATUS").Value.ToString() == "Y") ?
        //                  "../images/icon_o.gif" : "../images/icon_x.gif";

        cCol   = (TemplatedColumn)e.Row.Band.Columns.FromKey("APP_STATUS");
        objImg = (System.Web.UI.WebControls.Image)((CellItem)cCol.CellItems[e.Row.BandIndex]).FindControl("imgApp");
        string strImg = e.Row.Cells.FromKey("APP_STATUS").Value.ToString();

        objImg.ImageUrl      = Biz_Com_Approval_Info.GetAppImageUrl(strImg);
        objImg.AlternateText = Biz_Com_Approval_Info.GetAppImageText(strImg);
    }
Пример #2
0
    private void DoBinding()
    {
        Biz_Bsc_Kpi_Info objBSC = new Biz_Bsc_Kpi_Info();
        DataSet          ds     = objBSC.GetMBOForWeight(PageUtility.GetIntByValueDropDownList(ddlEstTerm)
                                                         , txtKpiCode.Text.Trim()
                                                         , txtKpiName.Text.Trim()
                                                         , txtChampionName.Text.Trim()
                                                         , (ddlComDept.SelectedItem.Value == "" ? 0 : PageUtility.GetIntByValueDropDownList(ddlComDept))
                                                         , PageUtility.GetByValueDropDownList(ddlKpiGroup)
                                                         , PageUtility.GetByValueDropDownList(ddlMboType)
                                                         , PageUtility.GetIntByValueDropDownList(ddlKpiCategoryTop)
                                                         , PageUtility.GetIntByValueDropDownList(ddlKpiCategoryMid)
                                                         , PageUtility.GetIntByValueDropDownList(ddlKpiCategoryLow)
                                                         , gUserInfo.Emp_Ref_ID
                                                         , User.IsInRole(ROLE_ADMIN));


        ugrdMBO.Clear();
        ugrdMBO.DataSource = ds.Tables[0];
        ugrdMBO.DataBind();

        lblRowCount.Text = ugrdMBO.Rows.Count.ToString();

        if (ds.Tables[0].Rows.Count == 0)
        {
            iBtnDraft.Visible = ImgBtnPrint.Visible = iBtnMoDraft.Visible = iBtnReDraft.Visible = iBtnReWrite.Visible = iBtnReqModify.Visible = false;
        }

        object objSum = ds.Tables[0].Compute("SUM(WEIGHT)", "");

        if (objSum == null || this.IDEPT_ID.ToString() != ddlComDept.SelectedValue)
        {
            txtWeightSum.Text = "0";
        }
        else
        {
            txtWeightSum.Text = DataTypeUtility.GetToDouble(objSum).ToString();
        }

        //if (User.IsInRole(ROLE_ADMIN))
        //    return;

        DataTable dtWeightApproval = objBSC.GetMBOForWeight_Approval(PageUtility.GetIntByValueDropDownList(ddlEstTerm)
                                                                     , gUserInfo.Emp_Ref_ID).Tables[0];

        if (dtWeightApproval.Rows.Count == 0)
        {
            this.IAPP_STATUS = "";
            this.IAPP_REF_ID = "0";
        }
        else
        {
            this.IAPP_STATUS = dtWeightApproval.Rows[0]["APP_STATUS"].ToString();
            this.IAPP_REF_ID = dtWeightApproval.Rows[0]["APP_REF_ID"].ToString();
        }
        string strImg = (this.IAPP_STATUS == "") ? "" : this.IAPP_STATUS;

        imgApprovalStatus.Src = Biz_Com_Approval_Info.GetAppImageUrl(strImg);
        imgApprovalStatus.Alt = Biz_Com_Approval_Info.GetAppImageText(strImg);

        if (ds.Tables[0].Rows.Count == 0)
        {
            return;
        }
        switch (this.IAPP_STATUS)
        {
        case "":     // 결재상태 없음
            iBtnDraft.Visible     = true;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = false;
            break;

        case Biz_Type.app_status_nodraft:     // 결재상태 없음
            iBtnDraft.Visible     = true;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = false;
            break;

        case Biz_Type.app_status_draft:     // 상신
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = false;
            imgApprovalStatus.Src = "../images/draft/sta_dft.gif";
            break;

        case Biz_Type.app_status_ondraft:     // 결재중
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = false;
            imgApprovalStatus.Src = "../images/draft/sta_oft.gif";
            break;

        case Biz_Type.app_status_return:     // 반려
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = true;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = false;
            imgApprovalStatus.Src = "../images/draft/sta_rft.gif";
            break;

        case Biz_Type.app_status_recall:     // 결재회수
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = true;
            iBtnReqModify.Visible = false;
            imgApprovalStatus.Src = "../images/draft/sta_aft.gif";
            break;

        case Biz_Type.app_status_onmodify:     // 수정결재
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = true;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = false;
            imgApprovalStatus.Src = "../images/draft/sta_mft.gif";
            break;

        case Biz_Type.app_status_complete:     // 결재완료
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = true;
            imgApprovalStatus.Src = "../images/draft/sta_cft.gif";
            break;

        default:
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReqModify.Visible = false;
            iBtnReWrite.Visible   = false;
            break;
        }
    }
Пример #3
0
    private void DoBinding()
    {
        if (ddlEstTerm.Items.Count < 1)
        {
            ltrScript.Text = JSHelper.GetAlertScript("등록된 평가기간이 없습니다.");
            return;
        }

        //가중치
        Biz_Bsc_Mbo_Kpi_Weight objBSC_weight = new Biz_Bsc_Mbo_Kpi_Weight();

        DT_KPI_WEIGHT = objBSC_weight.GetAllList(PageUtility.GetIntByValueDropDownList(ddlEstTerm), gUserInfo.Emp_Ref_ID).Tables[0];


        //월별 실적
        Biz_Bsc_Kpi_Info objBSC          = new Biz_Bsc_Kpi_Info();
        DataSet          dsMonthlyTarget = objBSC.GetMBOForWeight(PageUtility.GetIntByValueDropDownList(ddlEstTerm)
                                                                  , txtKpiCodeRight.Text.Trim()
                                                                  , txtKpiNameRight.Text.Trim()
                                                                  , txtChampionNameRight.Text.Trim()
                                                                  , (ddlComDeptRight.SelectedItem.Value == "" ? 0 : PageUtility.GetIntByValueDropDownList(ddlComDeptRight))
                                                                  , PageUtility.GetByValueDropDownList(ddlKpiGroup)
                                                                  , ""//MBO_TYPE
                                                                  , PageUtility.GetIntByValueDropDownList(ddlKpiCategoryTop)
                                                                  , PageUtility.GetIntByValueDropDownList(ddlKpiCategoryMid)
                                                                  , PageUtility.GetIntByValueDropDownList(ddlKpiCategoryLow)
                                                                  , gUserInfo.Emp_Ref_ID
                                                                  , User.IsInRole(ROLE_ADMIN));


        //KPI목록
        DataSet ds = objBSC.GetMBOForDeptKpi(PageUtility.GetIntByValueDropDownList(ddlEstTerm)
                                             , txtKpiCodeRight.Text.Trim()
                                             , txtKpiNameRight.Text.Trim()
                                             , txtChampionNameRight.Text.Trim()
                                             , PageUtility.GetByValueDropDownList(ddlKpiGroup)
                                             , (ddlComDeptRight.SelectedItem.Value == "" ? 0 : PageUtility.GetIntByValueDropDownList(ddlComDeptRight))
                                             , PageUtility.GetIntByValueDropDownList(ddlKpiCategoryTop)
                                             , PageUtility.GetIntByValueDropDownList(ddlKpiCategoryMid)
                                             , PageUtility.GetIntByValueDropDownList(ddlKpiCategoryLow)
                                             , gUserInfo.Emp_Ref_ID
                                             , (User.IsInRole(ROLE_ADMIN) == true ? 1 : 0)
                                             , this.IDEPT_ID);

        DataTable dt = addMonthlyTarget(dsMonthlyTarget.Tables[0], ds.Tables[0]);

        ugrdMBO.Clear();
        ugrdMBO.DataSource = dt;
        ugrdMBO.DataBind();



        int cntApprovalStatus = 0;

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            if (ds.Tables[0].Rows[i]["USE_YN"].ToString().Equals("Y"))
            {
                if (ds.Tables[0].Rows[i]["APPROVAL_STATUS"].ToString().Equals("N"))
                {
                    cntApprovalStatus++;
                }
            }
        }
        if (cntApprovalStatus == 0)
        {
            DRAFT_BTN_VISIBLE = true;
        }
        else
        {
            DRAFT_BTN_VISIBLE = false;
        }


        double weight = 0;
        double tmp;

        for (int i = 0; i < ugrdMBO.Rows.Count; i++)
        {
            tmp = DataTypeUtility.GetToDouble(ugrdMBO.Rows[i].Cells.FromKey("WEIGHT").Value);

            if (DataTypeUtility.GetString(ugrdMBO.Rows[i].Cells.FromKey("USE_YN").Value).Equals("N"))
            {
                continue;
            }

            if (tmp == (double)0)
            {
                weight = 0;
                break;
            }

            weight += DataTypeUtility.GetToDouble(ugrdMBO.Rows[i].Cells.FromKey("WEIGHT").Value);
        }
        if (weight != (double)100)
        {
            DRAFT_BTN_VISIBLE = false;
        }



        if (ds.Tables[0].Rows.Count == 0)
        {
            iBtnDraft.Visible = iBtnMoDraft.Visible = iBtnReDraft.Visible = iBtnReWrite.Visible = iBtnReqModify.Visible = false;
        }



        this.lblRowCnt.Text = ugrdMBO.Rows.Count.ToString();



        DataTable dtWeightApproval = objBSC.GetMBOForWeight_Approval(PageUtility.GetIntByValueDropDownList(ddlEstTerm)
                                                                     , gUserInfo.Emp_Ref_ID).Tables[0];

        if (dtWeightApproval.Rows.Count == 0)
        {
            this.IAPP_STATUS = "";
            this.IAPP_REF_ID = "0";
        }
        else
        {
            this.IAPP_STATUS = dtWeightApproval.Rows[0]["APP_STATUS"].ToString();
            this.IAPP_REF_ID = dtWeightApproval.Rows[0]["APP_REF_ID"].ToString();
        }
        string strImg = (this.IAPP_STATUS == "") ? "" : this.IAPP_STATUS;

        imgApprovalStatus.Src = Biz_Com_Approval_Info.GetAppImageUrl(strImg);
        imgApprovalStatus.Alt = Biz_Com_Approval_Info.GetAppImageText(strImg);
        if (IAPP_STATUS.Length > 0)
        {
            this.strApprovalStatus.Text = DataTypeUtility.GetString(dtWeightApproval.Rows[0]["APP_STATUS_NAME"]);
        }


        switch (this.IAPP_STATUS)
        {
        case "":     // 결재상태 없음
            iBtnDraft.Visible     = DRAFT_BTN_VISIBLE;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = false;
            break;


        case Biz_Type.app_status_nodraft:     // 결재상태 없음
            iBtnDraft.Visible     = DRAFT_BTN_VISIBLE;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = false;
            break;


        case Biz_Type.app_status_draft:     // 상신
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = false;
            imgApprovalStatus.Src = "../images/draft/sta_dft.gif";

            setVisibleForDraft(false);
            break;


        case Biz_Type.app_status_ondraft:     // 결재중
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = false;
            imgApprovalStatus.Src = "../images/draft/sta_oft.gif";

            setVisibleForDraft(false);
            break;


        case Biz_Type.app_status_return:     // 반려
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = DRAFT_BTN_VISIBLE;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = false;
            imgApprovalStatus.Src = "../images/draft/sta_rft.gif";

            setVisibleForDraft(true);
            break;


        case Biz_Type.app_status_recall:     // 결재회수
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = DRAFT_BTN_VISIBLE;
            iBtnReqModify.Visible = false;
            imgApprovalStatus.Src = "../images/draft/sta_aft.gif";

            setVisibleForDraft(true);
            break;


        case Biz_Type.app_status_onmodify:     // 수정결재
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = DRAFT_BTN_VISIBLE;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = false;
            imgApprovalStatus.Src = "../images/draft/sta_mft.gif";

            setVisibleForDraft(true);
            break;


        case Biz_Type.app_status_complete:     // 결재완료
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReWrite.Visible   = false;
            iBtnReqModify.Visible = DRAFT_BTN_VISIBLE;
            iBtnReqModify.Visible = true;
            imgApprovalStatus.Src = "../images/draft/sta_cft.gif";

            setVisibleForDraft(false);
            break;


        default:
            iBtnDraft.Visible     = false;
            iBtnMoDraft.Visible   = false;
            iBtnReDraft.Visible   = false;
            iBtnReqModify.Visible = false;
            iBtnReWrite.Visible   = false;
            break;
        }
    }