Exemplo n.º 1
0
        /// <summary>
        /// 저장작업
        /// </summary>
        /// <param name="obj"></param>
        private void OnSave(object obj)
        {
            // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
            if (!BizUtil.ValidReq(wtsMnhoDtlView))
            {
                return;
            }


            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }

            try
            {
                BizUtil.Update2(this, "updateWtsMnhoDtl");
            }
            catch (Exception)
            {
                Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다.");
                return;
            }
            Messages.ShowOkMsgBox();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 저장작업
        /// </summary>
        /// <param name="obj"></param>
        private void OnSave(object obj)
        {
            // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
            if (!BizUtil.ValidReq(prsPmpAddView))
            {
                return;
            }


            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }

            try
            {
                BizUtil.Update2(this, "insertPrsPmpDtl");
            }
            catch (Exception)
            {
                Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다.");
                return;
            }
            Messages.ShowOkMsgBox();

            BackCommand.Execute(null); //닫기
        }
Exemplo n.º 3
0
        /// <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);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 저장작업
        /// </summary>
        /// <param name="obj"></param>
        private void OnSave(object obj)
        {
            // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
            if (!BizUtil.ValidReq(attFacDtlView))
            {
                return;
            }


            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }


            try
            {
                //다큐먼트는 따로 처리
                this.ATT_DES = new TextRange(attFacDtlView.txtATT_DES.Document.ContentStart, attFacDtlView.txtATT_DES.Document.ContentEnd).Text.Trim();
                BizUtil.Update2(this, "SaveWttAttaDt");
            }
            catch (Exception)
            {
                Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다.");
                return;
            }

            Messages.ShowOkMsgBox();
            //화면닫기
            btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
        }
Exemplo n.º 5
0
        /// <summary>
        /// 저장작업
        /// </summary>
        /// <param name="obj"></param>
        private void OnSave(object obj)
        {
            // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
            if (!BizUtil.ValidReq(splyDtlView))
            {
                return;
            }

            // 공사번호중복체크
            //if (btnDup.Content.Equals("체크"))
            //{
            //    Messages.ShowInfoMsgBox("공사번호 (중복)체크를 하세요.");
            //    return;
            //}



            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }

            try
            {
                BizUtil.Update2(Dtl, "updateSplyDtl");
            }
            catch (Exception ex)
            {
                Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.Message);
                return;
            }
            Messages.ShowOkMsgBox();
        }
Exemplo n.º 6
0
        /// <summary>
        /// 저장작업
        /// </summary>
        /// <param name="obj"></param>
        private void OnSave(object obj)
        {
            // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
            if (!BizUtil.ValidReq(cnstMngAddView))
            {
                return;
            }

            // 공사번호중복체크
            if (btnDup.Content.Equals("체크"))
            {
                Messages.ShowInfoMsgBox("공사번호 (중복)체크를 하세요.");
                return;
            }


            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }

            try
            {
                BizUtil.Update2(this, "insertCnstMngDtl");
            }
            catch (Exception)
            {
                Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다.");
                btnBack.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
            }
            Messages.ShowOkMsgBox();
            btnBack.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
        }
Exemplo n.º 7
0
        /// <summary>
        /// 저장작업
        /// </summary>
        /// <param name="obj"></param>
        private void OnSave(object obj)
        {
            // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
            if (!BizUtil.ValidReq(faqAddView))
            {
                return;
            }



            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }

            try
            {
                //다큐먼트는 따로 처리
                this.QUESTION = new TextRange(faqAddView.richQUESTION.Document.ContentStart, faqAddView.richQUESTION.Document.ContentEnd).Text.Trim();
                this.REPL     = new TextRange(faqAddView.richREPL.Document.ContentStart, faqAddView.richREPL.Document.ContentEnd).Text.Trim();
                BizUtil.Update2(this, "SaveFaqDtl");
            }
            catch (Exception ex)
            {
                Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.Message);
            }



            Messages.ShowOkMsgBox();
            btnBack.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
        }
Exemplo n.º 8
0
        /// <summary>
        /// 저장작업
        /// </summary>
        /// <param name="obj"></param>
        private void OnSave(object obj)
        {
            // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
            if (!BizUtil.ValidReq(metrChgDtlView))
            {
                return;
            }


            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }

            try
            {
                BizUtil.Update2(Dtl, "SaveWttMetaHt");
            }
            catch (Exception)
            {
                Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다.");
                return;
            }


            Messages.ShowOkMsgBox();
            //화면닫기
            btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
        }
