Ejemplo n.º 1
0
    public static void BindGrade(DropDownList ddl, int comp_id)
    {
        Biz_Grades grade = new Biz_Grades();
        DataSet    ds    = grade.GetEstGrades(comp_id);

        ddl.DataValueField = "GRADE_ID";
        ddl.DataTextField  = "GRADE_NAME";
        ddl.DataSource     = ds;
        ddl.DataBind();
    }
Ejemplo n.º 2
0
    private void GridBinding(int comp_id)
    {
        Biz_Grades grades = new Biz_Grades();
        DataSet    ds     = grades.GetEstGrades(comp_id);

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

        lblRowCount.Text = ds.Tables[0].Rows.Count.ToString();
    }
Ejemplo n.º 3
0
    private void BindGrid(int comp_id, string est_id, string scale_id)
    {
        Biz_Scopes scopes = new Biz_Scopes();
        DataSet    ds     = scopes.GetScopeGradeEstID(comp_id, est_id, scale_id);

        if (ds.Tables[0].Rows.Count == 0)
        {
            Biz_Grades grades  = new Biz_Grades();
            DataSet    dsGrade = grades.GetEstGrades(comp_id);

            UltraWebGrid1.DataSource = dsGrade;
            UltraWebGrid1.DataBind();
        }
        else
        {
            UltraWebGrid1.DataSource = ds;
            UltraWebGrid1.DataBind();
        }
    }
Ejemplo n.º 4
0
    private void DataBindingGrid(int comp_id
                                 , string est_id
                                 , int estterm_ref_id
                                 , int estterm_sub_id
                                 , int estterm_step_id
                                 , string year_yn
                                 , string merge_yn
                                 , string owner_type)
    {
        _eOwnerType = BizUtility.GetOwnerType(owner_type);

        Biz_Datas data = new Biz_Datas();

        DT_EST_DATA = data.GetData(comp_id
                                   , est_id
                                   , estterm_ref_id
                                   , estterm_sub_id
                                   , estterm_step_id
                                   , 0
                                   , 0
                                   , 0
                                   , 0
                                   , year_yn
                                   , merge_yn
                                   , _eOwnerType).Tables[0];

        Biz_Grades grade = new Biz_Grades();

        DT_GRADE = grade.GetEstGrades(comp_id).Tables[0];

        DataTable dataDept = BizUtility.GetDeptTree("     ");

        if (_eOwnerType == OwnerType.Dept)
        {
            dataDept.Columns.Add("B_POINT", typeof(double));
            dataDept.Columns.Add("A_POINT", typeof(double));
            dataDept.Columns.Add("B_GRADE", typeof(string));
            dataDept.Columns.Add("A_GRADE", typeof(string));
            dataDept.Columns.Add("IS_EST", typeof(string));

            foreach (DataRow dataRow in dataDept.Rows)
            {
                dataRow["B_POINT"] = "0";
                dataRow["A_POINT"] = "0";
                dataRow["B_GRADE"] = "-";
                dataRow["A_GRADE"] = "-";
                dataRow["IS_EST"]  = "N";
            }

            foreach (DataRow drDept in dataDept.Rows)
            {
                DataRow[] drEstData = DT_EST_DATA.Select(string.Format("TGT_DEPT_ID = {0}", drDept["DEPT_REF_ID"]));

                foreach (DataRow dataEstData in drEstData)
                {
                    drDept["A_POINT"] = DataTypeUtility.GetToDouble(dataEstData["POINT"]);
                    drDept["A_GRADE"] = DataTypeUtility.GetValue(dataEstData["GRADE_ID"]);;
                    drDept["IS_EST"]  = "Y";
                }
            }
        }
        else if (_eOwnerType == OwnerType.Emp_User)
        {
            foreach (DataRow drGrade in DT_GRADE.Rows)
            {
                dataDept.Columns.Add("B_" + drGrade["GRADE_ID"].ToString(), typeof(string));
                dataDept.Columns.Add("A_" + drGrade["GRADE_ID"].ToString(), typeof(string));
            }

            dataDept.Columns.Add("IS_EST", typeof(string));

            foreach (DataRow dataRow in dataDept.Rows)
            {
                foreach (DataRow drGrade in DT_GRADE.Rows)
                {
                    dataRow["B_" + drGrade["GRADE_ID"].ToString()] = "0";
                    dataRow["A_" + drGrade["GRADE_ID"].ToString()] = "0";
                    dataRow["IS_EST"] = "N";
                }
            }

            foreach (DataRow drDept in dataDept.Rows)
            {
                DataRow[] drEstData = DT_EST_DATA.Select(string.Format("TGT_DEPT_ID = {0}", drDept["DEPT_REF_ID"]));

                foreach (DataRow dataEstData in drEstData)
                {
                    if (dataEstData["GRADE_ID"] != DBNull.Value)
                    {
                        drDept["A_" + DataTypeUtility.GetValue(dataEstData["GRADE_ID"])] = DataTypeUtility.GetToInt32(drDept["A_" + DataTypeUtility.GetValue(dataEstData["GRADE_ID"])]) + 1;
                    }

                    drDept["IS_EST"] = "Y";
                }
            }

            DataRow dr = dataDept.NewRow();
            dr["DEPT_REF_ID"] = -9999;
            dr["DEPT_NAME"]   = "<div align='center'><b>합&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;계</b></center>";
            dr["IS_EST"]      = "T";
            dataDept.Rows.Add(dr);

            foreach (DataRow drGrade in DT_GRADE.Rows)
            {
                foreach (DataRow drEstSum in dataDept.Rows)
                {
                    if (DataTypeUtility.GetToInt32(drEstSum["DEPT_REF_ID"]) > 0)
                    {
                        dataDept.Rows[dataDept.Rows.Count - 1]["B_" + DataTypeUtility.GetValue(drGrade["GRADE_ID"])]
                            = DataTypeUtility.GetToInt32(dataDept.Rows[dataDept.Rows.Count - 1]["B_" + DataTypeUtility.GetValue(drGrade["GRADE_ID"])])
                              + DataTypeUtility.GetToInt32(drEstSum["B_" + DataTypeUtility.GetValue(drGrade["GRADE_ID"])]);

                        dataDept.Rows[dataDept.Rows.Count - 1]["A_" + DataTypeUtility.GetValue(drGrade["GRADE_ID"])]
                            = DataTypeUtility.GetToInt32(dataDept.Rows[dataDept.Rows.Count - 1]["A_" + DataTypeUtility.GetValue(drGrade["GRADE_ID"])])
                              + DataTypeUtility.GetToInt32(drEstSum["A_" + DataTypeUtility.GetValue(drGrade["GRADE_ID"])]);
                    }
                }
            }
        }

        UltraWebGrid1.DataSource = dataDept;
        UltraWebGrid1.DataBind();

        //GridView1.DataSource = dataDept;
        //GridView1.DataBind();
    }