Exemple #1
0
        protected override ImportResult ImportMethod(string path)
        {
            ImportResult result;

            if (path.ToLower().EndsWith(".dat") && this.spManager.IsXTCorp())
            {
                return(this.spManager.ImportXTSP(path, true));
            }
            ProgressHinter instance = ProgressHinter.GetInstance();

            instance.SetMsg("正在导入" + base.treeViewBM1.RootNodeString + "...");
            instance.StartCycle();
            try
            {
                if (path.EndsWith(".xml"))
                {
                    return(this.spManager.ImportDataZC(path));
                }
                if (path.EndsWith(".txt"))
                {
                    return(this.spManager.ImportData(path));
                }
                result = new ImportResult();
            }
            catch
            {
                throw;
            }
            finally
            {
                instance.CloseCycle();
            }
            return(result);
        }
Exemple #2
0
        protected virtual ImportResult ImportMethod(string path)
        {
            ImportResult   result;
            ProgressHinter instance = ProgressHinter.GetInstance();

            instance.SetMsg("正在导入" + this.treeViewBM1.RootNodeString + "...");
            instance.StartCycle();
            try
            {
                if (path.EndsWith(".txt"))
                {
                    return(this.bllManager.ImportData(path));
                }
                result = new ImportResult();
            }
            catch
            {
                throw;
            }
            finally
            {
                instance.CloseCycle();
            }
            return(result);
        }
Exemple #3
0
        private bool ZengWeiJianWei(bool isZengWei)
        {
            bool flag = false;

            try
            {
                string         str      = "";
                ProgressHinter instance = ProgressHinter.GetInstance();
                try
                {
                    instance.SetMsg("正在修改" + this.treeViewBM1.RootNodeString + "...");
                    instance.StartCycle();
                    this.selectbm = this.treeViewBM1.SelectedNode.Name;
                    str           = this.bllManager.ExecZengJianWei(this.selectbm, isZengWei);
                }
                catch
                {
                    throw;
                }
                finally
                {
                    instance.CloseCycle();
                }
                if (str == "0")
                {
                    this.bllManager.CurrentPage = 1;
                    this.dataSet = this.bllManager.SelectNodeDisplay(this.selectbm, this.bllManager.Pagesize, this.bllManager.CurrentPage);
                    this.aisinoDataGrid1.DataSource = this.dataSet;
                    flag = true;
                }
                else if (str == "ezw")
                {
                    MessageManager.ShowMsgBox("INP-235111");
                }
                else if (str == "ejw")
                {
                    MessageManager.ShowMsgBox("INP-235112");
                }
                else
                {
                    MessageManager.ShowMsgBox("INP-235114");
                }
                return(flag);
            }
            catch (Exception exception)
            {
                this.log.Error(exception.ToString());
                ExceptionHandler.HandleError(exception);
                return(flag);
            }
        }
Exemple #4
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);
     }
 }
Exemple #5
0
 private void btnImport_Click(object sender, EventArgs e)
 {
     try
     {
         ImportCode code = new ImportCode {
             BmType = this.GetBMType()
         };
         if (code.ShowDialog() == DialogResult.OK)
         {
             code.Visible = false;
             ImportReport report = new ImportReport(this.ImportMethod(code.FilePath));
             if (this.GetBMType() != BMType.BM_SPFL)
             {
                 report.ShowDialog();
             }
             ProgressHinter instance = ProgressHinter.GetInstance();
             instance.SetMsg("正在调整" + this.treeViewBM1.RootNodeString + "...");
             instance.StartCycle();
             try
             {
                 ServiceFactory.InvokePubService("Aisino.Fwkp.Bmgl.AdjustTopBM", new object[] { this.GetBMType().ToString() });
             }
             catch
             {
                 throw;
             }
             finally
             {
                 instance.CloseCycle();
             }
             this.aisinoDataGrid1.DataSource = this.bllManager.QueryData(this.bllManager.Pagesize, this.bllManager.CurrentPage);
             this.treeViewBM1.TreeLoad();
             this.treeViewBM1.SelectNodeByText(this.treeViewBM1.RootNodeString);
         }
     }
     catch (CustomException exception)
     {
         MessageBoxHelper.Show(exception.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     catch (Exception exception2)
     {
         this.log.Error(exception2.ToString());
         ExceptionHandler.HandleError(exception2);
     }
 }