Exemplo n.º 1
0
    private void GridBidingData(int comp_id
                                , string est_id
                                , int estterm_ref_id
                                , int estterm_sub_id
                                , int estterm_step_id)
    {
        // 평가정보를 가져온다.
        Biz_EstInfos estInfo = new Biz_EstInfos(comp_id, est_id);

        // 해당평가가 존재하는지 여부 체크
        if (!estInfo.IsExists(comp_id, est_id))
        {
            ltrScript.Text = JSHelper.GetAlertScript("선택된 회사의 평가정보가 없습니다.");
            return;
        }



        Biz_Est_Data bizEstData = new Biz_Est_Data();

        if (DT_EST_DATA == null)
        {
            DT_EST_DATA = bizEstData.Get_Est_Data_Pos_Weight(comp_id
                                                             , est_id
                                                             , estterm_ref_id
                                                             , estterm_sub_id
                                                             , estterm_step_id);
        }



        DT_EST_DATA = DataTypeUtility.FilterSortDataTable(DT_EST_DATA, "TGT_DEPT_ID=10");//경영혁신팀만 조회
        if (DataTypeUtility.FilterSortDataTable(DT_EST_DATA, "DEPT_POINT IS NULL").Rows.Count > 0)
        {
            this.ltrScript.Text     = JSHelper.GetAlertScript("점수가 입력되지 않은 부서가 존재합니다.");
            iBtnApplyWeight.Visible = false;
        }



        Biz_Est_Pos_Weight bizEstPosWeight = new Biz_Est_Pos_Weight();
        DataTable          dt = bizEstPosWeight.Get_Est_Pos_Weight(comp_id
                                                                   , estterm_ref_id
                                                                   , est_id
                                                                   , 0
                                                                   , ""
                                                                   , ""
                                                                   , 0);

        if (dt.Rows.Count > 0)
        {
            dt     = DataTypeUtility.GetGroupByDataTable(dt, new string[] { "POS_ID" });
            POS_ID = DataTypeUtility.GetString(dt.Rows[0]["POS_ID"]);

            Biz_PositionInfos bizPosInfo = new Biz_PositionInfos(POS_ID);
            if (bizPosInfo.Position_Table_Name != null && bizPosInfo.Position_Table_Name.Trim().Length > 0)
            {
                DT_EST_POS_WEIGHT = bizEstPosWeight.Get_Est_Pos_Weight(POS_ID
                                                                       , bizPosInfo.Position_Table_Name
                                                                       , DEPT_TYPE_REF_ID_LIST
                                                                       , comp_id
                                                                       , estterm_ref_id
                                                                       , est_id);



                int    current_page = UltraWebGrid1.DisplayLayout.Pager.CurrentPageIndex;
                int    page_size    = UltraWebGrid1.DisplayLayout.Pager.PageSize;
                double page_cnt     = Math.Ceiling((double)DT_EST_DATA.Rows.Count / page_size);


                CURRENT_PAGE = current_page;
                PAGE_CNT     = DataTypeUtility.GetToInt32(page_cnt);


                DataTable dt_est_data = DT_EST_DATA.Copy();
                for (int i = 0; i < (current_page - 1) * page_size; i++)
                {
                    dt_est_data.Rows.RemoveAt(0);
                }


                UltraWebGrid1.Clear();
                UltraWebGrid1.DataSource = dt_est_data;
                UltraWebGrid1.DataBind();


                lblRowCount.Text = DT_EST_DATA.Rows.Count.ToString("#,##0");
            }
        }
    }
