Esempio n. 1
0
    private DataTable GetRelGroupData(int comp_id, string est_id, int estterm_ref_id)
    {
        Biz_EmpInfos        empInfo      = new Biz_EmpInfos();
        Biz_RelGroupInfos   relGrpInfo   = new Biz_RelGroupInfos();
        Biz_RelGroupTgtMaps relGrpTgtMap = new Biz_RelGroupTgtMaps();
        DataTable           dataTable    = relGrpTgtMap.GetDataTableSchema();
        DataRow             dataRow      = null;
        DataTable           dtRelGrp     = relGrpInfo.GetRelGroupInfo(comp_id, "", est_id, estterm_ref_id).Tables[0];

        foreach (DataRow dataRowRelGrp in dtRelGrp.Rows)
        {
            DataTable dtTgt          = null;
            string    rel_grp_id     = dataRowRelGrp["REL_GRP_ID"].ToString();
            string    where_sentence = "";

            where_sentence = BizUtility.GetRelGroupWhereString(COMP_ID
                                                               , EST_ID
                                                               , ESTTERM_REF_ID
                                                               , rel_grp_id
                                                               , "TM");

            if (OwnerTypeMode == OwnerType.Dept)
            {
                dtTgt = empInfo.GetRelDeptList("WHERE", where_sentence, "TM").Tables[0];
            }
            else if (OwnerTypeMode == OwnerType.Emp_User)
            {
                dtTgt = empInfo.GetRelEmpList("WHERE", where_sentence, "TM").Tables[0];
            }

            foreach (DataRow dataRowTgt in dtTgt.Rows)
            {
                dataRow = dataTable.NewRow();

                dataRow["COMP_ID"]        = comp_id;
                dataRow["REL_GRP_ID"]     = rel_grp_id;
                dataRow["EST_ID"]         = est_id;
                dataRow["ESTTERM_REF_ID"] = estterm_ref_id;
                dataRow["TGT_DEPT_ID"]    = dataRowTgt["TGT_DEPT_ID"];
                dataRow["TGT_EMP_ID"]     = dataRowTgt["TGT_EMP_ID"];
                dataRow["DATE"]           = DateTime.Now;
                dataRow["USER"]           = EMP_REF_ID;

                dataTable.Rows.Add(dataRow);
            }
        }

        return(dataTable);
    }
Esempio n. 2
0
    private void GridBinding(int estterm_sub_id, OwnerType ownerType)
    {
        DataSet ds = null;

        if (ownerType == OwnerType.Dept)
        {
            rbnComDeptEmp.Text = "전체 부서 데이터";

            UltraWebGrid1.Columns.FromKey("TGT_EMP_NAME").Hidden     = true;
            UltraWebGrid1.Columns.FromKey("TGT_POS_CLS_NAME").Hidden = true;
            UltraWebGrid1.Columns.FromKey("TGT_POS_DUT_NAME").Hidden = true;
            UltraWebGrid1.Columns.FromKey("TGT_POS_GRP_NAME").Hidden = true;
            UltraWebGrid1.Columns.FromKey("TGT_POS_RNK_NAME").Hidden = true;
            UltraWebGrid1.Columns.FromKey("TGT_POS_KND_NAME").Hidden = true;
        }
        else if (ownerType == OwnerType.Dept)
        {
            rbnComDeptEmp.Text = "전체 사원 데이터";

            UltraWebGrid1.Columns.FromKey("TGT_EMP_NAME").Hidden     = false;
            UltraWebGrid1.Columns.FromKey("TGT_POS_CLS_NAME").Hidden = false;
            UltraWebGrid1.Columns.FromKey("TGT_POS_DUT_NAME").Hidden = false;
            UltraWebGrid1.Columns.FromKey("TGT_POS_GRP_NAME").Hidden = false;
            UltraWebGrid1.Columns.FromKey("TGT_POS_RNK_NAME").Hidden = false;
            UltraWebGrid1.Columns.FromKey("TGT_POS_KND_NAME").Hidden = false;
        }

        if (rbnComDeptEmp.Checked)
        {
            UltraWebGrid1.Columns.FromKey("TGT_DEPT_NAME").Header.Caption = "부서명";
            UltraWebGrid1.Columns.FromKey("TGT_EMP_NAME").Header.Caption  = "사원명";

            UltraWebGrid1.Columns.FromKey("ESTTERM_SUB_NAME").Hidden = true;
            UltraWebGrid1.Columns.FromKey("EST_DEPT_NAME").Hidden    = true;
            UltraWebGrid1.Columns.FromKey("EST_EMP_NAME").Hidden     = true;

            Biz_EmpInfos biz = new Biz_EmpInfos();

            if (OwnerTypeMode == OwnerType.Dept)
            {
                ds = biz.GetRelDeptList("WHERE", SENTENCE, "TM");
            }
            else if (OwnerTypeMode == OwnerType.Emp_User)
            {
                ds = biz.GetRelEmpList("WHERE", SENTENCE, "TM");
            }
        }
        else
        {
            UltraWebGrid1.Columns.FromKey("ESTTERM_SUB_NAME").Hidden = false;
            UltraWebGrid1.Columns.FromKey("EST_DEPT_NAME").Hidden    = false;
            UltraWebGrid1.Columns.FromKey("EST_EMP_NAME").Hidden     = false;

            UltraWebGrid1.Columns.FromKey("TGT_DEPT_NAME").Header.Caption = "피평가자부서";
            UltraWebGrid1.Columns.FromKey("TGT_EMP_NAME").Header.Caption  = "피평가자명";

            Biz_Datas biz = new Biz_Datas();

            if (OwnerTypeMode == OwnerType.Dept)
            {
            }
            else if (OwnerTypeMode == OwnerType.Emp_User)
            {
            }

            ds = biz.GetEstDataByRelGroup(COMP_ID
                                          , EST_ID
                                          , ESTTERM_REF_ID
                                          , estterm_sub_id
                                          , ESTTERM_STEP_ID
                                          , "AND "
                                          , SENTENCE);
        }

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

        lblRowCount.Text = ds.Tables[0].Rows.Count.ToString("#,##0");
    }