예제 #1
0
        //점검주기저장
        private void BtnReg_Click(object sender, RoutedEventArgs e)
        {
            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }

            try
            {
                Hashtable param = new Hashtable();
                param.Add("sqlId", "UpdateOptMt");
                param.Add("G2_ID", G2_ID);
                param.Add("CHK_PRD_CDE", cbCHK_PRD_CDE.EditValue);
                param.Add("CHK_PRD_AMT", txtCHK_PRD_AMT.Text);

                BizUtil.Update(param);
            }
            catch (Exception ex)
            {
                Messages.ShowErrMsgBox(ex.Message);
            }

            Messages.ShowOkMsgBox();
            InitModel();
        }
예제 #2
0
        //첨부파일 모듈호출
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                // 파일첨부윈도우
                FilePopView fileMngView = new FilePopView(this.FIL_SEQ);
                fileMngView.Owner = Window.GetWindow(this);

                //FIL_SEQ 리턴
                if (fileMngView.ShowDialog() is bool)
                {
                    string pFIL_SEQ = fileMngView.txtFIL_SEQ.Text;
                    string sToDay   = DateTime.Now.ToString("yyyyMMdd");

                    //저장버튼으로 닫힘
                    if (!FmsUtil.IsNull(pFIL_SEQ))
                    {
                        if (FmsUtil.IsNull(this.FIL_SEQ))
                        {
                            Hashtable param = new Hashtable();

                            param.Add("sqlId", "SaveFileMap");
                            param.Add("BIZ_ID", this.BIZ_ID);
                            param.Add("FIL_SEQ", Convert.ToInt32(pFIL_SEQ));
                            param.Add("GRP_TYP", "111");
                            param.Add("TIT_NAM", "사진첨부");
                            param.Add("UPD_YMD", sToDay);
                            param.Add("UPD_USR", Logs.strLogin_ID);
                            param.Add("CTNT", "");

                            param.Add("CRE_YMD", sToDay);
                            param.Add("CRE_USR", Logs.strLogin_ID);

                            //저장처리
                            try
                            {
                                BizUtil.Update(param);
                            }
                            catch (Exception ex)
                            {
                                Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.ToString());
                                return;
                            }
                        }

                        InitModel();
                    }
                    //닫기버튼으로 닫힘
                }
            }
            catch (Exception ex)
            {
                Messages.ShowErrMsgBox(ex.ToString());
            }


            //gv.AddNewRow();
            //int newRowHandle = DataControlBase.NewItemRowHandle;
            //grid.SetCellValue(gv.FocusedRowHandle, "PAY_YMD", Convert.ToDateTime(DateTime.Today).ToString("yyyy-MM-dd"));
        }
예제 #3
0
        // 첨부파일 한건추가


        //행삭제 - FIL_SEQ 직접삭제처리
        private void BtnDel_Click(object sender, RoutedEventArgs e)
        {
            //gv.DeleteRow(gv.FocusedRowHandle);


            //데이터 직접삭제처리
            try
            {
                bool isChecked = false;
                foreach (DataRow dr in ((DataTable)grid.ItemsSource).Rows)
                {
                    if ("Y".Equals(dr["CHK"]))
                    {
                        isChecked = true;
                        break;
                    }
                }
                if (!isChecked)
                {
                    Messages.ShowInfoMsgBox("선택된 항목이 없습니다.");
                    return;
                }


                if (Messages.ShowYesNoMsgBox("선택 항목을 삭제 하시겠습니까?") == MessageBoxResult.Yes)
                {
                    for (int i = ((DataTable)grid.ItemsSource).Rows.Count - 1; i >= 0; i--)
                    {
                        Hashtable conditions = new Hashtable();
                        try
                        {
                            if ("Y".Equals(((DataTable)grid.ItemsSource).Rows[i]["CHK"]))
                            {
                                conditions.Clear();
                                conditions.Add("sqlId", "DeleteFileMap");
                                conditions.Add("BIZ_ID", ((DataTable)grid.ItemsSource).Rows[i]["BIZ_ID"].ToString());
                                conditions.Add("FIL_SEQ", ((DataTable)grid.ItemsSource).Rows[i]["FIL_SEQ"].ToString());

                                BizUtil.Update(conditions);

                                ((DataTable)grid.ItemsSource).Rows.RemoveAt(i);
                            }
                        }
                        catch (Exception)
                        {
                        }
                    }

                    Messages.ShowOkMsgBox();
                    InitModel();
                }
            }
            catch (Exception ex)
            {
                Messages.ShowErrMsgBoxLog(ex);
                InitModel();
            }
        }
