private void SeqLoad(object sender) { if (this.SeqList != null) { this.SeqInt++; if (this.SeqInt >= this.SeqList.Count) { this.stbInfomation.Text = this.ProtocolName; this.stbInfomation.Font = new Font(this.stbInfomation.Font, FontStyle.Regular); this.SeqList = null; } else { FileInfo info = new FileInfo(this.SeqList[this.SeqInt]); string name = info.Name; string[] strArray = new string[] { "順次ファイル選択中 ", (this.SeqInt + 1).ToString(), "/", this.SeqList.Count.ToString(), " <", name, "> " }; this.stbInfomation.Text = string.Concat(strArray); this.stbInfomation.Font = new Font(this.stbInfomation.Font, FontStyle.Bold); IData data = null; try { data = DataFactory.LoadFromEdiFile(this.SeqList[this.SeqInt]); } catch (Exception exception) { MessageDialog dialog = new MessageDialog(); dialog.ShowMessage("E302", this.SeqList[this.SeqInt], null, exception); dialog.Dispose(); return; } if ((sender != null) || !(data.JobCode.Trim() == "")) { if (data != null) { if ((sender == null) && !this.SearchDispCode(data)) { UJobInputDlg dlg = new UJobInputDlg(); dlg.SetCodeSelect(data.JobCode.Trim()); if (dlg.ShowDialog() != DialogResult.OK) { dlg.Close(); dlg.Dispose(); return; } data.Header.DispCode = dlg.DispCode; dlg.Close(); dlg.Dispose(); } this.JobFormOpen(data, sender); } } else { this.JobError(-1); } } } }
private void mnJobNew_Click(object sender, EventArgs e) { string jobCode; string dispCode; UJobInputDlg dlg = new UJobInputDlg(); dlg.HistoryJobListSet(this.HJobList); if (dlg.ShowDialog() == DialogResult.OK) { jobCode = dlg.JobCode; dispCode = dlg.DispCode; dlg.Close(); dlg.Dispose(); } else { dlg.Close(); dlg.Dispose(); return; } this.JobFormOpen(jobCode, dispCode); }
public virtual string Job_OnCreateNewForm(object sender, IData data) { ((CommonJobForm) sender).Close(); if (data.JobCode.Trim() == "") { this.JobError(-1); return data.ID; } if (!this.SearchDispCode(data)) { UJobInputDlg dlg = new UJobInputDlg(); dlg.SetCodeSelect(data.JobCode.Trim()); if (dlg.ShowDialog() != DialogResult.OK) { dlg.Close(); dlg.Dispose(); return data.ID; } data.Header.DispCode = dlg.DispCode; dlg.Close(); dlg.Dispose(); } this.JobFormOpen(data); return data.ID; }
private void mnFileOpen_Click(object sender, EventArgs e) { this.ofdMain.Multiselect = false; this.ofdMain.InitialDirectory = this.GetInitialDirectory(); if (this.ofdMain.ShowDialog() == DialogResult.OK) { IData data = null; try { data = DataFactory.LoadFromEdiFile(this.ofdMain.FileName); } catch (Exception exception) { MessageDialog dialog = new MessageDialog(); dialog.ShowMessage("E302", this.ofdMain.FileName, null, exception); dialog.Close(); dialog.Dispose(); return; } if (!(data.JobCode.Trim() == "")) { if (!this.SearchDispCode(data)) { UJobInputDlg dlg = new UJobInputDlg(); dlg.SetCodeSelect(data.JobCode.Trim()); if (dlg.ShowDialog() != DialogResult.OK) { dlg.Close(); dlg.Dispose(); return; } data.Header.DispCode = dlg.DispCode; dlg.Close(); dlg.Dispose(); } this.JobFormOpen(data); } else { this.JobError(-1); } } }
private void FileSend(object sender) { this.cancelflag = false; if (base.ComStatus == 0) { MessageDialog dialog = new MessageDialog(); if (dialog.ShowMessage("C102", "") != DialogResult.Yes) { dialog.Dispose(); return; } dialog.Dispose(); } base.ofdMain.Multiselect = true; base.ofdMain.InitialDirectory = base.GetInitialDirectory(); if (base.ofdMain.ShowDialog() == DialogResult.OK) { base.SendReportDlg.Dispose(); base.SendReportDlg = new USendReportDlg(); base.BatchSendFlag = true; DeleteRestore restore = new DeleteRestore(1) { pgbRestore = { Minimum = 0, Maximum = base.ofdMain.FileNames.Length } }; restore.Show(); base.Enabled = false; base.SendReportDlg.Clear(); for (int i = 0; i < base.ofdMain.FileNames.Length; i++) { restore.pgbRestore.Value = i + 1; restore.Refresh(); base.SendReportDlg.Add(base.ofdMain.FileNames[i]); Application.DoEvents(); IData data = null; try { data = DataFactory.LoadFromEdiFile(base.ofdMain.FileNames[i]); } catch (Exception exception) { base.SendReportDlg.SetStatus(i, USendReportDlg.ReportStatus.Error, null, "Failure in Registering."); MessageDialog dialog2 = new MessageDialog(); dialog2.ShowMessage("E302", base.ofdMain.FileNames[i], null, exception); dialog2.Dispose(); continue; } if ((sender == null) && (data.JobCode.Trim() == "")) { base.SendReportDlg.SetStatus(i, USendReportDlg.ReportStatus.Error, null, "Failure in Registering."); base.JobError(-1); } else if (data != null) { object obj2; if (sender == null) { if (!base.SearchDispCode(data)) { UJobInputDlg dlg = new UJobInputDlg(); dlg.SetCodeSelect(data.JobCode.Trim()); if (dlg.ShowDialog() == DialogResult.OK) { data.Header.DispCode = dlg.DispCode; dlg.Close(); dlg.Dispose(); } else { dlg.Close(); dlg.Dispose(); base.SendReportDlg.SetStatus(i, USendReportDlg.ReportStatus.Error, null, "Failure in Registering."); continue; } } obj2 = base.JobFormOpen(data, false); } else { try { ((CommonJobForm) sender).SetSendData(data); obj2 = sender; } catch { base.JobError(-11); continue; } } if (obj2 == null) { base.SendReportDlg.SetStatus(i, USendReportDlg.ReportStatus.Error, null, "Failure in Registering."); } else { string str; try { str = ((CommonJobForm) obj2).AppendJobData(); } catch { str = ""; } if (str == "") { base.SendReportDlg.SetStatus(i, USendReportDlg.ReportStatus.Error, null, "Failure in Registering."); } else { if (sender == null) { ((CommonJobForm) obj2).Close(); ((CommonJobForm) obj2).Dispose(); } base.SendReportDlg.SetStatus(i, USendReportDlg.ReportStatus.Wait, str, ""); } } } else { base.SendReportDlg.SetStatus(i, USendReportDlg.ReportStatus.Error, null, "Failure in Registering."); } } base.Enabled = true; this.SendRecvDlgHide(); restore.Close(); restore.Dispose(); if (base.ComStatus == 1) { base.StatusChange(1); this.bSendFlag = true; bool flg = true; if (base.idv.sExistenceCheck()) { MessageDialog dialog3 = new MessageDialog(); if (dialog3.ShowMessage("I105", "") == DialogResult.Yes) { this.SendAllCount = base.idv.GetCount(1); flg = true; } else { this.SendAllCount = base.idv.GetCount(5); flg = false; } } else { this.SendAllCount = base.idv.GetCount(1); } this.SendCount = 0; this.BatchSend(flg); } else { base.BatchSendFlag = false; MessageDialog dialog4 = new MessageDialog(); if (dialog4.ShowMessage("I002", base.SendReportDlg.StatusCount(USendReportDlg.ReportStatus.Wait).ToString(), "") == DialogResult.Yes) { base.SendReportDlg.Show(); } dialog4.Dispose(); } } }