private void button9_Click(object sender, EventArgs e) { // キャンペーン画像確認 if (System.IO.Directory.GetFiles(Properties.Settings.Default.campaignPath, "*.tif").Count() == 0 && System.IO.Directory.GetFiles(Properties.Settings.Default.camPaignWorhPath, "*.tif").Count() == 0) { MessageBox.Show("キャンペーンリカバリーデータがありません", "キャンペーン発注処理", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } // キャンペーン発注書登録処理 this.Hide(); // 担当者コードを入力 frmUserCode frmCode = new frmUserCode(); frmCode.ShowDialog(); string _myCode = frmCode.myCode; frmCode.Dispose(); if (_myCode != string.Empty) { frmCanpaignRec frm = new frmCanpaignRec(_myCode); frm.ShowDialog(); } Show(); }
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(); }