//초기모델조회 private void InitModel() { //1.상세마스터 Hashtable param = new Hashtable(); param.Add("sqlId", "SelectWttWserMa"); param.Add("WSER_SEQ", _WSER_SEQ); WserDtl result = new WserDtl(); result = BizUtil.SelectObject(param) as WserDtl; this.Dtl = result; //다큐먼트는 따로 처리 Paragraph p = new Paragraph(); try { p.Inlines.Add(this.Dtl.APL_EXP ?? ""); splyCmplDtlView.richAPL_EXP.Document.Blocks.Clear(); splyCmplDtlView.richAPL_EXP.Document.Blocks.Add(p); } catch (Exception) {} p = new Paragraph(); try { p.Inlines.Add(this.Dtl.PRO_EXP ?? ""); splyCmplDtlView.richPRO_EXP.Document.Blocks.Clear(); splyCmplDtlView.richPRO_EXP.Document.Blocks.Add(p); } catch (Exception) {} }
//초기모델조회 private void InitModel() { //1.상세마스터 Hashtable param = new Hashtable(); param.Add("sqlId", "SelectWttWserMa"); param.Add("WSER_SEQ", _WSER_SEQ); WserDtl result = new WserDtl(); result = BizUtil.SelectObject(param) as WserDtl; this.Dtl = result; //다큐먼트는 따로 처리 Paragraph p = new Paragraph(); try { p.Inlines.Add(this.Dtl.APL_EXP ?? ""); cnstCmplDtlView.richAPL_EXP.Document.Blocks.Clear(); cnstCmplDtlView.richAPL_EXP.Document.Blocks.Add(p); } catch (Exception) {} p = new Paragraph(); try { p.Inlines.Add(this.Dtl.PRO_EXP.Trim()); cnstCmplDtlView.richPRO_EXP.Document.Blocks.Clear(); cnstCmplDtlView.richPRO_EXP.Document.Blocks.Add(p); } catch (Exception) {} //2.누수지점 param = new Hashtable(); param.Add("sqlId", "SelectCmplLeakList"); param.Add("RCV_NUM", this.Dtl.RCV_NUM); dt = BizUtil.SelectList(param); cnstCmplDtlView.grid.ItemsSource = dt; }
/// <summary> /// 생성자 /// </summary> public SplyCmplAddViewModel() { dtl = new WserDtl(); this.LoadedCommand = new DelegateCommand <object>(delegate(object obj) { // 0.화면객체인스턴스화 if (obj == null) { return; } splyCmplAddView = obj as SplyCmplAddView; btnSave = splyCmplAddView.btnSave; btnClose = splyCmplAddView.btnClose; btnDup = splyCmplAddView.btnDup; //2.화면데이터객체 초기화 InitDataBinding(); //3.권한처리 permissionApply(); //4.민원번호 채번 Hashtable param = new Hashtable(); param.Add("sqlId", "SelectRevNum"); DataTable dt = BizUtil.SelectList(param); string rcvNum = ""; try { rcvNum = dt.Rows[0]["RCV_NUM"].ToString(); } catch (Exception) {} this.Dtl.RCV_NUM = rcvNum; }); //저장 this.SaveCommand = new DelegateCommand <object>(delegate(object obj) { // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행) if (!BizUtil.ValidReq(splyCmplAddView)) { return; } // 민원번호중복체크 if (btnDup.Content.Equals("체크")) { Messages.ShowInfoMsgBox("민원번호 (중복)체크를 하세요."); return; } if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes) { return; } try { //다큐먼트는 따로 처리 this.Dtl.APL_EXP = new TextRange(splyCmplAddView.richAPL_EXP.Document.ContentStart, splyCmplAddView.richAPL_EXP.Document.ContentEnd).Text.Trim(); this.Dtl.PRO_EXP = new TextRange(splyCmplAddView.richPRO_EXP.Document.ContentStart, splyCmplAddView.richPRO_EXP.Document.ContentEnd).Text.Trim(); BizUtil.Update2(this.Dtl, "SaveCmplWserMa"); } catch (Exception ex) { Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.Message); return; } Messages.ShowOkMsgBox(); //화면닫기 btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); }); //입력항목 변경되면 중복버튼 복원 this.Dtl.DUP = "체크"; PropertyChanged += delegate(object sender, PropertyChangedEventArgs args) { try { btnDup.Content = "체크"; } catch (Exception) { } }; this.DupCommand = new DelegateCommand <object>(delegate(object obj) { if (btnDup.Content.Equals("OK")) { return; } Hashtable param = new Hashtable(); param.Add("sqlId", "SelectWserDup"); param.Add("RCV_NUM", this.Dtl.RCV_NUM); DataTable dt = BizUtil.SelectList(param); if (dt.Rows.Count > 1) { Messages.ShowInfoMsgBox("민원번호가 중복되었습니다."); } else { btnDup.Content = "OK"; } }); }