Ejemplo n.º 1
0
    protected void ibnSave_Click(object sender, ImageClickEventArgs e)
    {
        string strGradeID   = txtGradeID.Text;
        string strGradeName = txtGradeName.Text;
        string strGradeDesc = txtGradeDesc.Text;

        Biz_Grades grades  = new Biz_Grades();
        bool       bResult = false;

        if (PageWriteMode == WriteMode.New)
        {
            bool bDuplicate = grades.IsExist(COMP_ID, strGradeID);

            if (bDuplicate)
            {
                ltrScript.Text = JSHelper.GetAlertScript("존재하는 등급 ID 입니다.");
                return;
            }

            bResult = grades.AddEstGrade(COMP_ID
                                         , strGradeID
                                         , strGradeName
                                         , strGradeDesc
                                         , DateTime.Now
                                         , EMP_REF_ID);

            if (bResult)
            {
                GridBinding(COMP_ID);
                ButtonStatusInit();
            }
            else
            {
                ltrScript.Text = JSHelper.GetAlertScript("저장 중 오류가 발생하였습니다.");
            }
        }
        else
        {
            bResult = grades.ModifyEstGrade(COMP_ID
                                            , strGradeID
                                            , strGradeName
                                            , strGradeDesc
                                            , DateTime.Now
                                            , EMP_REF_ID);

            if (bResult)
            {
                GridBinding(COMP_ID);
                ButtonStatusInit();
            }
            else
            {
                ltrScript.Text = JSHelper.GetAlertScript("수정 중 오류가 발생하였습니다.");
            }
        }
    }
Ejemplo n.º 2
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.º 3
0
    private void ViewOne(int comp_id, string grade_id)
    {
        Biz_Grades grades = new Biz_Grades(comp_id, grade_id);

        txtGradeID.Text   = grades.Grade_ID;
        txtGradeName.Text = grades.Grade_Name;
        txtGradeDesc.Text = grades.Grade_Desc;

        hdfGradeID.Value = grade_id;
    }
Ejemplo n.º 4
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.º 5
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.º 6
0
    protected void ibnDelete_Click(object sender, ImageClickEventArgs e)
    {
        string strGradeID = hdfGradeID.Value;

        Biz_Grades grades  = new Biz_Grades();
        bool       bResult = grades.RemoveEstGrade(COMP_ID, strGradeID);

        if (bResult)
        {
            ltrScript.Text = JSHelper.GetAlertScript("정상적으로 삭제되었습니다.", false);

            GridBinding(COMP_ID);
            ButtonStatusInit();
        }
        else
        {
            ltrScript.Text = JSHelper.GetAlertScript("삭제 중 오류가 발생하였습니다.");
        }
    }
Ejemplo n.º 7
0
    protected void ibnCheckID_Click(object sender, ImageClickEventArgs e)
    {
        string strGradeID = txtGradeID.Text;

        if (strGradeID == "")
        {
            ltrScript.Text = JSHelper.GetAlertScript("등급 ID를 입력해주세요.");
            return;
        }

        Biz_Grades grades     = new Biz_Grades();
        bool       bDuplicate = grades.IsExist(COMP_ID, strGradeID);

        if (bDuplicate)
        {
            ltrScript.Text = JSHelper.GetAlertScript("존재하는 등급 ID 입니다.");
        }
        else
        {
            ltrScript.Text = JSHelper.GetAlertScript("사용가능한 등급 ID 입니다.");
        }
    }
Ejemplo n.º 8
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();
    }