Beispiel #1
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();
        }
Beispiel #2
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));
        }
Beispiel #3
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));
        }
Beispiel #4
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));
        }
Beispiel #5
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); //닫기
        }
Beispiel #6
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));
        }
Beispiel #7
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();
        }
Beispiel #8
0
        /// <summary>
        /// 저장작업
        /// </summary>
        /// <param name="obj"></param>
        private void OnSave(object obj)
        {
            // 필수체크 (Tag에 필수체크 표시한 EditBox, ComboBox 대상으로 수행)
            if (!BizUtil.ValidReq(faqDetaillView))
            {
                return;
            }



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

            try
            {
                //this.QUESTION = richQUESTION.RtfText;
                //BizUtil.Update2(this, "SaveFaqDtl");


                string sql = "";
                sql += " UPDATE FAQ SET ";
                sql += " QUESTION = :QUESTION ";
                sql += " ,REPL = :REPL ";
                sql += " ,TTL = :TTL ";
                sql += " ,FAQ_CAT_CDE= :FAQ_CAT_CDE";
                sql += " ,FAQ_CUZ_CDE= :FAQ_CUZ_CDE";
                sql += " ,FTR_CDE = :FTR_CDE";
                sql += " ,EDT_ID = :EDT_ID";
                sql += " WHERE SEQ = :SEQ ;";

                Hashtable param = new Hashtable();
                param.Add("sql", sql);
                param.Add("QUESTION", this.QUESTION);
                param.Add("REPL", this.REPL);
                param.Add("TTL", this.TTL);
                param.Add("FAQ_CAT_CDE", this.FAQ_CAT_CDE);
                param.Add("EDT_ID", Logs.strLogin_ID);
                param.Add("FTR_CDE", this.FTR_CDE);
                param.Add("FAQ_CUZ_CDE", this.FAQ_CUZ_CDE);
                param.Add("SEQ", this.SEQ);
                DBUtil.UpdateFAQ(param);
            }
            catch (Exception ex)
            {
                Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.Message);
                InitModel();
                return;
            }

            Messages.ShowOkMsgBox();
            InitModel();
        }
Beispiel #9
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));
        }
Beispiel #10
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();
        }
Beispiel #11
0
        /// 생성자
        public ShpMngViewModel()
        {
            ItemsSelect = new ObservableCollection <FileDtl>();
            ItemsFile   = new ObservableCollection <FileInfo>();



            // 초기로딩처리
            LoadedCommand = new RelayCommand <object>(delegate(object obj) {
                if (obj == null)
                {
                    return;
                }
                //그리드뷰인스턴스
                shpMngView = obj as ShpMngView;


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


            //shp파일 임포트
            ImportCmd = new RelayCommand <object>(delegate(object obj) {
                //필수체크
                if (!BizUtil.ValidReq(shpMngView))
                {
                    return;
                }

                OpenFileDialog openFileDialog   = new OpenFileDialog();
                openFileDialog.Multiselect      = true;
                openFileDialog.Filter           = "Shape files |*.shp;*.shx;*.dbf;*.prj";
                openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                if (openFileDialog.ShowDialog() == true)
                {
                    FileInfo[] files = openFileDialog.FileNames.Select(f => new FileInfo(f)).ToArray(); //파일인포

                    int cnt = 0;                                                                        //전체파일수
                    int chk = 0;                                                                        //shp,dat파일수
                    foreach (FileInfo fi in files)
                    {
                        try
                        {
                            //파일객체
                            ItemsFile.Add(fi);
                            if (fi.Extension.Contains("shp") || fi.Extension.Contains("shx") || fi.Extension.Contains("dbf") || fi.Extension.Contains("prj"))
                            {
                                chk++;
                            }
                            cnt++;
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e.Message);
                        }
                    }

                    if (chk < 4)
                    {
                        MessageBox.Show("shp, shx, dbf, prj 파일 4개를 선택해야합니다.");
                        return;
                    }
                    if (cnt > 4)
                    {
                        MessageBox.Show("한번에 한종류의 shp파일만 업로드할수 있습니다.");
                        return;
                    }



                    //파일업로드시작
                    upload_thread = new Thread(new ThreadStart(UploadFileListFX));
                    upload_thread.Start();
                }
            });



            //기존파일 다운로드버튼 이벤트
            DownloadCmd = new RelayCommand <object>(delegate(object obj)
            {
                FileDtl dtl      = obj as FileDtl;
                string file_name = dtl.DWN_NAM;

                try
                {
                    source_file_path = BizUtil.GetDataFolder("shape", file_name);
                }
                catch (Exception)
                {
                    Messages.ShowErrMsgBox("다운로드할 수 없습니다.");
                    return;
                }


                //파일다운로드
                saveFileDialog       = new System.Windows.Forms.SaveFileDialog();
                saveFileDialog.Title = "저장경로를 지정하세요.";
                //초기 파일명 지정
                saveFileDialog.FileName        = file_name;
                saveFileDialog.OverwritePrompt = true;
                saveFileDialog.Filter          = "All files (*.*)|*.*";

                if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    target_file_path = saveFileDialog.FileName;
                    download_thread  = new Thread(new ThreadStart(DownloadFX));
                    download_thread.Start();
                }
            });
        }
Beispiel #12
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";
                }
            });
        }
Beispiel #13
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));
            });
        }
Beispiel #14
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));
            });
        }
Beispiel #15
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));
            });
        }
Beispiel #16
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));
            });
        }
Beispiel #17
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);
                }
            });
        }