예제 #4
0
        //그리드저장
        private void BtnReg_Click(object sender, RoutedEventArgs e)
        {
            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }

            Hashtable param = new Hashtable();

            /*기존 파일 삭제
             * param.Add("sqlId", "DeleteFileMng");
             * param.Add("BIZ_ID", BIZ_ID);
             * BizUtil.Update(param);
             */

            //그리드 저장
            DataTable dt = grid.ItemsSource as DataTable;

            foreach (DataRow row in dt.Rows)
            {
                param = new Hashtable();

                if (row.RowState == DataRowState.Modified || row.RowState == DataRowState.Added)
                {
                    param.Add("sqlId", "SaveFileMap");
                    param.Add("BIZ_ID", BIZ_ID);
                    param.Add("FIL_SEQ", Convert.ToInt32(row["FIL_SEQ"]));

                    param.Add("GRP_TYP", "112"); //일반파일
                    param.Add("TIT_NAM", row["TIT_NAM"].ToString());
                    param.Add("UPD_YMD", row["UPD_YMD"].ToString());
                    param.Add("UPD_USR", row["UPD_USR"].ToString());
                    param.Add("CTNT", row["CTNT"].ToString());
                }
                else
                {
                    continue;
                }


                //저장처리
                try
                {
                    BizUtil.Update(param);
                }
                catch (Exception ex)
                {
                    Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.ToString());
                    return;
                }
            }
            //저장처리 성공
            Messages.ShowOkMsgBox();
            InitModel();
        }
예제 #5
0
파일: GisCmm.cs 프로젝트: alsokyun/wfms
        //포인트 폴리곤 DB저장
        public static void SavePolygon(string FTR_CDE, string FTR_IDN, string TABLE_NM)
        {
            Hashtable param = new Hashtable();

            param.Add("sqlId", "updatePolygon");
            param.Add("TABLE_NM", TABLE_NM);
            param.Add("FTR_CDE", FTR_CDE);
            param.Add("FTR_IDN", FTR_IDN);
            param.Add("WKT_POLYGON", WKT_POLYGON);
            BizUtil.Update(param);
        }
예제 #6
0
        //그리드저장
        private void BtnReg_Click(object sender, RoutedEventArgs e)
        {
            if (Messages.ShowYesNoMsgBox("저장하시겠습니까?") != MessageBoxResult.Yes)
            {
                return;
            }

            Hashtable param = new Hashtable();

            //그리드 저장
            DataTable dt = grid.ItemsSource as DataTable;

            foreach (DataRow row in dt.Rows)
            {
                param = new Hashtable();

                if (row.RowState == DataRowState.Modified || row.RowState == DataRowState.Added)
                {
                    param.Add("sqlId", "SaveFtrTagMap");
                    param.Add("G2_ID", row["G2_ID"]);
                    param.Add("FTR_CDE", row["FTR_CDE"]);
                    param.Add("FTR_IDN", row["FTR_IDN"]);

                    param.Add("TAG_ID", row["TAG_ID"]);
                }
                else
                {
                    continue;
                }


                //저장처리
                try
                {
                    BizUtil.Update(param);
                }
                catch (Exception ex)
                {
                    Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.ToString());
                    return;
                }
            }
            //저장처리 성공
            Messages.ShowOkMsgBox();
            SearchAction();
        }
