Shuxia Ning
2024-10-08 cf4967a0aebab18c5a37137f3e4c61b2d73a54bb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using SqlSugar;
using System.IO;
 
namespace IStation.DAL
{
    /// <summary>
    /// 数据来源
    /// </summary>    
    public class MonitorDataSources : FileDAL_Sorter_Flags_TagName<Entity.MonitorDataSources>
    {
        public override string FileName
        {
            get { return FileHelper.GetFilePath<Entity.MonitorDataSources>(Settings.Project.ID); }
        }
 
        public override bool DeleteByID(long id)
        {
            var bol = base.DeleteByID(id);
            if (bol)
            {
                var projectFolder = FileHelper.GetProjectFolder(Settings.Project.ID);
                var monitorDataSourcesFolder = Path.Combine(projectFolder, id.ToString());
                if (Directory.Exists(monitorDataSourcesFolder))
                {
                    Directory.Delete(monitorDataSourcesFolder, true);
                }
            }
            return bol;
        }
    }
}