Esempio n. 1
0
 /// <summary>
 ///  地图导出
 /// </summary>
 /// <param name="MapTime">UTCTime</param>
 /// <param name="FileName">保存路径</param>
 /// <returns></returns>
 public bool Export_Map(long MapTime, string FileName)
 {
     try
     {
         string sql = IO_AGVMapService.ExportSettings(MapTime, "agv") + IO_AGVMapService.ExportMySqlTables("tag" + MapTime, "agv") + IO_AGVMapService.ExportMySqlTables("line" + MapTime, "agv") + IO_AGVMapService.ExportMySqlTables("device" + MapTime, "agv") + IO_AGVMapService.ExportMySqlTables("widget" + MapTime, "agv") + IO_AGVMapService.ExportMySqlTables("route" + MapTime, "agv");
         sql = sql + IO_AGVMapService.ExportTableContents("map", "agv", MapTime.ToString());
         File.WriteAllText(FileName, sql);
         return(true);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 导出日志
 /// </summary>
 /// <param name="path"></param>
 /// <param name="DateTime"></param>
 public void LogWrite(string path, string DateTime)
 {
     try
     {
         string        Tableresult = OperateIniTool.OperateIniRead("Table", "Name");
         List <string> Table       = !string.IsNullOrEmpty(Tableresult) ? Tableresult.Split(',').ToList() : new List <string>();
         StringBuilder builder     = new StringBuilder();
         foreach (var item in Table)
         {
             if (MapBLL.TableNotexistBLL($"{item}{DateTime}"))
             {
                 builder.Append(MapBLL.ExportMySqlTables($"{item}{DateTime}", "agv"));
             }
         }
         File.WriteAllText(path, builder.ToString());
     }
     catch (Exception ex)
     {
         throw new Exception(ex.ToString());
     }
 }