예제 #1
0
 private void mnFileDataViewAppend_Click(object sender, EventArgs e)
 {
     this.ofdMain.Multiselect = true;
     this.ofdMain.InitialDirectory = this.GetInitialDirectory();
     if (this.ofdMain.ShowDialog() == DialogResult.OK)
     {
         DeleteRestore restore = new DeleteRestore(3);
         restore.Show();
         restore.pgbRestore.Minimum = 0;
         restore.pgbRestore.Maximum = this.ofdMain.FileNames.Length;
         try
         {
             int num = 0;
             foreach (string str in this.ofdMain.FileNames)
             {
                 IData data;
                 num++;
                 restore.pgbRestore.Value = num;
                 restore.Refresh();
                 try
                 {
                     data = DataFactory.LoadFromEdiFile(str);
                 }
                 catch (Exception exception)
                 {
                     MessageDialog dialog = new MessageDialog();
                     dialog.ShowMessage("E302", str, null, exception);
                     dialog.Dispose();
                     return;
                 }
                 if (data.Header.OutCode.Trim() != "")
                 {
                     this.idv.AppendJobData(data, 2, false, false, false);
                 }
                 else
                 {
                     using (MessageDialog dialog2 = new MessageDialog())
                     {
                         dialog2.ShowMessage("W406", null, null);
                     }
                 }
             }
         }
         finally
         {
             restore.Close();
             restore.Dispose();
             this.idv.DataViewSaveRepaint();
         }
     }
 }
예제 #2
0
 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();
         }
     }
 }