Beispiel #1
0
 private void btnExport_Click(object sender, EventArgs e)
 {
     try
     {
         ExportCode code = new ExportCode {
             BmType = this.GetBMType()
         };
         if (code.ShowDialog() == DialogResult.OK)
         {
             string str = "";
             if (!Directory.Exists(code.FilePath.Remove(code.FilePath.LastIndexOf(@"\"))))
             {
                 MessageManager.ShowMsgBox("INP-235129");
             }
             else
             {
                 ProgressHinter instance = ProgressHinter.GetInstance();
                 try
                 {
                     instance.SetMsg("正在导出" + this.treeViewBM1.RootNodeString + "...");
                     instance.StartCycle();
                     str = this.bllManager.ExportData(code.FilePath, code.Separator, null);
                 }
                 catch
                 {
                     throw;
                 }
                 finally
                 {
                     instance.CloseCycle();
                 }
                 if (str == "0")
                 {
                     MessageManager.ShowMsgBox("INP-235119");
                 }
                 else
                 {
                     MessageManager.ShowMsgBox("INP-235120", "导出失败", new string[] { str });
                 }
                 code.Close();
             }
         }
     }
     catch (Exception exception)
     {
         this.log.Error(exception.ToString());
         ExceptionHandler.HandleError(exception);
     }
 }
Beispiel #2
0
 private void btnExport_Click(object sender, EventArgs e)
 {
     try
     {
         ExportCode code = new ExportCode {
             BmType = BMType.GoodsTax
         };
         if (code.ShowDialog() == DialogResult.OK)
         {
             string str = "";
             if (!Directory.Exists(code.FilePath.Remove(code.FilePath.LastIndexOf(@"\"))))
             {
                 MessageManager.ShowMsgBox("INP-235129");
             }
             else
             {
                 try
                 {
                     str = this.customerManager.ExportGoodsTax(code.FilePath, code.Separator);
                 }
                 catch
                 {
                     throw;
                 }
                 if (str == "0")
                 {
                     MessageManager.ShowMsgBox("INP-235119");
                 }
                 else
                 {
                     MessageManager.ShowMsgBox("INP-235120", "导出失败", new string[] { str });
                 }
                 code.Close();
             }
         }
     }
     catch (Exception exception)
     {
         this.log.Error(exception.ToString());
         ExceptionHandler.HandleError(exception);
     }
 }