///-------------------------------------------------------------------------- /// <summary> /// 楽商用受入データ作成クラスコンストラクタ</summary> /// <param name="preFrm"> /// 親フォーム</param> /// <param name="dtsC"> /// NHBR_CLIDataSet</param> /// <param name="_dts"> /// NHBRDataSet:データセットオブジェクト</param> /// <param name="Conn"> /// Oracle.ManagedDataAccess.Client.OracleConnection : 接続情報</param> /// <param name="myCode"> /// 担当者コード</param> ///-------------------------------------------------------------------------- public OCROutput(Form preFrm, NHBR_CLIDataSet dtsC, NHBRDataSet _dts, Oracle.ManagedDataAccess.Client.OracleConnection Conn, string myCode) { _preForm = preFrm; _dtsC = dtsC; dts = _dts; _hTbl = dtsC.FAX注文書; _pTbl = _dts.パターンID; _Conn = Conn; _myCode = myCode; cnfAdp.Fill(dts.環境設定); }
private void button4_Click(object sender, EventArgs e) { NHBR_CLIDataSet dtsC = new NHBR_CLIDataSet(); NHBR_CLIDataSetTableAdapters.FAX注文書TableAdapter adp = new NHBR_CLIDataSetTableAdapters.FAX注文書TableAdapter(); NHBR_CLIDataSetTableAdapters.保留注文書TableAdapter hAdp = new NHBR_CLIDataSetTableAdapters.保留注文書TableAdapter(); // データ読み込み adp.Fill(dtsC.FAX注文書); hAdp.Fill(dtsC.保留注文書); // 自らのロックファイルを削除する Utility.deleteLockFile(Properties.Settings.Default.dataPath, Properties.Settings.Default.lockFileName); //他のPCで処理中の場合、続行不可 if (Utility.existsLockFile(Properties.Settings.Default.dataPath)) { MessageBox.Show("他のPCで処理中です。しばらくおまちください。", "確認", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } // タイマー監視受信したFAX発注書件数 int s = System.IO.Directory.GetFiles(Properties.Settings.Default.dataPath, "*.tif").Count(); // 処理中の注文書データ int d = dtsC.FAX注文書.Count(); // 保留中データ int h = dtsC.保留注文書.Count(); // 処理可能なデータが存在するか? if (s == 0 && d == 0 && h == 0) { MessageBox.Show("現在、処理可能なFAX注文書データはありません", "確認", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } //LOCKファイル作成 Utility.makeLockFile(Properties.Settings.Default.dataPath, Properties.Settings.Default.lockFileName); this.Hide(); // 担当者コードを入力 frmUserCode frmCode = new frmUserCode(); frmCode.ShowDialog(); string _myCode = frmCode.myCode; frmCode.Dispose(); if (_myCode == string.Empty) { // ロックファイルを削除する Utility.deleteLockFile(Properties.Settings.Default.dataPath, Properties.Settings.Default.lockFileName); // 処理をキャンセル Show(); } else { // 処理するデータを取得 frmFaxSelect frmFax = new frmFaxSelect(); frmFax.ShowDialog(); int _myCnt = frmFax.myCnt; bool _myBool = frmFax.myBool; frmFax.Dispose(); // ロックファイルを削除する Utility.deleteLockFile(Properties.Settings.Default.dataPath, Properties.Settings.Default.lockFileName); if (!_myBool) { Show(); } else { // データ作成処理へ frmCorrect frm = new frmCorrect(_myCode.ToString()); frm.ShowDialog(); } } Show(); }