年度变更建库软件5.0版本
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

201 lines
5.1 KiB

6 months ago
using KGIS.Framework.Platform;
using System.Collections.Generic;
using System.ComponentModel;
namespace Kingo.Plugin.DTBJKLoadData.Model
{
/// <summary>
/// 表映射关系
/// </summary>
public class TableMapping : INotifyPropertyChanged
{
/// <summary>
/// 源数据表名
/// </summary>
public string S_TableName { get; set; }
/// <summary>
/// 源数据表名
/// </summary>
public string S_TableAliasName { get; set; }
/// <summary>
/// 源数据路径
/// </summary>
public string S_TablePath { get; set; }
/// <summary>
/// 数据源表类型
/// </summary>
public string S_TableType { get; set; }
/// <summary>
/// 坐标系
/// </summary>
public string S_Spatial { get; set; }
private bool _NotNull { get; set; }
/// <summary>
/// 不为Null
/// </summary>
public bool NotNull
{
get { return _NotNull; }
set
{
_NotNull = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("NotNull"));
}
}
private string _T_TableName;
/// <summary>
/// 目标数据表名
/// </summary>
public string T_TableName
{
get { return _T_TableName; }
set
{
_T_TableName = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("T_TableName"));
}
}
/// <summary>
/// 目标数据表名
/// </summary>
public string T_TableAliasName { get; set; }
/// <summary>
/// 目标表类型
/// </summary>
public string T_TableType { get; set; }
/// <summary>
/// 目标排序
/// </summary>
public int OrderIndex { get; set; }
/// <summary>
/// 条件sql语句
/// </summary>
private string _S_YSDM_SQL;
public string S_YSDM_SQL
{
get
{
return _S_YSDM_SQL;
}
set
{
_S_YSDM_SQL = value;
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs("S_YSDM_SQL"));
}
}
}
private List<FieldMapping> _FieldMapping;
/// <summary>
/// 字段映射信息
/// </summary>
public List<FieldMapping> FieldMapping
{
get { return _FieldMapping; }
set
{
_FieldMapping = value;
int count = _FieldMapping.FindAll(f => f.S_FieldIndex == -1).Count;
if (count == 0)
{
FieldMappingMsg = "所有字段已匹配";
}
else
{
FieldMappingMsg = string.Format("{0} 个字段未匹配", count);
}
}
}
/// <summary>
/// 目标数据表值域
/// </summary>
public List<DataDicTionary> T_TableList { get; set; }
private string _FieldMappingMsg;
public string FieldMappingMsg
{
get
{
return _FieldMappingMsg;
}
set
{
_FieldMappingMsg = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("FieldMappingMsg"));
}
}
#region
private TBState _State;
public TBState State
{
get { return _State; }
set
{
_State = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("State"));
}
}
private int _Count;
/// <summary>
/// 总进度
/// </summary>
public int Count
{
get
{
return _Count;
}
set
{
_Count = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Count"));
}
}
private int _Progress;
/// <summary>
/// 当前进度
/// </summary>
public int Progress
{
get
{
return _Progress;
}
set
{
_Progress = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Progress"));
}
}
#endregion
public event PropertyChangedEventHandler PropertyChanged;
}
public enum TBState
{
/// <summary>
/// 等待中
/// </summary>
Waiting = 0,
/// <summary>
/// 删除
/// </summary>
Delete = 1,
/// <summary>
/// 开始导入
/// </summary>
BeingImport = 2,
/// <summary>
/// 结束导入
/// </summary>
EndImport = 3
}
}