using KGIS.Framework.Platform;
using System.Collections.Generic;
using System.ComponentModel;
namespace Kingo.Plugin.DTBJKLoadData.Model
{
///
/// 表映射关系
///
public class TableMapping : INotifyPropertyChanged
{
///
/// 源数据表名
///
public string S_TableName { get; set; }
///
/// 源数据表名
///
public string S_TableAliasName { get; set; }
///
/// 源数据路径
///
public string S_TablePath { get; set; }
///
/// 数据源表类型
///
public string S_TableType { get; set; }
///
/// 坐标系
///
public string S_Spatial { get; set; }
private bool _NotNull { get; set; }
///
/// 不为Null
///
public bool NotNull
{
get { return _NotNull; }
set
{
_NotNull = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("NotNull"));
}
}
private string _T_TableName;
///
/// 目标数据表名
///
public string T_TableName
{
get { return _T_TableName; }
set
{
_T_TableName = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("T_TableName"));
}
}
///
/// 目标数据表名
///
public string T_TableAliasName { get; set; }
///
/// 目标表类型
///
public string T_TableType { get; set; }
///
/// 目标排序
///
public int OrderIndex { get; set; }
///
/// 条件sql语句
///
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;
///
/// 字段映射信息
///
public List 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);
}
}
}
///
/// 目标数据表值域
///
public List 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;
///
/// 总进度
///
public int Count
{
get
{
return _Count;
}
set
{
_Count = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Count"));
}
}
private int _Progress;
///
/// 当前进度
///
public int Progress
{
get
{
return _Progress;
}
set
{
_Progress = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Progress"));
}
}
#endregion
public event PropertyChangedEventHandler PropertyChanged;
}
public enum TBState
{
///
/// 等待中
///
Waiting = 0,
///
/// 删除
///
Delete = 1,
///
/// 开始导入
///
BeingImport = 2,
///
/// 结束导入
///
EndImport = 3
}
}