Exemplo n.º 9
0
        /// <summary>
        /// 그리드저장
        /// </summary>
        private void OnSave(object obj)
        {
            bool isChecked = false;

            foreach (PdjtInDtl 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();

            //그리드 저장
            foreach (PdjtInDtl row in GrdLst)
            {
                if (row.CHK != "Y")
                {
                    continue;
                }

                if (FmsUtil.IsNull(row.IN_YMD))
                {
                    MessageBox.Show("입고일자는 필수입니다.");
                    return;
                }

                row.PDH_NUM = Convert.ToInt32(PDH_NUM);
                try
                {
                    BizUtil.Update2(row, "SavePdjtInHtPop");
                }
                catch (Exception)
                {
                    Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다.");
                    return;
                }
            }

            //저장처리성공
            Messages.ShowOkMsgBox();

            //재조회
            initModel();
        }
Exemplo n.º 10
0
        // 점검일정 단건저장
        private void SaveSchdDtl(ChscMaDtl dtl)
        {
            //일정변경
            BizUtil.Update2(dtl, "SaveChscMaDtl");


            //재조회
            //InitModel();
        }
Exemplo n.º 11
0
        /// <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);
        }
Exemplo n.º 12
0
        /// <summary>
        /// 그리드저장
        /// </summary>
        private void OnSave(object obj)
        {
            bool isChecked = false;

            foreach (WttChngDt 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();

            //그리드 저장
            foreach (WttChngDt row in GrdLst)
            {
                if (row.CHK != "Y")
                {
                    continue;
                }

                row.CNT_NUM = CNT_NUM;
                try
                {
                    BizUtil.Update2(row, "SaveWttChngDt2");
                }
                catch (Exception)
                {
                    Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다.");
                    return;
                }
            }

            //저장처리성공
            Messages.ShowOkMsgBox();

            //재조회
            //initModel();
            parentInitModel();
        }
Exemplo n.º 13
0
        /// <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();
        }
Exemplo n.º 14
0
        /// <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);
        }
Exemplo n.º 15
0
        // 점검일정 목록저장
        private void SaveSchdList()
        {
            //1.일정변경(추가)
            foreach (ChscMaDtl dtl in newChscMaLst)
            {
                BizUtil.Update2(dtl, "SaveChscMaDtl");
            }

            //2.일정변경(삭제)
            foreach (ChscMaDtl dtl in oldChscMaLst)
            {
                BizUtil.Update2(dtl, "DeleteChscMaDtl");
            }

            //재조회
            //InitModel();
        }
Exemplo n.º 16
0
        /// <summary>
        /// 삭제
        /// </summary>
        /// <param name="obj"></param>
        private void OnDelete(object obj)
        {
            if (Messages.ShowYesNoMsgBox("삭제하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }

            try
            {
                BizUtil.Update2(Dtl, "deleteWttRsrvHt");
            }
            catch (Exception)
            {
                Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다.");
                return;
            }

            Messages.ShowOkMsgBox();
            //화면닫기
            btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
        }
Exemplo n.º 17
0
        /// <summary>
        /// 첨부DB 저장처리
        /// </summary>
        /// <param name="obj"></param>
        private void OnSave(object obj)
        {
            // 파일첨부확인 - 필수첨부이다
            if (FmsUtil.IsNull(Dtl.FIL_SEQ) || Dtl.FIL_SEQ == 0)
            {
                Messages.ShowInfoMsgBox("첨부파일을 먼저 등록(저장)하세요.");
                return;
            }

            // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
            if (!BizUtil.ValidReq(fileMngView))
            {
                return;
            }

            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }


            try
            {
                Dtl.GRP_TYP = "112"; //일반파일
                BizUtil.Update2(Dtl, "SaveFileMap2");
            }
            catch (Exception ex)
            {
                Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.Message);
                return;
            }



            //저장처리 성공
            Messages.ShowOkMsgBox();
            //InitModel();
            btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
        }
