/// <summary> /// 삭제처리 /// </summary> /// <param name="obj"></param> private void OnDelete(object obj) { //0.삭제전 체크 Hashtable param = new Hashtable(); param.Add("sqlId", "SelectFileMapList"); param.Add("sqlId2", "SelectFileMapList"); param.Add("CNT_NUM", Dtl.CNT_NUM); Hashtable result = BizUtil.SelectLists(param); DataTable dt = new DataTable(); DataTable dt2 = new DataTable(); /* * try * { * dt = result["dt"] as DataTable; * if (dt.Rows.Count > 0) * { * Messages.ShowErrMsgBox("사진첨부내역이 존재합니다."); * return; * } * } * catch (Exception) { } * try * { * dt2 = result["dt2"] as DataTable; * if (dt2.Rows.Count > 0) * { * Messages.ShowInfoMsgBox("파일첨부내역이 존재합니다."); * return; * } * } * catch (Exception) { } */ // 1.삭제처리 if (Messages.ShowYesNoMsgBox("급수전대장을 삭제하시겠습니까?") != MessageBoxResult.Yes) { return; } try { BizUtil.Update2(Dtl, "deleteSplyDtl"); } catch (Exception) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다."); return; } Messages.ShowOkMsgBox(); BackCommand.Execute(null); }
/// <summary> /// 삭제처리 /// </summary> /// <param name="obj"></param> private void OnDelete(object obj) { //0.삭제전 체크 Hashtable param = new Hashtable(); param.Add("sqlId", "SelectFileMapList"); param.Add("FTR_CDE", this.FTR_CDE); param.Add("FTR_IDN", this.FTR_IDN); param.Add("BIZ_ID", string.Concat(this.FTR_CDE, this.FTR_IDN)); Hashtable result = BizUtil.SelectLists(param); DataTable dt = new DataTable(); try { dt = result["dt"] as DataTable; if (dt.Rows.Count > 0) { Messages.ShowInfoMsgBox("파일첨부내역이 존재합니다."); return; } } catch (Exception) { } // 1.삭제처리 if (Messages.ShowYesNoMsgBox("블록을 삭제하시겠습니까?") != MessageBoxResult.Yes) { return; } try { BizUtil.Update2(this.FctDtl, "deleteBlk03Dtl"); } catch (Exception) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다."); return; } // 2.위치정보 삭제처리 ContentControl cctl = uC_BLKS_AS.Parent as ContentControl; EditWinViewModel editWinViewModel = ((((cctl.Parent as Grid).Parent as Grid).Parent as Grid).Parent as Window).DataContext as EditWinViewModel; editWinViewModel.OnDelCmd(null); //Messages.ShowOkMsgBox(); //InitModel(); }
/// <summary> /// 삭제처리 /// </summary> /// <param name="obj"></param> private void OnDelete(object obj) { //0.삭제전 체크 Hashtable param = new Hashtable(); param.Add("sqlId", "SelectFileMapList"); param.Add("FTR_CDE", Dtl.FTR_CDE); param.Add("FTR_IDN", Dtl.FTR_IDN); param.Add("BIZ_ID", string.Concat(Dtl.FTR_CDE, Dtl.FTR_IDN)); Hashtable result = BizUtil.SelectLists(param); DataTable dt = new DataTable(); //try //{ // dt = result["dt"] as DataTable; // if (dt.Rows.Count > 0) // { // Messages.ShowInfoMsgBox("파일첨부내역이 존재합니다."); // return; // } //} //catch (Exception) { } // 1.삭제처리 if (Messages.ShowYesNoMsgBox("블록을 삭제하시겠습니까?") != MessageBoxResult.Yes) { return; } try { BizUtil.Update2(Dtl, "deleteBlk01Dtl"); } catch (Exception e) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다." + e.Message); return; } Messages.ShowOkMsgBox(); BackCommand.Execute(null); }
/// <summary> /// 삭제처리 /// </summary> /// <param name="obj"></param> private void OnDelete(object obj) { //0.삭제전 체크 Hashtable param = new Hashtable(); param.Add("sqlId", "selectChscResSubList"); param.Add("sqlId2", "SelectFileMapList"); param.Add("FTR_CDE", this.FTR_CDE); param.Add("FTR_IDN", this.FTR_IDN); param.Add("BIZ_ID", string.Concat(this.FTR_CDE, this.FTR_IDN)); Hashtable result = BizUtil.SelectLists(param); DataTable dt = new DataTable(); DataTable dt2 = new DataTable(); try { dt = result["dt"] as DataTable; if (dt.Rows.Count > 0) { Messages.ShowInfoMsgBox("유지보수내역이 존재합니다."); return; } } catch (Exception) { } // 1.삭제처리 if (Messages.ShowYesNoMsgBox("상수맨홀를 삭제하시겠습니까?") != MessageBoxResult.Yes) { return; } try { dt2 = result["dt2"] as DataTable; if (dt2.Rows.Count > 0) { //Messages.ShowInfoMsgBox("파일첨부내역이 존재합니다."); //return; //첨부파일삭제 foreach (DataRow row in dt2.Rows) { //a.FIL_SEQ 첨부파일삭제 BizUtil.DelFileSeq(row["FIL_SEQ"]); //b.FILE_MAP 업무파일매핑삭제 param = new Hashtable(); param.Add("sqlId", "DeleteFileMap"); param.Add("BIZ_ID", FTR_CDE + FTR_IDN); param.Add("FIL_SEQ", row["FIL_SEQ"]); BizUtil.Update(param); } } } catch (Exception) { } try { BizUtil.Update2(this, "deleteWtsMnhoDtl"); } catch (Exception) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다."); return; } Messages.ShowOkMsgBox(); BackCommand.Execute(null); }
/// <summary> /// 삭제처리 /// </summary> /// <param name="obj"></param> private void OnDelete(object obj) { //0.삭제전 체크 Hashtable param = new Hashtable(); param.Add("sqlId", "selectChscResSubList"); param.Add("sqlId2", "SelectFileMapList"); param.Add("sqlId3", "selectWttRsrvHt"); param.Add("FTR_CDE", this.FTR_CDE); param.Add("FTR_IDN", this.FTR_IDN); param.Add("BIZ_ID", string.Concat(this.FTR_CDE, this.FTR_IDN)); Hashtable result = BizUtil.SelectLists(param); DataTable dt = new DataTable(); DataTable dt2 = new DataTable(); DataTable dt3 = new DataTable(); try { dt = result["dt"] as DataTable; if (dt.Rows.Count > 0) { Messages.ShowInfoMsgBox("유지보수내역이 존재합니다."); return; } } catch (Exception) { } // 1.삭제처리 if (Messages.ShowYesNoMsgBox("저수조를 삭제하시겠습니까?") != MessageBoxResult.Yes) { return; } try { dt2 = result["dt2"] as DataTable; if (dt2.Rows.Count > 0) { //Messages.ShowInfoMsgBox("파일첨부내역이 존재합니다."); //return; foreach (DataRow row in dt2.Rows) { //a.FIL_SEQ 첨부파일삭제 BizUtil.DelFileSeq(row["FIL_SEQ"]); //b.FILE_MAP 업무파일매핑삭제 param = new Hashtable(); param.Add("sqlId", "DeleteFileMap"); param.Add("BIZ_ID", FTR_CDE + FTR_IDN); param.Add("FIL_SEQ", row["FIL_SEQ"]); BizUtil.Update(param); } } } catch (Exception) { } try { dt3 = result["dt3"] as DataTable; if (dt3.Rows.Count > 0) { //Messages.ShowInfoMsgBox("청소이력이 존재합니다."); //return; WttRsrvHtDtl dtl = new WttRsrvHtDtl(); dtl.FTR_CDE = FTR_CDE; dtl.FTR_IDN = Convert.ToInt32(FTR_IDN); BizUtil.Update2(dtl, "deleteWttRsrvHt"); } } catch (Exception) { } try { BizUtil.Update2(this.FctDtl, "deleteWtrTrkDtl"); } catch (Exception e) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다." + e.Message); return; } // 2.위치정보 삭제처리 ContentControl cctl = uC_RSRV_PS.Parent as ContentControl; EditWinViewModel editWinViewModel = ((((cctl.Parent as Grid).Parent as Grid).Parent as Grid).Parent as Window).DataContext as EditWinViewModel; editWinViewModel.OnDelCmd(null); //Messages.ShowOkMsgBox(); //InitModel(); }
/// <summary> /// 삭제처리 /// </summary> /// <param name="obj"></param> private void OnDelete(object obj) { //0.삭제전 체크 Hashtable param = new Hashtable(); param.Add("sqlId", "SelectWttCostDtList"); //공사비지급내역 param.Add("sqlId2", "SelectWttChngDtList"); //설계변경내역 param.Add("sqlId3", "SelectWttSubcDtList"); //공사하도급내역 param.Add("sqlId4", "SelectWttFlawDtList"); //하자보수목록 param.Add("sqlId5", "SelectFileMapList"); //첨부파일사진목록 param.Add("CNT_NUM", Dtl.CNT_NUM); param.Add("BIZ_ID", Dtl.CNT_NUM); Hashtable result = BizUtil.SelectLists(param); DataTable dt = new DataTable(); DataTable dt2 = new DataTable(); DataTable dt3 = new DataTable(); DataTable dt4 = new DataTable(); DataTable dt5 = new DataTable(); /* * try * { * dt = result["dt"] as DataTable; * if (dt.Rows.Count > 0) * { * Messages.ShowErrMsgBox("공사비지급내역이 존재합니다."); * //return; * } * } * catch (Exception) { } * try * { * dt2 = result["dt2"] as DataTable; * if (dt2.Rows.Count > 0) * { * Messages.ShowErrMsgBox("설계변경내역이 존재합니다."); * //return; * } * } * catch (Exception) { } * try * { * dt3 = result["dt3"] as DataTable; * if (dt3.Rows.Count > 0) * { * Messages.ShowErrMsgBox("공사하도급내역이 존재합니다."); * //return; * } * } * catch (Exception) { } * try * { * dt4 = result["dt4"] as DataTable; * if (dt3.Rows.Count > 0) * { * Messages.ShowErrMsgBox("하자보수내역이 존재합니다."); * //return; * } * } * catch (Exception) { } * try * { * dt5 = result["dt5"] as DataTable; * if (dt5.Rows.Count > 0) * { * Messages.ShowErrMsgBox("첨부파일/사진 내역이 존재합니다."); * //return; * } * } * catch (Exception) { } */ // 1.삭제처리 if (Messages.ShowYesNoMsgBox("공사대장을 삭제하시겠습니까?") != MessageBoxResult.Yes) { return; } try { //1.공사비지급내역 삭제 param = new Hashtable(); param.Add("sqlId", "DeleteWttCostDt"); param.Add("CNT_NUM", Dtl.CNT_NUM); BizUtil.Update(param); //2.설계변경내역 삭제 param = new Hashtable(); param.Add("sqlId", "DeleteWttChngDt"); param.Add("CNT_NUM", Dtl.CNT_NUM); BizUtil.Update(param); //3.공사하도급내역 삭제 param = new Hashtable(); param.Add("sqlId", "DeleteWttSubcDt"); param.Add("CNT_NUM", Dtl.CNT_NUM); BizUtil.Update(param); //4.하자보수내역 삭제 param = new Hashtable(); param.Add("sqlId", "DeleteWttFlawDt"); param.Add("CNT_NUM", Dtl.CNT_NUM); BizUtil.Update(param); //5.첨부파일,사진삭제 foreach (DataRow row in dt5.Rows) { //a.FIL_SEQ 첨부파일삭제 BizUtil.DelFileSeq(row["FIL_SEQ"]); //b.FILE_MAP 업무파일매핑삭제 param = new Hashtable(); param.Add("sqlId", "DeleteFileMap"); param.Add("BIZ_ID", Dtl.CNT_NUM); param.Add("FIL_SEQ", row["FIL_SEQ"]); BizUtil.Update(param); } //마스터삭제 BizUtil.Update2(Dtl, "deleteCnstMngDtl"); } catch (Exception) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다."); return; } Messages.ShowOkMsgBox(); BackCommand.Execute(null); }
/// <summary> /// 생성자 /// </summary> public ChkSchDtlViewModel() { this.LoadedCommand = new DelegateCommand <object>(delegate(object obj) { // 0.화면객체인스턴스화 if (obj == null) { return; } chkSchDtlView = obj as ChkSchDtlView; cbMNG_CDE = chkSchDtlView.cbMNG_CDE; cbSCL_CDE = chkSchDtlView.cbSCL_CDE; btnDelete = chkSchDtlView.btnDelete; btnSave = chkSchDtlView.btnSave; btnClose = chkSchDtlView.btnClose; GrdLst = new ObservableCollection <ChscResultDtl>(); //2.화면데이터객체 초기화 InitDataBinding(); //3.권한처리 permissionApply(); //4.초기조히 initModel(); }); //점검저장 this.SaveCommand = new DelegateCommand <object>(delegate(object obj) { // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행) if (!BizUtil.ValidReq(chkSchDtlView)) { return; } if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes) { return; } try { //다큐먼트 별로로 세팅 Dtl.CHK_CTNT = new TextRange(chkSchDtlView.richBox.Document.ContentStart, chkSchDtlView.richBox.Document.ContentEnd).Text.Trim(); BizUtil.Update2(Dtl, "SaveChscMaDtl"); } catch (Exception) { Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다."); return; } Messages.ShowOkMsgBox(); //화면닫기 btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); }); //점검삭제 this.DeleteCommand = new DelegateCommand <object>(delegate(object obj) { //0.삭제전 체크 Hashtable param = new Hashtable(); param.Add("sqlId", "SelectChscResultList"); param.Add("SCL_NUM", Dtl.SCL_NUM); Hashtable result = BizUtil.SelectLists(param); DataTable dt = new DataTable(); try { dt = result["dt"] as DataTable; if (dt.Rows.Count > 0) { //Messages.ShowErrMsgBox("점검시설물이 존재합니다."); //return; foreach (DataRow row in dt.Rows) { //0.점검사진삭제 //a.FIL_SEQ 첨부파일삭제 BizUtil.DelFileSeq(row["FIL_SEQ"]); //b.FILE_MAP 업무파일매핑삭제 param = new Hashtable(); param.Add("sqlId", "DeleteFileMap"); param.Add("BIZ_ID", row["FTR_CDE"].ToString() + row["FTR_IDN"].ToString()); param.Add("FIL_SEQ", row["FIL_SEQ"]); BizUtil.Update(param); //0.소모품삭제 PdjtHtDtl dtl = new PdjtHtDtl(); dtl.SCL_NUM = Convert.ToInt32(row["SCL_NUM"]); dtl.FTR_CDE = row["FTR_CDE"].ToString(); dtl.FTR_IDN = Convert.ToInt32(row["FTR_IDN"]); dtl.SEQ = Convert.ToInt32(row["SEQ"]); BizUtil.Update2(dtl, "DeletePdjtHt"); //1.데이터삭제 param.Clear(); param.Add("SCL_NUM", row["SCL_NUM"]); param.Add("FTR_CDE", row["FTR_CDE"]); param.Add("FTR_IDN", Convert.ToInt32(row["FTR_IDN"])); param.Add("sqlId", "DeleteChscResult"); param.Add("SEQ", Convert.ToInt32(row["SEQ"])); BizUtil.Update(param); } } } catch (Exception) { } // 1.삭제처리 if (Messages.ShowYesNoMsgBox("점검일정을 삭제하시겠습니까?") != MessageBoxResult.Yes) { return; } try { BizUtil.Update2(Dtl, "DeleteChscMaDtl"); } catch (Exception ex) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다." + ex.ToString()); return; } Messages.ShowOkMsgBox(); //화면닫기 btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); }); //점검승인 this.ApprCmd = new DelegateCommand <object>(delegate(object obj) { // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행) if (!BizUtil.ValidReq(chkSchDtlView)) { return; } if (Messages.ShowYesNoMsgBox("점검승인 하시겠습니까?") != MessageBoxResult.Yes) { return; } try { BizUtil.Update2(Dtl, "UpdateChscMaAppr"); } catch (Exception) { Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다."); return; } Messages.ShowOkMsgBox(); //화면닫기 btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); }); //행추가(시설물선택팝업) this.AddFtrSelCmd = new RelayCommand <object>(delegate(object obj) { try { // 지형지물팝업 윈도우 FtrSelView ftrSelView = new FtrSelView(null); ftrSelView.Owner = Window.GetWindow(chkSchDtlView); //FTR_IDN 리턴 if (ftrSelView.ShowDialog() is bool) { string FTR_IDN = ftrSelView.txtFTR_IDN.Text; string FTR_CDE = ftrSelView.txtFTR_CDE.Text; string FTR_NAM = ftrSelView.txtFTR_NAM.Text; string HJD_NAM = ftrSelView.txtHJD_NAM.Text; //저장버튼으로 닫힘 if (!FmsUtil.IsNull(FTR_IDN)) { AddFtrRow(FTR_IDN, FTR_CDE, FTR_NAM, HJD_NAM); //시설물 한건추가 } //닫기버튼으로 닫힘 } } catch (Exception ex) { Messages.ShowErrMsgBox(ex.ToString()); } }); // 그리드저장 this.GrdSaveCmd = new RelayCommand <object>(delegate(object obj) { bool isChecked = false; foreach (ChscResultDtl row in GrdLst) { if ("Y".Equals(row.CHK)) { isChecked = true; break; } } if (!isChecked) { Messages.ShowInfoMsgBox("선택된 항목이 없습니다."); return; } if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes) { return; } Hashtable param = new Hashtable(); //1.그리드 저장 foreach (ChscResultDtl row in GrdLst) { if (row.CHK != "Y") { continue; } try { row.SCL_NUM = Dtl.SCL_NUM; BizUtil.Update2(row, "SaveChscResult"); } catch (Exception) { Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다."); return; } } //2.점검마스터상태 변경 Hashtable pa = new Hashtable(); pa.Add("sqlId", "UpdateChscMaRes"); pa.Add("SCL_NUM", Dtl.SCL_NUM); BizUtil.Update(pa); //저장처리성공 Messages.ShowOkMsgBox(); //재조회 initModel(); }); // 행삭제 GrdDelCmd this.GrdDelCmd = new RelayCommand <object>(delegate(object obj) { //데이터 직접삭제처리 try { bool isChecked = false; foreach (ChscResultDtl row in GrdLst) { if ("Y".Equals(row.CHK)) { isChecked = true; break; } } if (!isChecked) { Messages.ShowInfoMsgBox("선택된 항목이 없습니다."); return; } if (Messages.ShowYesNoMsgBox("선택 항목을 삭제 하시겠습니까?") == MessageBoxResult.Yes) { foreach (ChscResultDtl row in GrdLst) { Hashtable param = new Hashtable(); try { if ("Y".Equals(row.CHK)) { if (row.SEQ == 0) { //그리드행만 삭제 GrdLst.RemoveAt(GrdLst.IndexOf(row)); return; } else { //0.점검사진삭제 //a.FIL_SEQ 첨부파일삭제 BizUtil.DelFileSeq(row.FIL_SEQ); //b.FILE_MAP 업무파일매핑삭제 param = new Hashtable(); param.Add("sqlId", "DeleteFileMap"); param.Add("BIZ_ID", row.FTR_CDE + row.FTR_IDN); param.Add("FIL_SEQ", row.FIL_SEQ); BizUtil.Update(param); //0.소모품삭제 PdjtHtDtl dtl = new PdjtHtDtl(); dtl.SCL_NUM = row.SCL_NUM; dtl.FTR_CDE = row.FTR_CDE; dtl.FTR_IDN = row.FTR_IDN; dtl.SEQ = row.SEQ; BizUtil.Update2(dtl, "DeletePdjtHt"); //1.데이터삭제 param.Clear(); param.Add("SCL_NUM", row.SCL_NUM); param.Add("FTR_CDE", row.FTR_CDE); param.Add("FTR_IDN", row.FTR_IDN); param.Add("SEQ", row.SEQ); param.Add("sqlId", "DeleteChscResult"); param.Add("SEQ", Convert.ToInt32(row.SEQ)); BizUtil.Update(param); } } } catch (Exception) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다."); return; } } Messages.ShowOkMsgBox(); //재조회 initModel(); } } catch (Exception ex) { Messages.ShowErrMsgBoxLog(ex); } }); }