private void AddCtrlEstDeptData() { Biz_CtrlDeptMaps ctrlEstDeptMap = new Biz_CtrlDeptMaps(); DataTable dataTable = ctrlEstDeptMap.GetDataTableSchema(); string[] dept_ref_id_values = hdfDeptRefIDArr.Value.Split(','); foreach (string dept_ref_id in dept_ref_id_values) { DataRow dataRow = null; dataRow = dataTable.NewRow(); dataRow["CTRL_ID"] = CTRL_ID; dataRow["COMP_ID"] = COMP_ID; dataRow["DEPT_REF_ID"] = dept_ref_id; dataRow["DATE"] = DateTime.Now; dataRow["USER"] = EMP_REF_ID; dataTable.Rows.Add(dataRow); } bool isOK = ctrlEstDeptMap.AddCtrlEstDeptMap(dataTable); if (isOK) { BindCtrlEstDeptInfo(CTRL_ID); } else { ltrScript.Text = JSHelper.GetAlertScript("부서 추가에 실패하였습니다.", false); } }
private void BindCtrlEstDeptInfo(string ctrl_id) { uwgCtrlEstDeptMap.Clear(); Biz_CtrlDeptMaps ctrlEstDeptMap = new Biz_CtrlDeptMaps(); DataSet ds = ctrlEstDeptMap.GetCtrlEstDeptMap(ctrl_id); uwgCtrlEstDeptMap.DataSource = ds; uwgCtrlEstDeptMap.DataBind(); }
protected void ibnDeleteCtrlEstDeptMap_Click(object sender, ImageClickEventArgs e) { Biz_CtrlDeptMaps ctrlEstDeptMap = new Biz_CtrlDeptMaps(); DataTable dataTable = ctrlEstDeptMap.GetDataTableSchema(); dataTable = UltraGridUtility.GetDataTableByCheckValue(uwgCtrlEstDeptMap , "cBox" , "selchk" , new string[] { "CTRL_ID", "DEPT_REF_ID" } , dataTable); bool isOK = ctrlEstDeptMap.RemoveCtrlEstDeptMap(dataTable); if (isOK) { BindCtrlEstDeptInfo(CTRL_ID); } else { ltrScript.Text = JSHelper.GetAlertScript("삭제할 항목을 선택주세요.", false); } }