protected void ibnSave_Click(object sender, ImageClickEventArgs e) { UltraGridRow row; Biz_DeptOpinionTgtEmps deptOpinionTgtEmp = new Biz_DeptOpinionTgtEmps(); DataTable dataTable = deptOpinionTgtEmp.GetDataTableSchema(); for (int i = 0; i < UltraWebGrid1.Rows.Count; i++) { row = UltraWebGrid1.Rows[i]; TemplatedColumn hdf_col = (TemplatedColumn)row.Band.Columns.FromKey("CTRL_EMP"); HiddenField hdfTgtEmpID = (HiddenField)((CellItem)hdf_col.CellItems[row.BandIndex]).FindControl("hdfTgtEmpID"); TemplatedColumn txt_col = (TemplatedColumn)row.Band.Columns.FromKey("CTRL_EMP"); TextBox txtTgtEmpName = (TextBox)((CellItem)txt_col.CellItems[row.BandIndex]).FindControl("txtTgtEmpName"); if (hdfTgtEmpID.Value.Equals("")) { row.Cells.FromKey("TGT_EMP_ID").Value = DBNull.Value; } else { row.Cells.FromKey("TGT_EMP_ID").Value = DataTypeUtility.GetToDouble(hdfTgtEmpID.Value); } } dataTable = UltraGridUtility.GetDataTableByAllValue(UltraWebGrid1 , new string[] { "TGT_DEPT_ID", "TGT_EMP_ID" } , dataTable); dataTable = DataTypeUtility.FilterSortDataTable(dataTable, "TGT_EMP_ID IS NOT NULL"); foreach (DataRow dataRow in dataTable.Rows) { dataRow["COMP_ID"] = COMP_ID; dataRow["EST_ID"] = EST_ID; dataRow["TGT_OPINION_YN"] = "Y"; dataRow["DATE"] = DateTime.Now; dataRow["USER"] = EMP_REF_ID; } bool isOK = deptOpinionTgtEmp.SaveDeptOpinionTgtEmp(dataTable, COMP_ID, EST_ID); if (isOK) { ltrScript.Text = JSHelper.GetAlertScript("정상적으로 의견상신 담당자를 설정하였습니다."); } else { ltrScript.Text = JSHelper.GetAlertScript("처리 중 오류가 발생하였습니다."); } }
private void BindingGrid(int comp_id, string est_id) { Biz_DeptOpinionTgtEmps deptOpinionTgtEmp = new Biz_DeptOpinionTgtEmps(); DT_TGT_OPINION = deptOpinionTgtEmp.GetDeptOpinionTgtEmp(COMP_ID, est_id).Tables[0]; DataTable dataTable = BizUtility.GetDeptTree(" "); UltraWebGrid1.DataSource = dataTable; UltraWebGrid1.DataBind(); lblRowCount.Text = dataTable.Rows.Count.ToString(); }
protected void ibnUpdateEmpRole_Click(object sender, ImageClickEventArgs e) { UltraGridRow row; Biz_EmpRoleRels empRoleRel = new Biz_EmpRoleRels(); Biz_DeptOpinionTgtEmps deptOpinionTgtEmp = new Biz_DeptOpinionTgtEmps(); DataTable dataTable = deptOpinionTgtEmp.GetDataTableSchema(); dataTable.Columns.Add("EMP_REF_ID", typeof(int)); dataTable.Columns.Add("ROLE_REF_ID", typeof(int)); for (int i = 0; i < UltraWebGrid1.Rows.Count; i++) { row = UltraWebGrid1.Rows[i]; TemplatedColumn hdf_col = (TemplatedColumn)row.Band.Columns.FromKey("CTRL_EMP"); HiddenField hdfTgtEmpID = (HiddenField)((CellItem)hdf_col.CellItems[row.BandIndex]).FindControl("hdfTgtEmpID"); if (hdfTgtEmpID.Value.Equals("")) { row.Cells.FromKey("TGT_EMP_ID").Value = DBNull.Value; } else { row.Cells.FromKey("TGT_EMP_ID").Value = DataTypeUtility.GetToDouble(hdfTgtEmpID.Value); } } dataTable = UltraGridUtility.GetDataTableByAllValue(UltraWebGrid1 , new string[] { "TGT_EMP_ID" } , dataTable); dataTable = DataTypeUtility.FilterSortDataTable(dataTable, "TGT_EMP_ID IS NOT NULL"); foreach (DataRow dataRow in dataTable.Rows) { dataRow["EMP_REF_ID"] = dataRow["TGT_EMP_ID"]; dataRow["ROLE_REF_ID"] = ROLE_REF_ID; } bool isOK = empRoleRel.SaveEmpRoleRel(dataTable, ROLE_REF_ID); if (isOK) { ltrScript.Text = JSHelper.GetAlertScript("정상적으로 의견상신 담당자 권한을 부여하였습니다."); } else { ltrScript.Text = JSHelper.GetAlertScript("부여된 권한이 없습니다."); } }
protected void Page_Load(object sender, System.EventArgs e) { COMP_ID = WebUtility.GetRequestByInt("COMP_ID"); EST_ID = WebUtility.GetRequest("EST_ID"); ESTTERM_REF_ID = WebUtility.GetRequestByInt("ESTTERM_REF_ID"); ESTTERM_SUB_ID = WebUtility.GetRequestByInt("ESTTERM_SUB_ID"); ESTTERM_STEP_ID = WebUtility.GetRequestByInt("ESTTERM_STEP_ID"); EST_DEPT_ID = WebUtility.GetRequestByInt("EST_DEPT_ID"); EST_EMP_ID = WebUtility.GetRequestByInt("EST_EMP_ID"); TGT_DEPT_ID = WebUtility.GetRequestByInt("TGT_DEPT_ID"); TGT_EMP_ID = WebUtility.GetRequestByInt("TGT_EMP_ID"); EST_TGT_TYPE = WebUtility.GetRequest("EST_TGT_TYPE", "EST"); READ_ONLY_YN = WebUtility.GetRequest("READ_ONLY_YN", "N"); _estInfos = new Biz_EstInfos(COMP_ID, EST_ID); _q_item_desc_use_yn = _estInfos.Q_Item_Desc_Use_YN; _tgt_opinion_yn = _estInfos.Tgt_Opinion_YN; _feedback_yn = _estInfos.FeedBack_YN; _tgt_send_type = BizUtility.GetTgtSendType(_tgt_opinion_yn, _feedback_yn); if (!Page.IsPostBack) { //이전평가차수질의지내용보기가 설정되어있고, 현재차수가 1차수이상일때만 divPreviousControl.Visible = false; Biz_EstInfos bizEstInfo = new Biz_EstInfos(COMP_ID, EST_ID); if (bizEstInfo.Question_Previous_Step_YN.Trim() == "Y" && ESTTERM_STEP_ID > 2) { Biz_TermStepEstMaps bizTermStepEstMap = new Biz_TermStepEstMaps(); DataSet dsTermStepMap = bizTermStepEstMap.GetTermStepEstMap(COMP_ID, EST_ID); if (dsTermStepMap.Tables[0].Rows.Count > 0) { if (dsTermStepMap.Tables[0].Select(string.Format("ESTTERM_STEP_ID > 1 AND ESTTERM_STEP_ID < {0}", ESTTERM_STEP_ID)).Length > 0) { this.IPREVIOUS_STEP_VISIBLE = true; DataRow[] drArr = dsTermStepMap.Tables[0].Select(string.Format("ESTTERM_STEP_ID > 1 AND ESTTERM_STEP_ID < {0}", ESTTERM_STEP_ID), "ESTTERM_STEP_ID ASC"); for (int i = 0; i < drArr.Length; i++) { ddlStep.Items.Insert(i, new ListItem(drArr[i]["ESTTERM_STEP_NAME"].ToString(), drArr[i]["ESTTERM_STEP_ID"].ToString())); } ddlStep.SelectedIndex = ddlStep.Items.Count - 1; //this.IESTTERM_STEP_PREVIOUS_SELECT = WebUtility.GetIntByValueDropDownList(ddlStep); divPreviousControl.Visible = true; } } } } if (READ_ONLY_YN.Equals("N")) { Biz_TermInfos termInfos = new Biz_TermInfos(ESTTERM_REF_ID); Biz_TermSubs termSubs = new Biz_TermSubs(COMP_ID, ESTTERM_SUB_ID); Biz_TermSteps termSteps = new Biz_TermSteps(COMP_ID, ESTTERM_STEP_ID); Biz_EmpInfos estEmpInfos = new Biz_EmpInfos(EST_EMP_ID); Biz_EmpInfos tgtEmpInfos = new Biz_EmpInfos(TGT_EMP_ID); Biz_DeptInfos estDeptInfo = new Biz_DeptInfos(EST_DEPT_ID); Biz_DeptInfos tgtDeptInfo = new Biz_DeptInfos(TGT_DEPT_ID); Biz_Datas data = new Biz_Datas(COMP_ID , EST_ID , ESTTERM_REF_ID , ESTTERM_SUB_ID , ESTTERM_STEP_ID , EST_DEPT_ID , EST_EMP_ID , TGT_DEPT_ID , TGT_EMP_ID); _status_style_id = _estInfos.Status_Style_ID; Biz_QuestionDeptEmpMaps questionDeptEmpMaps = new Biz_QuestionDeptEmpMaps(COMP_ID , ESTTERM_REF_ID , ESTTERM_SUB_ID , 0 , EST_ID , "" , TGT_DEPT_ID , TGT_EMP_ID , _estInfos.Owner_Type); if (questionDeptEmpMaps.Q_Obj_ID == null) { ltrScript.Text = JSHelper.GetAlertScript("피평가자(부서)에 대한 평가질의서가 매핑되지 않았습니다. 성과평가 관리자에게 문의하세요.", true); return; } // 의견상신 : X, 피드백 : O if (_tgt_send_type.Equals("FBK")) { if (EST_TGT_TYPE.Equals("EST")) { _status_id = "O"; ibnSaveOpinion.Visible = false; ibnFeedbackAgree.Visible = false; ibnFeedbackReject.Visible = false; // 창을 띄은 사람이 평가자 인지 체크 if (EST_EMP_ID == EMP_REF_ID) { ibnSaveEst.Visible = true; } else { ibnSaveEst.Visible = false; // 롤에 따른 버튼 권한이 있는지 확인 BizUtility.SetButtonVisibleCommandNameByRolID(EMP_REF_ID, ibnSaveEst); } } else if (EST_TGT_TYPE.Equals("TGT")) { _status_id = "P"; ibnSaveEst.Visible = false; ibnSaveOpinion.Visible = false; // 창을 띄은 사람이 피평가자 인지 체크 if (TGT_EMP_ID == EMP_REF_ID) { ibnFeedbackAgree.Visible = true; ibnFeedbackReject.Visible = true; } else { ibnFeedbackAgree.Visible = false; ibnFeedbackReject.Visible = false; // 롤에 따른 버튼 권한이 있는지 확인 BizUtility.SetButtonVisibleCommandNameByRolID(EMP_REF_ID, ibnFeedbackAgree); BizUtility.SetButtonVisibleCommandNameByRolID(EMP_REF_ID, ibnFeedbackReject); } if (!_status_style_id.Equals("0003")) { ltrScript.Text = JSHelper.GetAlertScript("피드백 5단계 평가으로 설정되어야 합니다.", true); return; } } } else // 그외 사항에서는 { if (EST_TGT_TYPE.Equals("EST")) { _status_id = "P"; ibnSaveOpinion.Visible = false; ibnFeedbackAgree.Visible = false; ibnFeedbackReject.Visible = false; // 창을 띄은 사람이 평가자 인지 체크 if (EST_EMP_ID == EMP_REF_ID) { ibnSaveEst.Visible = true; } else { ibnSaveEst.Visible = false; // 롤에 따른 버튼 권한이 있는지 확인 BizUtility.SetButtonVisibleCommandNameByRolID(EMP_REF_ID, ibnSaveEst); } } else if (EST_TGT_TYPE.Equals("TGT")) { _status_id = "O"; ibnSaveEst.Visible = false; ibnFeedbackAgree.Visible = false; ibnFeedbackReject.Visible = false; // 창을 띄은 사람이 피평가자 인지 체크 Biz_DeptOpinionTgtEmps deptOpinionTgtEmp = new Biz_DeptOpinionTgtEmps(); DataTable dataTable = deptOpinionTgtEmp.GetDeptOpinionTgtEmp(COMP_ID , EST_ID , EMP_REF_ID).Tables[0]; if (dataTable.Rows.Count > 0) { if (TGT_DEPT_ID == DataTypeUtility.GetToInt32(dataTable.Rows[0]["TGT_DEPT_ID"])) { ibnSaveOpinion.Visible = true; } else { ibnSaveOpinion.Visible = false; // 롤에 따른 버튼 권한이 있는지 확인 BizUtility.SetButtonVisibleCommandNameByRolID(EMP_REF_ID, ibnSaveOpinion); } } else { ibnSaveOpinion.Visible = false; } if (!_status_style_id.Equals("0002")) { ltrScript.Text = JSHelper.GetAlertScript("의견상신 5단계 평가으로 설정되어야 합니다.", true); return; } } } if (data.Status_ID.Equals("E")) { ibnSaveEst.Visible = false; ibnSaveOpinion.Visible = false; ibnFeedbackAgree.Visible = false; ibnFeedbackReject.Visible = false; } Q_OBJ_ID = questionDeptEmpMaps.Q_Obj_ID; EST_NAME = _estInfos.Est_Name; ESTTERM_REF_NAME = termInfos.EstTerm_Name; ESTTERM_SUB_NAME = termSubs.EstTerm_Sub_Name; ESTTERM_STEP_NAME = termSteps.EstTerm_Step_Name; EST_EMP_NAME = estEmpInfos.Emp_Name; TGT_EMP_NAME = tgtEmpInfos.Emp_Name; EST_DEPT_NAME = estDeptInfo.Dept_Name; TGT_DEPT_NAME = tgtDeptInfo.Dept_Name; } else { Q_OBJ_ID = WebUtility.GetRequest("Q_OBJ_ID"); ibnSaveEst.Visible = false; ibnSaveOpinion.Visible = false; ibnFeedbackAgree.Visible = false; ibnFeedbackReject.Visible = false; } if (!Page.IsPostBack) { DataListBinding(); DoBindingPreviousStepQeustion(); ibnSaveEst.Attributes.Add("onclick", "if(confirm('평가내용을 저장하시겠습니까?')) return ConfirmQuesiton();else return false;"); ibnSaveOpinion.Attributes.Add("onclick", "return confirm('평가자에게 의견을 상신하시겠습니까?');"); ibnFeedbackAgree.Attributes.Add("onclick", "return confirm('평가질의에 동의하십니까?');"); ibnFeedbackReject.Attributes.Add("onclick", "return confirm('평가질의에 거절하십니까?');"); } ltrScript.Text = ""; }