Beispiel #1
0
    protected void ibnSave3_Click(object sender, ImageClickEventArgs e)
    {
        if (CheckInsertPosScale())
        {
            Biz_DeptPosScales deptPosScale = new Biz_DeptPosScales();

            int    dept_ref_id = DataTypeUtility.GetToInt32(hdfDeptRefID.Value);
            string pos_id      = WebUtility.GetByValueDropDownList(ddlPositionType);
            string pos_value   = WebUtility.GetByValueDropDownList(ddlPositionValue);
            string scale_id    = WebUtility.GetByValueDropDownList(ddlScaleID);
            bool   isOK        = false;

            try
            {
                bool isDuplicate = deptPosScale.IsExist(COMP_ID
                                                        , ESTTERM_REF_ID
                                                        , dept_ref_id
                                                        , EST_ID
                                                        , 0
                                                        , pos_id
                                                        , pos_value);

                if (isDuplicate)
                {
                    if (hdfEstPosSeq.Value.Equals(""))
                    {
                        ltrScript.Text = JSHelper.GetAlertScript("변경하실 직급 구분을 선택하세요.");
                        return;
                    }

                    isOK = deptPosScale.ModifyDeptPosScale(COMP_ID
                                                           , ESTTERM_REF_ID
                                                           , dept_ref_id
                                                           , EST_ID
                                                           , DataTypeUtility.GetToInt32(hdfEstPosSeq.Value)
                                                           , pos_id
                                                           , pos_value
                                                           , scale_id
                                                           , DateTime.Now
                                                           , EMP_REF_ID);
                }
                else
                {
                    isOK = deptPosScale.AddDeptPosScale(COMP_ID
                                                        , ESTTERM_REF_ID
                                                        , dept_ref_id
                                                        , EST_ID
                                                        , deptPosScale.NewIdx(COMP_ID, ESTTERM_REF_ID, dept_ref_id, EST_ID)
                                                        , pos_id
                                                        , pos_value
                                                        , scale_id
                                                        , DateTime.Now
                                                        , EMP_REF_ID);
                }

                if (isOK)
                {
                    GridBinding3(COMP_ID, ESTTERM_REF_ID, dept_ref_id, EST_ID);
                    hdfEstPosSeq.Value = "";
                }
                else
                {
                    ltrScript.Text = JSHelper.GetAlertScript("저장 중 오류가 발생하였습니다.");
                }
            }
            catch (Exception ex)
            {
                ltrScript.Text = JSHelper.GetAlertScript("저장 중 오류가 발생하였습니다.");
            }
        }
    }