Exemplo n.º 2
0
    protected bool saveEstQ()
    {
        Biz_Est_Data bizEstData = new Biz_Est_Data();
        DataTable    dt         = DT_EST_DATA.Clone();

        int balance_plus_cnt  = 0;
        int balance_minus_cnt = 0;

        for (int i = 0; i < UltraWebGrid1.Rows.Count; i++)
        {
            DataRow dr       = dt.NewRow();
            DataRow dr_final = dt.NewRow();


            string comp_id         = DataTypeUtility.GetString(UltraWebGrid1.Rows[i].Cells.FromKey("COMP_ID").Value);
            string est_id          = DataTypeUtility.GetString(UltraWebGrid1.Rows[i].Cells.FromKey("EST_ID").Value);
            string estterm_ref_id  = DataTypeUtility.GetString(UltraWebGrid1.Rows[i].Cells.FromKey("ESTTERM_REF_ID").Value);
            string estterm_sub_id  = DataTypeUtility.GetString(UltraWebGrid1.Rows[i].Cells.FromKey("ESTTERM_SUB_ID").Value);
            string estterm_step_id = DataTypeUtility.GetString(UltraWebGrid1.Rows[i].Cells.FromKey("ESTTERM_STEP_ID").Value);
            string est_dept_id     = DataTypeUtility.GetString(UltraWebGrid1.Rows[i].Cells.FromKey("EST_DEPT_ID").Value);
            string est_emp_id      = DataTypeUtility.GetString(UltraWebGrid1.Rows[i].Cells.FromKey("EST_EMP_ID").Value);
            string tgt_dept_id     = DataTypeUtility.GetString(UltraWebGrid1.Rows[i].Cells.FromKey("TGT_DEPT_ID").Value);
            string tgt_emp_id      = DataTypeUtility.GetString(UltraWebGrid1.Rows[i].Cells.FromKey("TGT_EMP_ID").Value);
            string status_id       = DataTypeUtility.GetString(UltraWebGrid1.Rows[i].Cells.FromKey("STATUS_ID").Value);
            double point_org       = DataTypeUtility.GetToDouble(UltraWebGrid1.Rows[i].Cells.FromKey("POINT_ORG").Value);



            string filter = "COMP_ID='{0}' AND EST_ID='{1}' AND ESTTERM_REF_ID='{2}' AND ESTTERM_SUB_ID='{3}' AND ESTTERM_STEP_ID='{4}' AND EST_DEPT_ID='{5}' AND EST_EMP_ID='{6}' AND TGT_DEPT_ID='{7}' AND TGT_EMP_ID='{8}'";
            filter = string.Format(filter, comp_id, est_id, estterm_ref_id, estterm_sub_id, estterm_step_id, est_dept_id, est_emp_id, tgt_dept_id, tgt_emp_id);
            DataTable dt_tmp = DataTypeUtility.FilterSortDataTable(DT_EST_DATA, filter);
            if (dt_tmp.Rows.Count == 1)
            {
                for (int j = 0; j < dt_tmp.Columns.Count; j++)
                {
                    dr_final[j] = dt_tmp.Rows[0][j];
                }
            }
            else
            {
                this.ltrScript.Text = JSHelper.GetAlertScript("평가데이터에 오류가 있습니다.");
                return(false);
            }



            Biz_Status new_status = bizEstData.Get_New_Est_Status(DataTypeUtility.GetToInt32(comp_id), est_id, status_id, 6, 5);
            if (new_status.Status_ID == null && new_status.Status_ID.Trim().Length > 0)
            {
                this.ltrScript.Text = JSHelper.GetAlertScript(string.Format("{0} 단계로 진행할 수 없는 데이터가 있습니다.", new_status.Status_Name));
                return(false);
            }


            TemplatedColumn tc = (TemplatedColumn)UltraWebGrid1.Columns.FromKey("POINT_BALANCE");
            Infragistics.WebUI.WebDataInput.WebNumericEdit ne = (Infragistics.WebUI.WebDataInput.WebNumericEdit)((CellItem)tc.CellItems[i]).FindControl("POINT_BALANCE");
            double point_balance = DataTypeUtility.GetToDouble(ne.Value);

            if (point_balance > 0)
            {
                balance_plus_cnt++;
            }
            else if (point_balance < 0)
            {
                balance_minus_cnt++;
            }

            double point_ctrl_org = point_org + point_balance;
            double point          = point_ctrl_org * 100 / 5;//환산점수



            dr["COMP_ID"]         = comp_id;
            dr["EST_ID"]          = est_id;
            dr["ESTTERM_REF_ID"]  = estterm_ref_id;
            dr["ESTTERM_SUB_ID"]  = estterm_sub_id;
            dr["ESTTERM_STEP_ID"] = estterm_step_id;
            dr["EST_DEPT_ID"]     = est_dept_id;
            dr["EST_EMP_ID"]      = est_emp_id;
            dr["TGT_DEPT_ID"]     = tgt_dept_id;
            dr["TGT_EMP_ID"]      = tgt_emp_id;
            dr["POINT"]           = point;
            dr["POINT_ORG"]       = point_org;
            dr["POINT_AVG"]       = -1;
            dr["POINT_STD"]       = -1;
            dr["POINT_CTRL_ORG"]  = point_ctrl_org;
            dr["STATUS_ID"]       = new_status.Status_ID;



            dr_final["COMP_ID"]         = comp_id;
            dr_final["EST_ID"]          = est_id;
            dr_final["ESTTERM_REF_ID"]  = estterm_ref_id;
            dr_final["ESTTERM_SUB_ID"]  = estterm_sub_id;
            dr_final["ESTTERM_STEP_ID"] = "1";
            dr_final["EST_DEPT_ID"]     = est_dept_id;
            dr_final["EST_EMP_ID"]      = est_emp_id;
            dr_final["TGT_DEPT_ID"]     = tgt_dept_id;
            dr_final["TGT_EMP_ID"]      = tgt_emp_id;
            dr_final["POINT"]           = point;
            dr_final["POINT_ORG"]       = point_org;
            dr_final["POINT_AVG"]       = -1;
            dr_final["POINT_STD"]       = -1;
            dr_final["POINT_CTRL_ORG"]  = point_ctrl_org;
            dr_final["STATUS_ID"]       = new_status.Status_ID;


            dt.Rows.Add(dr);
            dt.Rows.Add(dr_final);
        }

        int balance_limit = DT_EST_DATA.Rows.Count / 10;

        if (balance_plus_cnt > balance_limit || balance_minus_cnt > balance_limit)
        {
            this.ltrScript.Text = JSHelper.GetAlertScript("점수조정 가능인원을 초과하였습니다.");
            return(false);
        }

        int result = bizEstData.ModifyEstData_Point(dt, gUserInfo.Emp_Ref_ID);

        return(result > 0 ? true : false);
    }