예제 #7
0
        /// <summary>
        /// 저장 이벤트
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                htconditions.Clear();
                htconditions.Add("SYS_CD", FmsUtil.sysCd);
                htconditions.Add("USER_ID", Logs.strLogin_ID);
                htconditions.Add("MNU_CD", "");
                htconditions.Add("SHRTEN_KEY", "");
                htconditions.Add("ORD", "");

                //work.Delete_BASE_FLOW_CALC_INFO(htconditions);
                htconditions.Add("sqlId", "Delete_BASE_FLOW_CALC_INFO");
                BizUtil.Update(htconditions);



                foreach (QuickMNU item in (ObservableCollection <QuickMNU>)gcQuickR.ItemsSource)
                {
                    htconditions["MNU_CD"]     = item.MNU_CD;
                    htconditions["SHRTEN_KEY"] = item.SHRTEN_KEY;
                    htconditions["ORD"]        = ((ObservableCollection <QuickMNU>)gcQuickR.ItemsSource).IndexOf(item);
                    //work.Insert_BASE_FLOW_CALC_INFO(htconditions);
                    htconditions["sqlId"] = "Insert_BASE_FLOW_CALC_INFO";
                    BizUtil.Update(htconditions);
                }

                Messages.ShowOkMsgBox();

                this.Close();
            }
            catch (Exception ex)
            {
                Messages.ShowErrMsgBoxLog(ex);
            }
        }
예제 #8
0
        /// <summary>
        /// 저장 이벤트
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (Messages.ShowYesNoMsgBox("사용자정보를 저장 하시겠습니까?") == MessageBoxResult.Yes)
                {
                    Hashtable htConditions = new Hashtable();

                    if (txtNM.Text.Equals(""))
                    {
                        Messages.ShowErrMsgBox("이름을 입력해주세요.");
                        txtNM.Focus();
                        return;
                    }

                    // 비밀번호 관련 입력란(현재,변경,변경확인)이 공란이면 비밀번호 변경 절차 없음.
                    if (!pwdCurrent.Text.ToString().Equals("") || !pwdChange.Text.ToString().Equals("") || !pwdChangeChk.Text.ToString().Equals(""))
                    {
                        if (pwdCurrent.Text.ToString().Equals(""))
                        {
                            Messages.ShowErrMsgBox("현재 비밀번호를 입력해주세요.");
                            pwdCurrent.Focus();
                            return;
                        }

                        if (pwdChange.Text.ToString().Equals(""))
                        {
                            Messages.ShowErrMsgBox("변경 비밀번호를 입력해주세요.");
                            pwdChange.Focus();
                            return;
                        }

                        if (pwdChangeChk.Text.ToString().Equals(""))
                        {
                            Messages.ShowErrMsgBox("변경 비밀번호 확인을 입력해주세요.");
                            pwdChangeChk.Focus();
                            return;
                        }

                        //입력한 현재 비밀번호가 일치하는지 체크
                        if (EncryptionConvert.Base64Encoding(pwdCurrent.Text.ToString()).Equals(dtLogUserInfo.Rows[0]["USER_PWD"].ToString()))
                        {
                            if (pwdChange.Text.ToString().Equals(pwdChangeChk.Text.ToString()))
                            {
                                htConditions.Add("USER_PWD", EncryptionConvert.Base64Encoding(pwdChange.EditValue.ToString()));
                            }
                            else
                            {
                                Messages.ShowErrMsgBox("변경 비밀번호가 일치하지 않습니다.");
                                pwdChange.Focus();
                                return;
                            }
                        }
                        else
                        {
                            Messages.ShowErrMsgBox("현재 비밀번호가 일치하지 않습니다.");
                            pwdCurrent.Focus();
                            return;
                        }
                    }
                    htConditions.Add("USER_ID", txtID.Text.ToString());
                    htConditions.Add("USER_NM", txtNM.Text.ToString());
                    htConditions.Add("DEPT_CD", lookUpEditDept.EditValue);
                    htConditions.Add("POS_CD", cbGrade.EditValue);
                    htConditions.Add("USER_TEL", txtPhone.Text.ToString());
                    htConditions.Add("EDT_ID", txtID.Text.ToString());
                    htConditions.Add("USE_YN", "Y");
                    htConditions.Add("DEL_YN", "N");

                    //work.Update_SYS_USER_INFO(htConditions);
                    htConditions.Add("sqlId", "Update_SYS_USER_INFO");
                    BizUtil.Update(htConditions);

                    MessageBox.Show("성공적으로 저장하였습니다.");
                    this.Close();

                    if (radioblue.IsChecked == true)
                    {
                        mainWin.Cmblue_Click(null, null);
                    }
                    else if (radionavy.IsChecked == true)
                    {
                        mainWin.Cmnavy_Click(null, null);
                    }
                }
            }
            catch (Exception ex)
            {
                Messages.ShowErrMsgBoxLog(ex);
            }
        }
