using APT.BaseData.Domain.Entities;
using APT.BaseData.Domain.Entities.FM;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace APT.BaseData.Domain.ApiModel
{
	public class ImportInvokeParamModel
	{
		public ImportInvokeParamModel()
		{
			this.Nav_ChildConfigDetails = new List<ImportInvokeParamModel>();
			this.PageEditColumnNavIncludes = new Dictionary<string, Dictionary<string, byte>>();
			this.PageEditTableIncludes = new Dictionary<string, byte>();
			this.Fields = new List<ImportInvokeFieldModel>();
		}

		public virtual T_FM_IMPORT_CONFIG_DETAIL Nav_ConfigDetail { get; set; }

		public virtual ICollection<ImportInvokeParamModel> Nav_ChildConfigDetails { get; set; }


		public virtual DataTable Nav_DataTable { get; set; }


		public virtual T_PF_PAGE_EDIT Nav_PageEdit { get; set; }

		public ImportDataModel ImportDataModel { get; set; }


		public Dictionary<string, byte> PageEditTableIncludes { get; set; }

		public Dictionary<string,Dictionary<string,byte>> PageEditColumnNavIncludes { get; set; }

		public virtual ICollection<ImportInvokeFieldModel> Fields { get; set; }

		public bool IsUpdate { get; set; }

		public bool IsParentUpdate { get; set; }

		public bool DelFlag { get; set; }
		#region 计算用到

		public Dictionary<string,Guid> KeyPairDic { get; set; }
		public string KeyField { get; set; }
		public string KeyValue { get; set; }


		public Guid? ParentId { get; set; }

		public bool IsParentAdd { get; set; }

		public Dictionary<string, Type> ExistTypes { get; set; }

		#endregion

	}


	public class ImportInvokeFieldModel
	{
		public virtual T_FM_IMPORT_CONFIG_FIELD Nav_ConfigField { get; set; }

		public virtual T_PF_EDIT_COLUMN Nav_EditColumn { get; set; }
	}



	public class ImportTableModel
	{

		public ImportTableModel()
		{
			Nav_SubTables = new List<ImportTableModel>();
			Nav_Columns = new List<ImportTableColumnModel>();
		}

		/// <summary>
		/// 导航属性
		/// </summary>
		public string NavProperty { get; set; }

		public virtual T_FM_IMPORT_CONFIG_DETAIL Nav_ConfigDetail { get; set; }

		public virtual T_PF_PAGE_EDIT Nav_PageEdit { get; set; }


		public virtual ICollection<ImportTableColumnModel> Nav_Columns { get; set; }


		public virtual ICollection<ImportTableModel> Nav_SubTables { get; set; }
	}



	public class ImportTableColumnModel
	{

		public string FieldName { get; set; }

		/// <summary>
		/// 显示名称
		/// </summary>
		public string Label { get; set; }

		public virtual T_PF_EDIT_COLUMN Nav_EditColumn { get; set; }
	}


	public class ImportDataModel
	{
		public ImportDataModel()
		{
			this.MessageList = new List<string>();
		}

		public object Data { get; set; }

		public List<string> MessageList { get; set; }
	}


	public class ImportConfigModel
	{
		public virtual T_FM_IMPORT_CONFIG Nav_ImportConfig { get; set; }

		public virtual T_PF_FORM Nav_EditForm { get; set; }

		public virtual ImportTableModel Nav_ImportTable { get; set; }
	}

	

	 


}
