Esempio n. 1
0
 /// <summary>
 /// 批量修改进口日期
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void barBtnUpdateDate_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
     {
         try
         {
             ImportCsv     importCsv    = new ImportCsv();
             List <string> fileNameList = new List <string>();
             DirectoryInfo folder       = new DirectoryInfo(folderBrowserDialog1.SelectedPath);
             foreach (FileInfo file in folder.GetFiles("*.xls"))
             {
                 fileNameList.Add(file.FullName);
             }
             if (fileNameList.Count > 0)
             {
                 foreach (string fileName in fileNameList)
                 {
                     if (importCsv.ReadUpdateDate(fileName) == 1)
                     {
                         MessageBox.Show(fileName + "批量修改时间成功");
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         this.searchLocal();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 批量修改进口日期
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void barBtnUpdateDate_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         ImportCsv importCsv = new ImportCsv();
         if (importCsv.ReadUpdateDate(openFileDialog1.FileName, "") == 1)
         {
             MessageBox.Show("批量修改时间成功");
         }
         else
         {
             MessageBox.Show("批量修改时间失败");
         }
         this.searchLocal();
     }
 }