예제 #9
0
        /// <summary>
        /// 생성자
        /// </summary>
        public FileMngViewModel()
        {
            // 초기로딩처리
            LoadedCommand = new DelegateCommand <object>(OnLoaded);


            // 파일인포리스트
            ItemsFile   = new ObservableCollection <FileInfo>();
            ItemsSelect = new ObservableCollection <FileDtl>();
            ItemsAdd    = new ObservableCollection <FileDtl>();



            //파일저장버튼 이벤트
            SaveFileCmd = new RelayCommand <object>(delegate(object obj)
            {
                if (ItemsFile.Count < 1)
                {
                    MessageBox.Show("저장할 파일이 없습니다.");
                    return;
                }
                upload_thread = new Thread(new ThreadStart(UploadFileListFX));
                upload_thread.Start();
            });

            //첨부내용 저장버튼 이벤트
            SaveCmd = new RelayCommand <object>(OnSave);



            //파일삭제버튼 이벤트
            DelCmd = new DelegateCommand <object>(delegate(object obj)
            {
                string seq = "";
                try
                {
                    seq = obj.ToString();
                }
                catch (Exception) { }

                if (FmsUtil.IsNull(seq) || "0".Equals(seq))
                {
                    Messages.ShowErrMsgBox("삭제할 대상이 없습니다.");
                    return;
                }


                string file_name     = "";
                string del_file_path = "";



                //0.첨부파일정보가져오기
                Hashtable param = new Hashtable();
                try
                {
                    param.Add("FIL_SEQ", Dtl.FIL_SEQ);
                    param.Add("SEQ", seq);
                    param.Add("sqlId", "SelectFileDtl");
                    DataTable dt = BizUtil.SelectList(param);
                    //물리파일명 가져오기
                    file_name = dt.Rows[0]["UPF_NAM"].ToString();
                }
                catch (Exception ex)
                {
                    Messages.ShowInfoMsgBox(ex.ToString());
                    InitModel();
                    return;
                }


                //1.첨부파일상세테이블 삭제
                param["sqlId"] = "DeleteFileSeq";
                BizUtil.Update(param);


                //2.물리적파일 삭제
                del_file_path = System.IO.Path.Combine(dir_name, file_name);
                try
                {
                    FileInfo fi = new FileInfo(del_file_path);
                    fi.Delete();
                }
                catch (Exception) { }

                //삭제성공
                Messages.ShowOkMsgBox();
                InitModel();
            });



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

                try
                {
                    source_file_path = System.IO.Path.Combine(dir_name, file_name2);
                }
                catch (Exception)
                {
                    Messages.ShowErrMsgBox("다운로드할 수 없습니다.");
                    return;
                }


                //파일다운로드
                saveFileDialog       = new System.Windows.Forms.SaveFileDialog();
                saveFileDialog.Title = "저장경로를 지정하세요.";
                //초기 파일명 지정
                saveFileDialog.FileName        = file_name;
                saveFileDialog.OverwritePrompt = true;
                //saveFileDialog.Filter = "Excel|*.xlsx";
                //saveFileDialog.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*";
                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();
                }
            });


            //파일찾기버튼 이벤트
            FindFileCmd = new RelayCommand <object>(delegate(object obj)
            {
                OpenFileDialog openFileDialog   = new OpenFileDialog();
                openFileDialog.Multiselect      = true;
                openFileDialog.Filter           = "All files (*.*)|*.*";
                openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                if (openFileDialog.ShowDialog() == true)
                {
                    FileInfo[] files = openFileDialog.FileNames.Select(f => new FileInfo(f)).ToArray();  //파일인포

                    foreach (FileInfo fi in files)
                    {
                        try
                        {
                            //파일객체
                            ItemsFile.Add(fi);

                            //파일db객체
                            FileDtl dtl = new FileDtl();
                            dtl.DWN_NAM = fi.Name;
                            dtl.FIL_TYP = fi.Extension.Replace(".", "");
                            dtl.FIL_SIZ = fi.Length.ToString();
                            ItemsSelect.Add(dtl);
                        }
                        catch (Exception) {}
                    }
                }
            });



            //윈도우 마우스드래그
            WindowMoveCommand = new DelegateCommand <object>(delegate(object obj)
            {
                try
                {
                    if (Mouse.LeftButton == MouseButtonState.Pressed)
                    {
                        if (fileMngView.WindowState == WindowState.Maximized)
                        {
                            fileMngView.Top  = Mouse.GetPosition(fileMngView).Y - System.Windows.Forms.Cursor.Position.Y - 6;
                            fileMngView.Left = System.Windows.Forms.Cursor.Position.X - Mouse.GetPosition(fileMngView).X + 20;

                            fileMngView.WindowState = WindowState.Normal;
                        }
                        fileMngView.DragMove();
                    }
                }
                catch (Exception ex)
                {
                    Messages.ShowErrMsgBoxLog(ex);
                }
            });
        }
