protected void lbnSavePOS_Click(object sender, EventArgs e) { Biz_DeptPosDetails deptPosDetail = new Biz_DeptPosDetails(); Biz_DeptInfos deptInfo = new Biz_DeptInfos(); DataTable dataTable = deptPosDetail.GetDataTableSchema(); DataTable dtDept = deptInfo.GetDataTableSchema(); DataRow drRow = null; string[] dept_values = hdfDeptID.Value.Split(','); dataTable = UltraGridUtility.GetDataTableByAllValue(UltraWebGrid3 , new string[] { "SEQ", "POS_ID", "POS_VALUE", "WEIGHT" } , dataTable); foreach (string dept_value in dept_values) { drRow = dtDept.NewRow(); drRow["DEPT_REF_ID"] = DataTypeUtility.GetToInt32(dept_value); dtDept.Rows.Add(drRow); } if (dataTable.Rows.Count == 0) { ltrScript.Text = JSHelper.GetAlertScript("적용하려는 부서별 가중치가 없습니다."); return; } foreach (DataRow dataRow in dataTable.Rows) { dataRow["COMP_ID"] = COMP_ID; dataRow["EST_ID"] = EST_ID; dataRow["ESTTERM_REF_ID"] = ESTTERM_REF_ID; dataRow["DATE"] = DateTime.Now; dataRow["USER"] = EMP_REF_ID; } bool isOK = deptPosDetail.SaveDeptPosDetailAll(dtDept, dataTable); if (isOK) { ltrScript.Text = JSHelper.GetAlertScript("선택 부서의 가중치를 일괄 적용하였습니다."); GridBinding22(COMP_ID, ESTTERM_REF_ID, EST_ID); UltraWebGrid3.Clear(); hdfDeptID.Value = ""; } else { ltrScript.Text = JSHelper.GetAlertScript("정상적으로 처리 않았습니다."); } }
private void GridBinding22(int comp_id, int estterm_ref_id, string est_id) { Biz_DeptEstDetails deptEstDetail = new Biz_DeptEstDetails(); _dtEstDetail = deptEstDetail.GetDeptEstDetail(comp_id, estterm_ref_id, 0, est_id).Tables[0]; Biz_DeptPosDetails deptPosDetail = new Biz_DeptPosDetails(); _dtPosDetail = deptPosDetail.GetDeptPosDetail(comp_id, estterm_ref_id, 0, est_id).Tables[0]; UltraWebGrid2.Clear(); UltraWebGrid2.DataSource = BizUtility.GetDeptTree(" "); UltraWebGrid2.DataBind(); }
private void GridBinding3(int comp_id, int estterm_ref_id, int dept_ref_id, string est_id) { if (dept_ref_id == 0) { return; } Biz_DeptPosDetails deptPosDetail = new Biz_DeptPosDetails(); _dtPosDetail = deptPosDetail.GetDeptPosDetail(comp_id, estterm_ref_id, dept_ref_id, est_id).Tables[0]; UltraWebGrid3.Clear(); UltraWebGrid3.DataSource = _dtPosDetail; UltraWebGrid3.DataBind(); }
protected void ibnInit2_Click(object sender, ImageClickEventArgs e) { Biz_DeptPosDetails deptPosDetail = new Biz_DeptPosDetails(); Biz_DeptInfos deptInfo = new Biz_DeptInfos(); DataTable dataTable = deptPosDetail.GetDataTableSchema(); DataTable dtDept = deptInfo.GetDataTableSchema(); dtDept.Columns.Add("COMP_ID", typeof(int)); dtDept.Columns.Add("EST_ID", typeof(string)); dtDept.Columns.Add("ESTTERM_REF_ID", typeof(int)); dtDept = UltraGridUtility.GetDataTableByCheckValue(UltraWebGrid2 , "cBox" , "selchk" , new string[] { "DEPT_REF_ID" } , dtDept); if (dtDept.Rows.Count == 0) { ltrScript.Text = JSHelper.GetAlertScript("초기화하려는 부서를 선택하세요."); return; } foreach (DataRow dataRow in dtDept.Rows) { dataRow["COMP_ID"] = COMP_ID; dataRow["EST_ID"] = EST_ID; dataRow["ESTTERM_REF_ID"] = ESTTERM_REF_ID; } bool isOK = deptPosDetail.InitDept(dtDept); if (isOK) { ltrScript.Text = JSHelper.GetAlertScript("정상적으로 선택부서를 초기화 하였습니다."); GridBinding22(COMP_ID, ESTTERM_REF_ID, EST_ID); UltraWebGrid3.Clear(); } else { ltrScript.Text = JSHelper.GetAlertScript("정상적으로 처리 않았습니다."); } }
protected void ibnSavePosAll_Click(object sender, ImageClickEventArgs e) { Biz_DeptPosDetails deptPosDetail = new Biz_DeptPosDetails(); Biz_DeptInfos deptInfo = new Biz_DeptInfos(); DataTable dataTable = deptPosDetail.GetDataTableSchema(); DataTable dtDept = deptInfo.GetDataTableSchema(); dataTable = UltraGridUtility.GetDataTableByAllValue(UltraWebGrid3 , new string[] { "SEQ", "POS_ID", "POS_VALUE", "WEIGHT" } , dataTable); dtDept = UltraGridUtility.GetDataTableByAllValue(UltraWebGrid2 , new string[] { "DEPT_REF_ID" } , dtDept); if (dataTable.Rows.Count == 0) { ltrScript.Text = JSHelper.GetAlertScript("적용하려는 부서별 가중치가 없습니다."); return; } foreach (DataRow dataRow in dataTable.Rows) { dataRow["COMP_ID"] = COMP_ID; dataRow["EST_ID"] = EST_ID; dataRow["ESTTERM_REF_ID"] = ESTTERM_REF_ID; dataRow["DATE"] = DateTime.Now; dataRow["USER"] = EMP_REF_ID; } bool isOK = deptPosDetail.SaveDeptPosDetailAll(dtDept, dataTable); if (isOK) { ltrScript.Text = JSHelper.GetAlertScript("모든 부서의 가중치를 일괄 적용하였습니다."); GridBinding22(COMP_ID, ESTTERM_REF_ID, EST_ID); UltraWebGrid3.Clear(); } else { ltrScript.Text = JSHelper.GetAlertScript("정상적으로 처리 않았습니다."); } }
protected void ibnRemove_Click(object sender, ImageClickEventArgs e) { Biz_DeptPosDetails deptPosDetail = new Biz_DeptPosDetails(); DataTable dataTable = deptPosDetail.GetDataTableSchema(); dataTable = UltraGridUtility.GetDataTableByCheckValue(UltraWebGrid3 , "cBox" , "selchk" , new string[] { "DEPT_REF_ID", "SEQ" } , dataTable); if (dataTable.Rows.Count == 0) { ltrScript.Text = JSHelper.GetAlertScript("삭제하려는 항목을 선택하세요."); return; } foreach (DataRow dataRow in dataTable.Rows) { dataRow["COMP_ID"] = COMP_ID; dataRow["EST_ID"] = EST_ID; dataRow["ESTTERM_REF_ID"] = ESTTERM_REF_ID; } bool isOK = deptPosDetail.RemoveDeptPosDetail(dataTable); if (isOK) { GridBinding3(COMP_ID, ESTTERM_REF_ID, DataTypeUtility.GetToInt32(hdfEstPosEstDeptRefID.Value), EST_ID); ClearControlValues(); ltrScript.Text = JSHelper.GetAlertScript("정상적으로 처리되었습니다."); } else { ltrScript.Text = JSHelper.GetAlertScript("정상적으로 처리되지 않았습니다."); } }
private string GetWeightName(string est_id, string weight_type, ref string weight) { string reVal = "<b>가중치</b><br>"; string weight_name = string.Empty; if (weight_type.Equals("DPT")) { DataRow[] rows = DS_DETAIL.Tables[0].Select(string.Format(" EST_ID = '{0}' ", est_id)); if (rows.Length > 0) { weight = (rows[0]["WEIGHT"].ToString().Equals("")) ? "" : rows[0]["WEIGHT"].ToString(); } else { weight = ""; } if (weight.Equals("")) { weight_name = ""; } else { weight_name = " 부서:" + weight + "%"; } } else if (weight_type.Equals("POS")) { Biz_DeptPosDetails biz = new Biz_DeptPosDetails(); DataSet ds = biz.GetDeptPosDetail(COMP_ID , ESTTERM_REF_ID , DataTypeUtility.GetToInt32(TreeView1.SelectedNode.Value) , est_id); if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow row in ds.Tables[0].Rows) { string no = " " + row["SEQ"].ToString() + "."; string pos_id = GetPosName(row["POS_ID"].ToString(), row["POS_VALUE"].ToString()); weight = (row["WEIGHT"].ToString().Equals("")) ? "" : row["WEIGHT"].ToString() + "%" + "<br>"; weight_name += no + pos_id + weight; } } else { weight_name = ""; } } reVal += weight_name; if (reVal.Equals("<b>가중치</b><br>")) { return(""); } return(reVal); }
protected void UltraWebGrid1_InitializeLayout(object sender, LayoutEventArgs e) { UltraGridUtility.CreateColumns((UltraWebGrid)sender , COMP_ID , EST_ID , DEFAULT_INDEX_COUNT , out DT_COLUMN_INFO , (OwnerTypeMode == OwnerType.Dept) ? "D" : "P" , EST_JOB_IDS.Split(',') , DEPT_COLUMN_NO_USE_YN); if (e.Layout.Bands[0].Columns.Exists("selchk")) { if (!e.Layout.Bands[0].Columns.FromKey("selchk").Hidden) { e.Layout.Bands[0].Columns.FromKey("selchk").Hidden = true; } } // 가중치 컬럼을 사용할 경우 if (COL_WEIGHT_VISIBLE_YN.Equals("Y") || COL_GRADE_VISIBLE_YN.Equals("Y")) { Biz_DeptEstDetails deptEstDetail = null; Biz_DeptPosDetails deptPosDetail = null; DataTable dtDeptDetail = null; DataRow[] drArrColumn = DT_COLUMN_INFO.Select(@"COL_STYLE_ID = 'BIZ' AND VISIBLE_YN = 'Y'"); foreach (DataRow drColumn in drArrColumn) { if (drColumn["COL_KEY"].ToString().IndexOf("WEIGHT_") < 0) { continue; } string est_id = drColumn["COL_KEY"].ToString().Replace("WEIGHT_", ""); Biz_EstInfos estSubInfo = new Biz_EstInfos(COMP_ID, est_id); if (estSubInfo.Weight_Type != null && estSubInfo.Weight_Type.Equals("DPT")) { deptEstDetail = new Biz_DeptEstDetails(); dtDeptDetail = deptEstDetail.GetDeptEstDetail(COMP_ID, ESTTERM_REF_ID, 0, est_id).Tables[0]; } else if (estSubInfo.Weight_Type != null && estSubInfo.Weight_Type.Equals("POS")) { deptPosDetail = new Biz_DeptPosDetails(); dtDeptDetail = deptPosDetail.GetDeptPosDetail(COMP_ID, ESTTERM_REF_ID, 0, est_id).Tables[0]; } if (DT_DEPT_EST_POS_DETAIL == null) { DT_DEPT_EST_POS_DETAIL = dtDeptDetail; } else { DT_DEPT_EST_POS_DETAIL.Merge(dtDeptDetail); } } } e.Layout.ClientSideEvents.MouseOverHandler = RPT_DTL_ID + e.Layout.ClientSideEvents.MouseOverHandler; e.Layout.ClientSideEvents.DblClickHandler = RPT_DTL_ID + e.Layout.ClientSideEvents.DblClickHandler; }
protected void ibnSave3_Click(object sender, ImageClickEventArgs e) { if (CheckInsertWeightPos()) { Biz_DeptPosDetails deptPosDetail = new Biz_DeptPosDetails(); int estterm_ref_id = ESTTERM_REF_ID; int dept_ref_id = DataTypeUtility.GetToInt32(hdfDeptRefID.Value); string est_id = EST_ID; string pos_id = WebUtility.GetByValueDropDownList(ddlPositionType); string pos_value = WebUtility.GetByValueDropDownList(ddlPositionValue); float weight = DataTypeUtility.GetToFloat(txtWeightPos.Text.Trim()); bool isOK = false; try { bool isDuplicate = deptPosDetail.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 = deptPosDetail.ModifyDeptPosDetail(COMP_ID , estterm_ref_id , dept_ref_id , est_id , DataTypeUtility.GetToInt32(hdfEstPosSeq.Value) , pos_id , pos_value , weight , DateTime.Now , EMP_REF_ID); } else { isOK = deptPosDetail.AddDeptPosDetail(COMP_ID , estterm_ref_id , dept_ref_id , est_id , deptPosDetail.NewIdx(COMP_ID, estterm_ref_id, dept_ref_id, est_id) , pos_id , pos_value , weight , DateTime.Now , EMP_REF_ID); } if (isOK) { GridBinding3(COMP_ID, ESTTERM_REF_ID, dept_ref_id, EST_ID); ClearControlValues(); } else { ltrScript.Text = JSHelper.GetAlertScript("저장 중 오류가 발생하였습니다."); } } catch (Exception ex) { ltrScript.Text = JSHelper.GetAlertScript("저장 중 오류가 발생하였습니다."); } } }
protected void ibnSave_Click(object sender, ImageClickEventArgs e) { if (ESTTERM_REF_ID_FROM == ESTTERM_REF_ID_TO && ESTTERM_SUB_ID_FROM == ESTTERM_SUB_ID_TO) { ltrScript.Text = JSHelper.GetAlertScript("기준대상과 피참조대상의 기간이 같습니다. 다시 설정하세요."); return; } bool isOK = false; if (TYPE.Equals("1")) { if (ESTTERM_REF_ID_FROM == ESTTERM_REF_ID_TO) { ltrScript.Text = JSHelper.GetAlertScript("기준대상과 피참조대상의 기간이 같습니다. 다시 설정하세요."); return; } Biz_DeptEstDetails deptEstDetail = new Biz_DeptEstDetails(); Biz_DeptPosScales deptPosScale = new Biz_DeptPosScales(); isOK = deptEstDetail.CopyDataFromTo(COMP_ID , ESTTERM_REF_ID_FROM , ESTTERM_REF_ID_TO , DateTime.Now , EMP_REF_ID); if (isOK) { deptPosScale.CopyDataFromTo(COMP_ID , ESTTERM_REF_ID_FROM , ESTTERM_REF_ID_TO , DateTime.Now , EMP_REF_ID); } } else if (TYPE.Equals("2")) { if (ESTTERM_REF_ID_FROM == ESTTERM_REF_ID_TO) { ltrScript.Text = JSHelper.GetAlertScript("기준대상과 피참조대상의 기간이 같습니다. 다시 설정하세요."); return; } Biz_DeptPosDetails deptPosScale = new Biz_DeptPosDetails(); isOK = deptPosScale.CopyDataFromTo(COMP_ID , ESTTERM_REF_ID_FROM , ESTTERM_REF_ID_TO , DateTime.Now , EMP_REF_ID); } else if (TYPE.Equals("3")) { if (ESTTERM_REF_ID_FROM == ESTTERM_REF_ID_TO) { ltrScript.Text = JSHelper.GetAlertScript("기준대상과 피참조대상의 기간이 같습니다. 다시 설정하세요."); return; } Biz_RelGroupInfos relGroupInfo = new Biz_RelGroupInfos(); isOK = relGroupInfo.CopyDataFromTo(COMP_ID , ESTTERM_REF_ID_FROM , ESTTERM_REF_ID_TO , DateTime.Now , EMP_REF_ID); } else if (TYPE.Equals("4")) { Biz_EmpEstTargetMaps empEstTgtMap = new Biz_EmpEstTargetMaps(); isOK = empEstTgtMap.CopyDataFromTo(COMP_ID , "" , ESTTERM_REF_ID_FROM , ESTTERM_SUB_ID_FROM , ESTTERM_STEP_ID_FROM , ESTTERM_REF_ID_TO , ESTTERM_SUB_ID_TO , ESTTERM_STEP_ID_TO , DateTime.Now , EMP_REF_ID); } else if (TYPE.Equals("5")) { if (ESTTERM_REF_ID_FROM == ESTTERM_REF_ID_TO && ESTTERM_SUB_ID_FROM == ESTTERM_SUB_ID_TO) { ltrScript.Text = JSHelper.GetAlertScript("기준대상과 피참조대상의 기간이 같습니다. 다시 설정하세요."); return; } Biz_QuestionDeptEmpMaps questionDeptEmp = new Biz_QuestionDeptEmpMaps(); isOK = questionDeptEmp.CopyEstDataFromTo(COMP_ID , ESTTERM_REF_ID_FROM , ESTTERM_SUB_ID_FROM , ESTTERM_REF_ID_TO , ESTTERM_SUB_ID_TO , DateTime.Now , EMP_REF_ID); } if (isOK) { ltrScript.Text = JSHelper.GetAlertScript("정상적으로 데이터가 참조되었습니다."); } else { ltrScript.Text = JSHelper.GetAlertScript("참조 중 오류가 발생하였습니다."); } }