Exemplo n.º 18
0
        /// <summary>
        /// 삭제처리
        /// </summary>
        /// <param name="obj"></param>
        private void OnDelete(object obj)
        {
            // 1.삭제처리
            if (Messages.ShowYesNoMsgBox("FAQ 항목을 삭제하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }
            try
            {
                BizUtil.Update2(this, "DeleteFaqDtl");
            }
            catch (Exception)
            {
                Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다.");
                return;
            }
            Messages.ShowOkMsgBox();



            BackCommand.Execute(null);
        }
Exemplo n.º 19
0
        /// <summary>
        /// 저장작업
        /// </summary>
        /// <param name="obj"></param>
        private void OnSave(object obj)
        {
            // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
            if (!BizUtil.ValidReq(uC_FLOW_PS))
            {
                return;
            }


            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }

            try
            {
                //1.시설물정보
                FctDtl.FTR_CDE = this.FTR_CDE;
                FctDtl.FTR_IDN = Convert.ToInt32(this.FTR_IDN); //신규위치 및 기존위치 정보만 있을수 있으므로 shape의 관리번호를 기준으로한다.
                BizUtil.Update2(FctDtl, "saveFlowMtDtl");

                //2.위치정보 - 위치편집한 경우만
                if (!FmsUtil.IsNull(GisCmm.WKT_POINT))
                {
                    GisCmm.SavePoint(FctDtl.FTR_CDE, FctDtl.FTR_IDN.ToString(), "WTL_FLOW_PS");
                    GisCmm.WKT_POINT = "";
                }
            }
            catch (Exception e)
            {
                Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + e.Message);
                return;
            }



            Messages.ShowOkMsgBox();
            InitModel();
        }
Exemplo n.º 20
0
        /// <summary>
        /// 생성자
        /// </summary>
        public CnstCmplDtlViewModel()
        {
            this.LoadedCommand = new DelegateCommand <object>(delegate(object obj) {
                // 0.화면객체인스턴스화
                if (obj == null)
                {
                    return;
                }

                cnstCmplDtlView = obj as CnstCmplDtlView;

                btnSave  = cnstCmplDtlView.btnSave;
                btnClose = cnstCmplDtlView.btnClose;

                _WSER_SEQ = cnstCmplDtlView.txtWSER_SEQ.Text;

                //2.화면데이터객체 초기화
                InitDataBinding();


                //3.권한처리
                permissionApply();

                //4.초기조회
                InitModel();
            });

            //저장
            this.SaveCommand = new DelegateCommand <object>(delegate(object obj) {
                // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
                if (!BizUtil.ValidReq(cnstCmplDtlView))
                {
                    return;
                }


                if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
                {
                    return;
                }

                try
                {
                    //다큐먼트는 따로 처리
                    this.Dtl.APL_EXP = new TextRange(cnstCmplDtlView.richAPL_EXP.Document.ContentStart, cnstCmplDtlView.richAPL_EXP.Document.ContentEnd).Text.Trim();
                    this.Dtl.PRO_EXP = new TextRange(cnstCmplDtlView.richPRO_EXP.Document.ContentStart, cnstCmplDtlView.richPRO_EXP.Document.ContentEnd).Text.Trim();
                    BizUtil.Update2(this.Dtl, "SaveCmplWserMa");
                }
                catch (Exception ex)
                {
                    Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.Message);
                    return;
                }

                Messages.ShowOkMsgBox();
                InitModel();
                //화면닫기
                //btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
            });



            //삭제
            this.DelCommand = new DelegateCommand <object>(delegate(object obj) {
                if (dt.Rows.Count > 0)
                {
                    Messages.ShowErrMsgBox("해당민원 누수지점 내역이 존재합니다.");
                    return;
                }

                if (Messages.ShowYesNoMsgBox("민원을 삭제하시겠습니까?") != MessageBoxResult.Yes)
                {
                    return;
                }

                try
                {
                    BizUtil.Update2(this.Dtl, "DeleteWserMa");
                }
                catch (Exception ex)
                {
                    Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.Message);
                    return;
                }

                Messages.ShowOkMsgBox();
                //화면닫기
                btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
            });
        }
Exemplo n.º 21
0
        /// <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);
                }
            });
        }
Exemplo n.º 22
0
        /// <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";
                }
            });
        }