예제 #10
0
        /// <summary>
        /// 그리드삭제
        /// </summary>
        private void OnDelete(object obj)
        {
            //데이터 직접삭제처리
            try
            {
                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)
                {
                    foreach (PdjtInDtl row in GrdLst)
                    {
                        Hashtable param = new Hashtable();
                        try
                        {
                            if ("Y".Equals(row.CHK))
                            {
                                param.Clear();
                                param.Add("sqlId", "DeletePdjtInHtPop");
                                param.Add("PDH_NUM", row.PDH_NUM);

                                if (row.IN_NUM == 0)
                                {
                                    //그리드행만 삭제
                                    GrdLst.RemoveAt(GrdLst.IndexOf(row));
                                    return;
                                }
                                else
                                {
                                    //데이터삭제
                                    param.Add("IN_NUM", row.IN_NUM);
                                    BizUtil.Update(param);
                                }
                            }
                        }
                        catch (Exception)
                        {
                            Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다.");
                            return;
                        }
                    }

                    Messages.ShowOkMsgBox();

                    //재조회
                    initModel();
                }
            }
            catch (Exception ex)
            {
                Messages.ShowErrMsgBoxLog(ex);
            }
        }
예제 #11
0
        /// <summary>
        /// 그리드저장
        /// </summary>
        private void OnSave(object obj)
        {
            bool isChecked = false;

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

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

            Hashtable param = new Hashtable();

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

                param = new Hashtable();
                param.Add("sqlId", "SaveWttSubcDt");
                param.Add("CNT_NUM", CNT_NUM);
                param.Add("SUBC_SEQ", Convert.ToInt32(row.SUBC_SEQ));

                param.Add("SUB_NAM", row.SUB_NAM);  //하도급자
                param.Add("PSB_NAM", row.PSB_NAM);  //하도급 대표자
                param.Add("SUB_TEL", row.SUB_TEL);  //하도급 전화번호
                param.Add("SUB_ADR", row.SUB_ADR);  //하도급 주소

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

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

            //재조회
            //initModel();
            parentInitModel();
        }
