示例#1
0
        private void Reentrant()
        {
            log("---->Begin to reentrant the Job!");
            Schedule(() =>
            {
                string[] txtFiles = Directory.GetFiles(path, "*.zip", SearchOption.AllDirectories);
                string fileName   = string.Empty;
                string tempFolder = string.Empty;
                foreach (string file in txtFiles)
                {
                    fileName   = file.Substring(file.LastIndexOf("\\") + 1);
                    tempFolder = unZipTempFolder + "\\" + fileName.Remove(fileName.IndexOf("."));
                    log("------------------->tempFolder:" + tempFolder);
                    ZipHelper.UnZip(file, tempFolder);
                    //Console.WriteLine("Un zip success !");

                    String excelFile1 = tempFolder + "\\利润表.xls";
                    String excelFile2 = tempFolder + "\\现金流量表.xls";
                    String excelFile3 = tempFolder + "\\资产表.xls";

                    ImportToData.ImportAllProfit(excelFile1);
                    ImportToData.ImportAllBalance(excelFile2);
                    ImportToData.ImportAllCashFlow(excelFile3);
                    File.Move(file, finishBackup + fileName);
                }
                // Thread.Sleep(TimeSpan.FromSeconds(3));
            }).WithName("[reentrant]").ToRunEvery(30).Minutes();//.ToRunNow().AndEvery(30).Minutes();
        }
示例#2
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            String excelFile = @"D:\project\hongxian\厦门14-4-12.xls";

            ImportToData.ImportAllCompany(excelFile);//.ImportAllProfit(excelFile);
            MessageBox.Show("完成!");
        }
示例#3
0
        private static int getBaseId(DataTable data)
        {
            for (int i = 0; i < 6; i++)
            {
                if (data.Rows[i][1] == null || data.Rows[i][1].ToString().Length == 0)
                {
                    Console.WriteLine("表头[" + data.Rows[i][0] + "]必填信息为空!");
                    return(0);
                }
            }
            object obj = data.Rows[0][1];

            if (null == obj)
            {
                log("提交的数据缺失!" + data.TableName);
                return(0);
            }
            string taxpayer_id   = data.Rows[0][1].ToString();
            string taxpayer_name = data.Rows[1][1].ToString();
            string certificate   = data.Rows[2][1].ToString();

            DateTime dt           = DateTime.Now;
            string   declare_date = DateTime.Parse(data.Rows[3][1].ToString()).ToString("yyyy-MM-dd");
            string   filling_date = DateTime.Parse(data.Rows[4][1].ToString()).ToString("yyyy-MM-dd");
            string   report_date  = DateTime.Parse(data.Rows[5][1].ToString()).ToString("yyyy-MM-dd");

            int id = ImportToData.saveBase(taxpayer_id, taxpayer_name, certificate, declare_date, filling_date, report_date);

            return(id);
        }