Exemplo n.º 23
0
        /// <summary>
        /// 생성자
        /// </summary>
        public LekSiteDtlViewModel()
        {
            this.LoadedCommand = new DelegateCommand <object>(delegate(object obj) {
                // 0.화면객체인스턴스화
                if (obj == null)
                {
                    return;
                }

                lekSiteDtlView = obj as LekSiteDtlView;

                btnSave  = lekSiteDtlView.btnSave;
                btnClose = lekSiteDtlView.btnClose;

                _FTR_CDE = lekSiteDtlView.txtFTR_CDE.Text;
                _FTR_IDN = lekSiteDtlView.txtFTR_IDN.Text;

                //2.화면데이터객체 초기화
                InitDataBinding();


                //3.권한처리
                permissionApply();

                //4.초기조회
                InitModel();
            });

            //저장
            this.SaveCommand = new DelegateCommand <object>(delegate(object obj) {
                // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
                if (!BizUtil.ValidReq(lekSiteDtlView))
                {
                    return;
                }


                if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
                {
                    return;
                }

                try
                {
                    //다큐먼트는 따로 처리
                    this.Dtl.REP_EXP = new TextRange(lekSiteDtlView.richREP_EXP.Document.ContentStart, lekSiteDtlView.richREP_EXP.Document.ContentEnd).Text.Trim();
                    this.Dtl.LEK_EXP = new TextRange(lekSiteDtlView.richLEK_EXP.Document.ContentStart, lekSiteDtlView.richLEK_EXP.Document.ContentEnd).Text.Trim();
                    BizUtil.Update2(this.Dtl, "SaveWtlLeakDtl");
                }
                catch (Exception ex)
                {
                    Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.Message);
                    return;
                }

                Messages.ShowOkMsgBox();
                InitModel();
                //화면닫기
                //btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
            });



            //삭제
            this.DelCommand = new DelegateCommand <object>(delegate(object obj) {
                Hashtable param = new Hashtable();
                param.Add("sqlId", "SelectBizIdFileDtl");
                param.Add("BIZ_ID", _FTR_CDE + _FTR_IDN);
                DataTable dt = BizUtil.SelectList(param);

                if (dt.Rows.Count > 0)
                {
                    Messages.ShowErrMsgBox("누수사진 내역이 존재합니다.");
                    return;
                }

                if (Messages.ShowYesNoMsgBox("누수지점을 삭제하시겠습니까?") != MessageBoxResult.Yes)
                {
                    return;
                }

                try
                {
                    BizUtil.Update2(this.Dtl, "DeleteWtlLeakDtl");
                }
                catch (Exception ex)
                {
                    Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.Message);
                    return;
                }

                Messages.ShowOkMsgBox();
                //화면닫기
                btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
            });
        }
Exemplo n.º 24
0
        /// <summary>
        /// 그리드저장
        /// </summary>
        private void OnSave(object obj)
        {
            bool isChecked = false;

            foreach (PdjtHtDtl row in GrdLst)
            {
                if ("Y".Equals(row.CHK))
                {
                    isChecked = true;
                    break;
                }
            }
            if (!isChecked)
            {
                Messages.ShowInfoMsgBox("선택된 항목이 없습니다.");
                return;
            }

            //필수체크
            foreach (PdjtHtDtl row in GrdLst)
            {
                if (row.CHK != "Y")
                {
                    continue;
                }

                if (FmsUtil.IsNull(row.PDH_NUM))
                {
                    Messages.ShowErrMsgBox("소모품은 필수입력입니다.");
                    return;
                }
            }


            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }


            //그리드 저장
            foreach (PdjtHtDtl row in GrdLst)
            {
                if (row.CHK != "Y")
                {
                    continue;
                }

                try
                {
                    BizUtil.Update2(row, "SavePdjtHt");
                }
                catch (Exception)
                {
                    Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다.");
                    return;
                }
            }

            //저장처리성공
            Messages.ShowOkMsgBox();

            //재조회
            initModel();
        }
Exemplo n.º 25
0
        /// <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);
        }
