/// <summary> /// 그리드삭제 /// </summary> private void OnDelete(object obj) { //데이터 직접삭제처리 try { bool isChecked = false; foreach (PdjtHtDtl row in GrdLst) { if ("Y".Equals(row.CHK)) { isChecked = true; break; } } if (!isChecked) { Messages.ShowInfoMsgBox("선택된 항목이 없습니다."); return; } if (Messages.ShowYesNoMsgBox("선택 항목을 삭제 하시겠습니까?") == MessageBoxResult.Yes) { foreach (PdjtHtDtl row in GrdLst) { Hashtable param = new Hashtable(); try { if ("Y".Equals(row.CHK)) { if (row.SEQ == 0) { //그리드행만 삭제 GrdLst.RemoveAt(GrdLst.IndexOf(row)); return; } else { //데이터삭제 BizUtil.Update2(row, "DeletePdjtHt"); } } } catch (Exception) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다."); return; } } Messages.ShowOkMsgBox(); //재조회 initModel(); } } catch (Exception ex) { Messages.ShowErrMsgBoxLog(ex); } }
public PdjtStockViewModel() { this.LoadedCommand = new DelegateCommand <object>(OnLoaded); this.SaveCommand = new DelegateCommand <object>(OnSave); this.DelCommand = new DelegateCommand <object>(OnDelete); //행추가 this.AddCommand = new DelegateCommand <object>(delegate(object obj) { PdjtInDtl addrow = new PdjtInDtl(); GrdLst.Add(addrow); addrow.CHK = "Y"; }); }
public WttSubcDtViewModel() { this.LoadedCommand = new DelegateCommand <object>(OnLoaded); this.SaveCommand = new DelegateCommand <object>(OnSave); this.DeleteCommand = new DelegateCommand <object>(OnDelete); //행추가 this.AddCommand = new DelegateCommand <object>(delegate(object obj) { WttSubcDt addrow = new WttSubcDt(); GrdLst.Add(addrow); addrow.CHK = "Y"; }); }
public PdjtMngListViewModel() { this.LoadedCommand = new DelegateCommand <object>(OnLoaded); this.SaveCommand = new DelegateCommand <object>(OnSave); this.DelCommand = new DelegateCommand <object>(OnDelete); this.SearchCommand = new DelegateCommand <object>(SearchAction); this.ResetCommand = new DelegateCommand <object>(ResetAction); this.EnterCommand = new DelegateCommand <object>(EnterAction); //행추가 this.AddCommand = new DelegateCommand <object>(delegate(object obj) { PdjtMaDtl addrow = new PdjtMaDtl(); GrdLst.Insert(0, addrow); addrow.CHK = "Y"; }); }
public PdjtHtViewModel() { this.LoadedCommand = new DelegateCommand <object>(OnLoaded); this.SaveCommand = new DelegateCommand <object>(OnSave); this.DelCommand = new DelegateCommand <object>(OnDelete); //행추가 this.AddCommand = new DelegateCommand <object>(delegate(object obj) { PdjtHtDtl row = new PdjtHtDtl(); row.SCL_NUM = Convert.ToInt16(SCL_NUM); row.FTR_CDE = FTR_CDE; row.FTR_IDN = Convert.ToInt16(FTR_IDN); row.SEQ = Convert.ToInt16(SEQ); GrdLst.Add(row); row.CHK = "Y"; }); }
/// <summary> /// 그리드삭제 /// </summary> private void OnDelete(object obj) { //데이터 직접삭제처리 try { bool isChecked = false; foreach (WttSubcDt row in GrdLst) { if ("Y".Equals(row.CHK)) { isChecked = true; break; } } if (!isChecked) { Messages.ShowInfoMsgBox("선택된 항목이 없습니다."); return; } if (Messages.ShowYesNoMsgBox("선택 항목을 삭제 하시겠습니까?") == MessageBoxResult.Yes) { foreach (WttSubcDt row in GrdLst) { Hashtable param = new Hashtable(); try { if ("Y".Equals(row.CHK)) { param.Clear(); param.Add("sqlId", "DeleteWttSubcDt"); param.Add("CNT_NUM", CNT_NUM); if (row.SUBC_SEQ == 0) { //그리드행만 삭제 GrdLst.RemoveAt(GrdLst.IndexOf(row)); return; } else { //데이터삭제 param.Add("SUBC_SEQ", Convert.ToInt32(row.SUBC_SEQ)); BizUtil.Update(param); } } } catch (Exception) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다."); return; } } Messages.ShowOkMsgBox(); //재조회 //initModel(); parentInitModel(); } } catch (Exception ex) { Messages.ShowErrMsgBoxLog(ex); } }
/// <summary> /// 그리드삭제 /// </summary> private void OnDelete(object obj) { //데이터 직접삭제처리 try { bool isChecked = false; foreach (PdjtMaDtl row in GrdLst) { if ("Y".Equals(row.CHK)) { isChecked = true; break; } } if (!isChecked) { Messages.ShowInfoMsgBox("선택된 항목이 없습니다."); return; } //자식데이터여부 foreach (PdjtMaDtl row in GrdLst) { if ("Y".Equals(row.CHK)) { int cnt = 0; try { cnt = Convert.ToInt32(row.CNT); } catch (Exception) { } if (cnt > 0) { Messages.ShowInfoMsgBox("선택한 항목중에 입고내역이 있습니다."); return; } } } if (Messages.ShowYesNoMsgBox("선택 항목을 삭제 하시겠습니까?") == MessageBoxResult.Yes) { foreach (PdjtMaDtl row in GrdLst) { Hashtable param = new Hashtable(); try { if ("Y".Equals(row.CHK)) { param.Clear(); param.Add("sqlId", "DeletePdjtMa"); if (row.PDH_NUM == 0) { //그리드행만 삭제 GrdLst.RemoveAt(GrdLst.IndexOf(row)); return; } else { //데이터삭제 param.Add("PDH_NUM", row.PDH_NUM); BizUtil.Update(param); } } } catch (Exception) { Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다."); return; } } Messages.ShowOkMsgBox(); //재조회 SearchAction(null); } } catch (Exception ex) { Messages.ShowErrMsgBoxLog(ex); } }