Ejemplo n.º 1
0
        private bool GetReport()
        {
            bool rtn = false;
            //string reportFile = System.Windows.Forms.Application.StartupPath + "/report.xlsm";
            //string sourceFile = System.Windows.Forms.Application.StartupPath + "/clarity.xls";
            string   reportFile = "c:/clasp32/data" + "/test.xlsm";
            string   sourceFile = "c:/clasp32/data" + "/clarity.xls";
            string   dataFile   = System.Windows.Forms.Application.StartupPath + "/data.xml";
            string   testFile   = ConfigurationManager.AppSettings["sourceAddress"];
            FileInfo fileInfo   = new FileInfo(testFile);

            SysVar.dtNow = DateTime.Parse(fileInfo.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss"));
            //有最新文件,开始上传数据
            if (DateTime.Compare(SysVar.dtNow, SysVar.dtOld) > 0)
            {
                SysVar.dtOld = SysVar.dtNow;
                DataProcess dp = new DataProcess(reportFile, sourceFile, testFile, dataFile);
                rtn = dp.uploadInfo();
            }
            else
            {
                rtn = false;
                // XtraMessageBox.Show("测试数据没有生成,请重新测试,如果还是不成功请联系管理员!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                LogHelper.WriteLog("测试数据没有生成,请重新测试,如果还是不成功请联系管理员!");
            }
            return(rtn);
        }
Ejemplo n.º 2
0
 private void testUpload()
 {
     string      reportFile = "c:/clasp32/data" + "/test.xlsm";
     string      sourceFile = "c:/clasp32/data" + "/clarity.xls";;
     string      dataFile   = System.Windows.Forms.Application.StartupPath + "/data.xml";
     string      testFile   = ConfigurationManager.AppSettings["sourceAddress"];
     DataProcess dp         = new DataProcess(reportFile, sourceFile, testFile, dataFile);
     bool        rtn        = dp.uploadInfo();
     string      haha       = "";
 }