Exemplo n.º 26
0
        private LeakDtl dtl = new LeakDtl(); //민원마스터

        #endregion



        /// <summary>
        /// 생성자
        /// </summary>
        public LekSiteAddViewModel()
        {
            this.LoadedCommand = new DelegateCommand <object>(delegate(object obj) {
                // 0.화면객체인스턴스화
                if (obj == null)
                {
                    return;
                }

                lekSiteAddView = obj as LekSiteAddView;

                btnSave  = lekSiteAddView.btnSave;
                btnClose = lekSiteAddView.btnClose;


                //2.화면데이터객체 초기화
                InitDataBinding();


                //3.권한처리
                permissionApply();

                //4.채번
                Hashtable param = new Hashtable();
                param.Add("sqlId", "SelectLeakNewIdn");
                LeakDtl dtl = BizUtil.SelectObject(param) as LeakDtl;
                Dtl.FTR_IDN = dtl.FTR_IDN;
                Dtl.FTR_CDE = "SA300"; //누수지점

                //시설물명  가져오기
                lekSiteAddView.txtFTR_NAM.Text = BizUtil.GetCodeNm("Select_FTR_LIST2", Dtl.FTR_CDE);
            });

            //저장
            this.SaveCommand = new DelegateCommand <object>(delegate(object obj) {
                // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
                if (!BizUtil.ValidReq(lekSiteAddView))
                {
                    return;
                }


                if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
                {
                    return;
                }

                try
                {
                    //다큐먼트는 따로 처리
                    this.Dtl.REP_EXP = new TextRange(lekSiteAddView.richREP_EXP.Document.ContentStart, lekSiteAddView.richREP_EXP.Document.ContentEnd).Text.Trim();
                    this.Dtl.LEK_EXP = new TextRange(lekSiteAddView.richLEK_EXP.Document.ContentStart, lekSiteAddView.richLEK_EXP.Document.ContentEnd).Text.Trim();
                    BizUtil.Update2(this.Dtl, "SaveWtlLeakDtl");
                }
                catch (Exception ex)
                {
                    Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.Message);
                    return;
                }

                Messages.ShowOkMsgBox();
                //화면닫기
                btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
            });
        }
Exemplo n.º 27
0
        /// <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();
        }
Exemplo n.º 28
0
        /// <summary>
        /// 생성자
        /// </summary>
        public ChkSchAddViewModel()
        {
            /* RichTextBox를 바인딩하기위한 부분 : 사용안함
             * FlowDocument d = new FlowDocument();
             * Paragraph paragraph = new Paragraph();
             * Run a = new Run();
             * a.Text = "ASDFASDFASDFASDFASDF";
             * paragraph.Inlines.Add(a);
             * d.Blocks.Add(paragraph);
             *
             * Doc = d;
             */

            dtl = new ChscMaDtl();

            this.LoadedCommand = new DelegateCommand <object>(delegate(object obj) {
                // 0.화면객체인스턴스화
                if (obj == null)
                {
                    return;
                }

                chkSchAddView = obj as ChkSchAddView;

                cbMNG_CDE = chkSchAddView.cbMNG_CDE;
                cbSCL_CDE = chkSchAddView.cbSCL_CDE;

                btnSave  = chkSchAddView.btnSave;
                btnClose = chkSchAddView.btnClose;



                //2.화면데이터객체 초기화
                InitDataBinding();


                //3.권한처리
                permissionApply();
            });

            //신규저장
            this.SaveCommand = new DelegateCommand <object>(delegate(object obj) {
                // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
                if (!BizUtil.ValidReq(chkSchAddView))
                {
                    return;
                }

                //날짜체크
                if (!BizUtil.ValidDateBtw(Dtl.STA_YMD, Dtl.END_YMD))
                {
                    Messages.ShowInfoMsgBox("점검일자 범위를 확인하세요");
                    return;
                }

                if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
                {
                    return;
                }

                try
                {
                    //다큐먼트는 따로 처리
                    this.Dtl.CHK_CTNT = new TextRange(chkSchAddView.richBox.Document.ContentStart, chkSchAddView.richBox.Document.ContentEnd).Text.Trim();
                    BizUtil.Update2(this.Dtl, "SaveChscMaDtl");
                }
                catch (Exception ex)
                {
                    Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.Message);
                    return;
                }

                Messages.ShowOkMsgBox();
                //화면닫기
                btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
            });
        }
Exemplo n.º 29
0
        /// <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);
        }
Exemplo n.º 30
0
        /// <summary>
        /// 그리드저장
        /// </summary>
        private void OnSave(object obj)
        {
            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 (row.CHK != "Y")
                {
                    continue;
                }

                if (FmsUtil.IsNull(row.PDT_CAT_CDE))
                {
                    Messages.ShowErrMsgBox("구분은 필수입력입니다.");
                    return;
                }
                if (FmsUtil.IsNull(row.PDT_NAM))
                {
                    Messages.ShowErrMsgBox("품명은 필수입력입니다.");
                    return;
                }
            }


            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }


            //그리드 저장
            foreach (PdjtMaDtl row in GrdLst)
            {
                if (row.CHK != "Y")
                {
                    continue;
                }

                try
                {
                    BizUtil.Update2(row, "SavePdjtMa");
                }
                catch (Exception ex)
                {
                    Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.Message);
                    return;
                }
            }

            //저장처리성공
            Messages.ShowOkMsgBox();

            //재조회
            SearchAction(null);
        }