Ejemplo n.º 1
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", "selectWttMetaHtList");

            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;
                    WttMetaHt dtl = new WttMetaHt();
                    dtl.FTR_CDE = FTR_CDE;
                    dtl.FTR_IDN = FTR_IDN;
                    BizUtil.Update2(dtl, "DeleteWttMetaHt");
                }
            }
            catch (Exception) { }


            try
            {
                BizUtil.Update2(this, "deleteHydtMetrDtl");
            }
            catch (Exception e)
            {
                Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다." + e.Message);
                return;
            }
            Messages.ShowOkMsgBox();



            BackCommand.Execute(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 로딩작업
        /// </summary>
        /// <param name="obj"></param>
        private void OnLoaded(object obj)
        {
            //throw new NotImplementedException();

            // 0.화면객체인스턴스화
            if (obj == null)
            {
                return;
            }

            metrChgDtlView = obj as MetrChgDtlView;
            cbGCW_CDE      = metrChgDtlView.cbGCW_CDE;
            cbOME_MOF      = metrChgDtlView.cbOME_MOF;

            btnSave  = metrChgDtlView.btnSave;
            btnDel   = metrChgDtlView.btnDel;
            btnClose = metrChgDtlView.btnClose;


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


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



            //4.신규/상세 모드
            if (Dtl.META_SEQ < 0)
            {
                //채번
                Hashtable param = new Hashtable();
                param.Add("FTR_CDE", Dtl.FTR_CDE);
                param.Add("FTR_IDN", Dtl.FTR_IDN);
                param.Add("sqlId", "selectMETA_SEQ");

                WttMetaHt res = new WttMetaHt();
                res = BizUtil.SelectObject(param) as WttMetaHt;

                //채번결과 매칭
                Dtl.META_SEQ = res.META_SEQ;

                metrChgDtlView.btnDel.Visibility = Visibility.Collapsed;

                //시설물명 가져오기
                Dtl.FTR_NAM = BizUtil.GetCodeNm("Select_FTR_LIST2", Dtl.FTR_CDE);
            }
            else
            {
                Hashtable param = new Hashtable();
                param.Add("sqlId", "selectWttMetaHtList");
                param.Add("FTR_CDE", Dtl.FTR_CDE);
                param.Add("FTR_IDN", Dtl.FTR_IDN);
                param.Add("META_SEQ", Dtl.META_SEQ);

                Dtl = BizUtil.SelectObject(param) as WttMetaHt;

                metrChgDtlView.btnDel.Visibility = Visibility.Visible;
            }
        }
Ejemplo n.º 3
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", "selectWttMetaHtList");

            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;
                    WttMetaHt dtl = new WttMetaHt();
                    dtl.FTR_CDE = FTR_CDE;
                    dtl.FTR_IDN = Convert.ToInt32(FTR_IDN);
                    BizUtil.Update2(dtl, "DeleteWttMetaHt");
                }
            }
            catch (Exception) { }


            try
            {
                BizUtil.Update2(this.FctDtl, "deleteHydtMetrDtl");
            }
            catch (Exception e)
            {
                Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다." + e.Message);
                return;
            }
            // 2.위치정보 삭제처리
            ContentControl   cctl             = uC_META_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();
        }