예제 #12
0
        /// <summary>
        /// 로딩작업
        /// </summary>
        /// <param name="obj"></param>
        private void OnSave(object obj)
        {
            Hashtable param   = new Hashtable();
            int       nUpdCnt = 0;

            //그리드 저장
            DataTable dt = ucChartMnu.grid.ItemsSource as DataTable;

            foreach (DataRow rowChk in dt.Rows)
            {
                if ("Y".Equals(rowChk["CHK"].ToString()))
                {
                    nUpdCnt++;
                }
            }

            if (nUpdCnt > 0 && nUpdCnt <= 4)
            {
                param.Add("id", Logs.strLogin_ID);
                param.Add("sqlId", "DeleteUserDashMnu");
            }
            else
            {
                if (nUpdCnt > 4)
                {
                    Messages.ShowErrMsgBox("선택은 4개를 초과하실 수 없습니다.");
                }
                else
                {
                    Messages.ShowErrMsgBox("선택하신 내용이 없습니다.(1~4개 선택가능)");
                }

                return;
            }

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

            //저장처리
            try
            {
                //사용자별 기존내용 삭제
                BizUtil.Update(param);

                foreach (DataRow row in dt.Rows)
                {
                    param = new Hashtable();

                    if ("Y".Equals(row["CHK"].ToString()))
                    {
                        param.Add("mnuCd", row["MNU_CD"].ToString());
                        param.Add("id", Logs.strLogin_ID);

                        param.Add("sqlId", "InsertUserDashMnu");
                        BizUtil.Update(param);
                    }
                }
            }
            catch (Exception ex)
            {
                Messages.ShowErrMsgBox("저장 처리중 오류가 발생하였습니다." + ex.ToString());
                return;
            }


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

            //재조회
            InitModel(obj);
        }
예제 #13
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);
        }
예제 #14
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);
                }
            });
        }
예제 #15
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();
        }
예제 #16
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);
        }
예제 #17
0
        /// <summary>
        /// 그리드삭제
        /// </summary>
        private void OnDelete(object obj)
        {
            //데이터 직접삭제처리
            try
            {
                bool isChecked = false;
                foreach (PdjtMaDtl row in GrdLst)
                {
                    if ("Y".Equals(row.CHK))
                    {
                        isChecked = true;
                        break;
                    }
                }
                if (!isChecked)
                {
                    Messages.ShowInfoMsgBox("선택된 항목이 없습니다.");
                    return;
                }

                //자식데이터여부
                foreach (PdjtMaDtl row in GrdLst)
                {
                    if ("Y".Equals(row.CHK))
                    {
                        int cnt = 0;
                        try
                        {
                            cnt = Convert.ToInt32(row.CNT);
                        }
                        catch (Exception) { }
                        if (cnt > 0)
                        {
                            Messages.ShowInfoMsgBox("선택한 항목중에 입고내역이 있습니다.");
                            return;
                        }
                    }
                }



                if (Messages.ShowYesNoMsgBox("선택 항목을 삭제 하시겠습니까?") == MessageBoxResult.Yes)
                {
                    foreach (PdjtMaDtl row in GrdLst)
                    {
                        Hashtable param = new Hashtable();
                        try
                        {
                            if ("Y".Equals(row.CHK))
                            {
                                param.Clear();
                                param.Add("sqlId", "DeletePdjtMa");

                                if (row.PDH_NUM == 0)
                                {
                                    //그리드행만 삭제
                                    GrdLst.RemoveAt(GrdLst.IndexOf(row));
                                    return;
                                }
                                else
                                {
                                    //데이터삭제
                                    param.Add("PDH_NUM", row.PDH_NUM);
                                    BizUtil.Update(param);
                                }
                            }
                        }
                        catch (Exception)
                        {
                            Messages.ShowErrMsgBox("삭제 처리중 오류가 발생하였습니다.");
                            return;
                        }
                    }

                    Messages.ShowOkMsgBox();

                    //재조회
                    SearchAction(null);
                }
            }
            catch (Exception ex)
            {
                Messages.ShowErrMsgBoxLog(ex);
            }
        }