初始化

This commit is contained in:
2025-11-25 17:41:24 +08:00
commit 4cdf0f0f85
3383 changed files with 1050962 additions and 0 deletions

18
.gitignore vendored Normal file
View File

@@ -0,0 +1,18 @@
#Visual Studio cache files
.vs/
# Build results
[Dd]ebug/
[Rr]elease/
# test file
Upload/firmware/
# error log file
Face.Web/App_Data/UDPLog/
Face.Web/App_Data/Log
/Face.Web/bin
/packages
/Face.RegularDeleteLogs/obj
/Face.RegularDeleteLogs/bin
/Face.Web/Properties/PublishProfiles/*.user

Binary file not shown.

92
Face-DATA.sln Normal file
View File

@@ -0,0 +1,92 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33627.172
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web", "Web", "{52D25030-5B02-42A5-A203-1EA154428687}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{8907B38B-9A78-4EFE-A148-82C3A0D86303}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{1AC3773A-D26E-4C04-BE74-AA99B52484B0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Infrastructure", "Infrastructure", "{FB2DB0B0-8434-4E32-AA55-0CAF2E6AA0FE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WindowsService", "WindowsService", "{3ECF681B-93F4-4059-9D38-BA9958420572}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Face.Domain", "Face.Domain\Face.Domain.csproj", "{709AA98F-388F-44DD-B64B-AD44E695C34C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Face.Domain.ViewModels", "Face.Domain.ViewModels\Face.Domain.ViewModels.csproj", "{BE790400-C1EE-4D97-B3F1-604F6831E5E7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Face.Log4Net", "Face.Log4Net\Face.Log4Net.csproj", "{5500F9DD-89D9-40F3-B62F-90C6B633D55A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Face.Services", "Face.Services\Face.Services.csproj", "{56438F1C-BA3A-4272-964E-C6739AE0B4EC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Face.WindowsService", "Face.WindowsService\Face.WindowsService.csproj", "{A9F6DA6D-65AD-4DA4-8097-7FBEBC710DF3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Face.Web", "Face.Web\Face.Web.csproj", "{831A25A4-DAEC-43D6-8D24-DEC6DDA196DD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Face.SystemTask", "Face.SystemTask\Face.SystemTask.csproj", "{5CEB682A-8023-4F08-B89D-7216B7BAAA03}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebServer", "WebServer\WebServer.csproj", "{88515D7C-4B2F-4820-95FD-1BA32106FB9A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Face.RegularDeleteLogs", "Face.RegularDeleteLogs\Face.RegularDeleteLogs.csproj", "{07058074-5B7B-4D81-8045-24C974173E6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{709AA98F-388F-44DD-B64B-AD44E695C34C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{709AA98F-388F-44DD-B64B-AD44E695C34C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{709AA98F-388F-44DD-B64B-AD44E695C34C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{709AA98F-388F-44DD-B64B-AD44E695C34C}.Release|Any CPU.Build.0 = Release|Any CPU
{BE790400-C1EE-4D97-B3F1-604F6831E5E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE790400-C1EE-4D97-B3F1-604F6831E5E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE790400-C1EE-4D97-B3F1-604F6831E5E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE790400-C1EE-4D97-B3F1-604F6831E5E7}.Release|Any CPU.Build.0 = Release|Any CPU
{5500F9DD-89D9-40F3-B62F-90C6B633D55A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5500F9DD-89D9-40F3-B62F-90C6B633D55A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5500F9DD-89D9-40F3-B62F-90C6B633D55A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5500F9DD-89D9-40F3-B62F-90C6B633D55A}.Release|Any CPU.Build.0 = Release|Any CPU
{56438F1C-BA3A-4272-964E-C6739AE0B4EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{56438F1C-BA3A-4272-964E-C6739AE0B4EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{56438F1C-BA3A-4272-964E-C6739AE0B4EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{56438F1C-BA3A-4272-964E-C6739AE0B4EC}.Release|Any CPU.Build.0 = Release|Any CPU
{A9F6DA6D-65AD-4DA4-8097-7FBEBC710DF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9F6DA6D-65AD-4DA4-8097-7FBEBC710DF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9F6DA6D-65AD-4DA4-8097-7FBEBC710DF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9F6DA6D-65AD-4DA4-8097-7FBEBC710DF3}.Release|Any CPU.Build.0 = Release|Any CPU
{831A25A4-DAEC-43D6-8D24-DEC6DDA196DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{831A25A4-DAEC-43D6-8D24-DEC6DDA196DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{831A25A4-DAEC-43D6-8D24-DEC6DDA196DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{831A25A4-DAEC-43D6-8D24-DEC6DDA196DD}.Release|Any CPU.Build.0 = Release|Any CPU
{5CEB682A-8023-4F08-B89D-7216B7BAAA03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5CEB682A-8023-4F08-B89D-7216B7BAAA03}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5CEB682A-8023-4F08-B89D-7216B7BAAA03}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5CEB682A-8023-4F08-B89D-7216B7BAAA03}.Release|Any CPU.Build.0 = Release|Any CPU
{88515D7C-4B2F-4820-95FD-1BA32106FB9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88515D7C-4B2F-4820-95FD-1BA32106FB9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88515D7C-4B2F-4820-95FD-1BA32106FB9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88515D7C-4B2F-4820-95FD-1BA32106FB9A}.Release|Any CPU.Build.0 = Release|Any CPU
{07058074-5B7B-4D81-8045-24C974173E6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07058074-5B7B-4D81-8045-24C974173E6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07058074-5B7B-4D81-8045-24C974173E6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07058074-5B7B-4D81-8045-24C974173E6F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{709AA98F-388F-44DD-B64B-AD44E695C34C} = {8907B38B-9A78-4EFE-A148-82C3A0D86303}
{BE790400-C1EE-4D97-B3F1-604F6831E5E7} = {8907B38B-9A78-4EFE-A148-82C3A0D86303}
{5500F9DD-89D9-40F3-B62F-90C6B633D55A} = {FB2DB0B0-8434-4E32-AA55-0CAF2E6AA0FE}
{56438F1C-BA3A-4272-964E-C6739AE0B4EC} = {1AC3773A-D26E-4C04-BE74-AA99B52484B0}
{A9F6DA6D-65AD-4DA4-8097-7FBEBC710DF3} = {3ECF681B-93F4-4059-9D38-BA9958420572}
{831A25A4-DAEC-43D6-8D24-DEC6DDA196DD} = {52D25030-5B02-42A5-A203-1EA154428687}
{5CEB682A-8023-4F08-B89D-7216B7BAAA03} = {1AC3773A-D26E-4C04-BE74-AA99B52484B0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A76CFBB4-9623-471D-B8E7-0777C6B6DD83}
EndGlobalSection
EndGlobal

22
Face.DBUtility/App.config Normal file
View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider></providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data></configuration>

View File

@@ -0,0 +1,75 @@
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.DBUtility
{
public enum EffentNextType
{
/// <summary>
/// 对其他语句无任何影响
/// </summary>
None,
/// <summary>
/// 当前语句必须为"select count(1) from .."格式,如果存在则继续执行,不存在回滚事务
/// </summary>
WhenHaveContine,
/// <summary>
/// 当前语句必须为"select count(1) from .."格式,如果不存在则继续执行,存在回滚事务
/// </summary>
WhenNoHaveContine,
/// <summary>
/// 当前语句影响到的行数必须大于0否则回滚事务
/// </summary>
ExcuteEffectRows,
/// <summary>
/// 引发事件-当前语句必须为"select count(1) from .."格式,如果不存在则继续执行,存在回滚事务
/// </summary>
SolicitationEvent
}
public class CommandInfo
{
public object ShareObject = null;
public object OriginalData = null;
event EventHandler _solicitationEvent;
public event EventHandler SolicitationEvent
{
add
{
_solicitationEvent += value;
}
remove
{
_solicitationEvent -= value;
}
}
public void OnSolicitationEvent()
{
if (_solicitationEvent != null)
{
_solicitationEvent(this, new EventArgs());
}
}
public string CommandText;
public System.Data.Common.DbParameter[] Parameters;
public EffentNextType EffentNextType = EffentNextType.None;
public CommandInfo()
{
}
public CommandInfo(string sqlText, MySqlParameter[] para)
{
this.CommandText = sqlText;
this.Parameters = para;
}
public CommandInfo(string sqlText, MySqlParameter[] para, EffentNextType type)
{
this.CommandText = sqlText;
this.Parameters = para;
this.EffentNextType = type;
}
}
}

View File

@@ -0,0 +1,323 @@
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.DBUtility
{
public class DALHelper<TEntity> where TEntity : class, new()
{
private string databasetablename; //数据库表名前缀
//private DbConfigsInfo confInfi;
public DALHelper()
{
databasetablename = "TBL_UTS_Manage";
}
public DALHelper(string _databaseprefix)
{
databasetablename = _databaseprefix;
}
/// <summary>
/// 是否存在该记录
/// </summary>
public bool Exists(TEntity entity, string strField, object keyValue)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select count(1) from " + databasetablename);
strSql.Append(" where " + strField + "=@keyValue ");
MySqlParameter[] parameters = {
new MySqlParameter("@keyValue",keyValue)
};
return DbHelperMySQL.Exists(strSql.ToString(), parameters);
}
/// <summary>
/// 得到最大ID
/// </summary>
public int GetMaxId(TEntity entity, string strField)
{
return DbHelperMySQL.GetMaxID(strField, databasetablename);
}
public bool Add(TEntity entity)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into " + databasetablename + "(");
PropertyInfo[] propertys = entity.GetType().GetProperties();// 获得此模型的公共属性
List<MySqlParameter> parameters = new List<MySqlParameter>();
foreach (PropertyInfo pi in propertys)
{
if (!pi.CanWrite) continue;
strSql.Append(pi.Name + ",");
strSql.Append(" values (");
}
strSql.Append(" ) values (");
foreach (PropertyInfo pi in propertys)
{
if (!pi.CanWrite) continue;
strSql.Append(pi.Name + "@,");
parameters.Add(new MySqlParameter("@" + pi.Name, pi.GetValue(entity)));
}
strSql.Append(");select @@IDENTITY");
int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters.ToArray());
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 修改一个实体数据
/// </summary>
/// <param name="entity"></param>
/// <param name="strField"></param>
/// <param name="keyValue"></param>
/// <returns></returns>
public bool Update(TEntity entity, string strField, object keyValue)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update " + databasetablename + " set ");
PropertyInfo[] propertys = entity.GetType().GetProperties();// 获得此模型的公共属性
List<MySqlParameter> parameters = new List<MySqlParameter>();
foreach (PropertyInfo pi in propertys)
{
if (!pi.CanWrite) continue;
strSql.Append(pi.Name + "=@" + pi.Name + ",");
parameters.Add(new MySqlParameter("@" + pi.Name, pi.GetValue(entity)));
}
strSql.Append(" where " + strField + "=@strValue");
parameters.Add(new MySqlParameter("@strValue", keyValue));
int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters.ToArray());
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 修改一列数据
/// </summary>
public int UpdateField(TEntity entity, string strField, object strValue, string strWhere)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update " + databasetablename);
strSql.Append(" set " + strField + "=@strValue");
if (!string.IsNullOrEmpty(strWhere))
{
strSql.Append(" where " + strWhere);
}
MySqlParameter[] parameters = {
new MySqlParameter("@strValue",strValue)
};
return DbHelperMySQL.ExecuteSql(strSql.ToString());
}
/// <summary>
/// 删除一条数据
/// </summary>
public bool Delete(TEntity entity, string strField, object keyValue)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("delete from " + databasetablename);
strSql.Append(" where " + strField + "=@keyValue ");
MySqlParameter[] parameters = {
new MySqlParameter("@keyValue",keyValue)
};
int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 得到一个对象实体
/// </summary>
/// <param name="uid"></param>
/// <returns></returns>
public TEntity GetModel(TEntity entity, string strField, string keyValue)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select * from " + databasetablename);
strSql.Append(" where " + strField + "=@keyValue ");
strSql.Append(" LIMIT 0,1;");
MySqlParameter[] parameters = {
new MySqlParameter("@keyValue",keyValue)
};
DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters);
if (ds.Tables[0].Rows.Count > 0)
{
return DataRowToModel(entity, ds.Tables[0]);
}
else
{
return null;
}
}
public List<TEntity> GetList(string strWhere = null)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select * from " + databasetablename);
if (!string.IsNullOrEmpty(strWhere))
{
strSql.Append(" where " + strWhere);
}
//strSql.Append(" LIMIT 0,1;");
TEntity entity = new TEntity();
DataSet ds = DbHelperMySQL.Query(strSql.ToString());
if (ds.Tables[0].Rows.Count > 0)
{
return DataRowToModels(entity, ds.Tables[0]);
}
else
{
return null;
}
}
/// <summary>
/// 将DataTable转换得到一个对象实体
/// </summary>
/// <param name="model"></param>
/// <param name="dt"></param>
/// <returns></returns>
public TEntity DataRowToModel(TEntity model, DataTable dt)
{
if (dt.Rows.Count > 0)
{
TEntity t = new TEntity();
PropertyInfo[] propertys = t.GetType().GetProperties();// 获得此模型的公共属性
foreach (PropertyInfo pi in propertys)
{
if (dt.Columns.Contains(pi.Name))
{
if (!pi.CanWrite) continue;
var value = dt.Rows[0][pi.Name];
if (value != DBNull.Value)
{
switch (pi.PropertyType.FullName)
{
case "System.Decimal":
pi.SetValue(t, decimal.Parse(value.ToString()), null);
break;
case "System.String":
pi.SetValue(t, value.ToString(), null);
break;
case "System.Single":
pi.SetValue(t, float.Parse(value.ToString()), null);
break;
case "System.Double":
pi.SetValue(t, double.Parse(value.ToString()), null);
break;
case "System.Int32":
pi.SetValue(t, int.Parse(value.ToString()), null);
break;
case "System.DateTime":
pi.SetValue(t, DateTime.Parse(value.ToString()), null);
break;
case "System.Boolean":
pi.SetValue(t, bool.Parse(value.ToString()), null);
break;
default:
pi.SetValue(t, value, null);
break;
}
}
}
}
return t;
}
else
{
return null;
}
}
/// <summary>
/// 将DataTable转换得到一个对象实体集合
/// </summary>
/// <param name="model"></param>
/// <param name="dt"></param>
/// <returns></returns>
public List<TEntity> DataRowToModels(TEntity model, DataTable dt)
{
List<TEntity> ts = new List<TEntity>();// 定义集合
foreach (DataRow dr in dt.Rows)
{
TEntity t = new TEntity();
PropertyInfo[] propertys = t.GetType().GetProperties();// 获得此模型的公共属性
foreach (PropertyInfo pi in propertys)
{
if (dt.Columns.Contains(pi.Name))
{
if (!pi.CanWrite) continue;
var value = dr[pi.Name];
if (value != DBNull.Value)
{
switch (pi.PropertyType.FullName)
{
case "System.Decimal":
pi.SetValue(t, decimal.Parse(value.ToString()), null);
break;
case "System.String":
pi.SetValue(t, value.ToString(), null);
break;
case "System.Single":
pi.SetValue(t, float.Parse(value.ToString()), null);
break;
case "System.Double":
pi.SetValue(t, double.Parse(value.ToString()), null);
break;
case "System.Int32":
pi.SetValue(t, int.Parse(value.ToString()), null);
break;
case "System.DateTime":
pi.SetValue(t, DateTime.Parse(value.ToString()), null);
break;
case "System.Boolean":
pi.SetValue(t, bool.Parse(value.ToString()), null);
break;
default:
pi.SetValue(t, value, null);
break;
}
}
}
}
ts.Add(t);
}
return ts;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,351 @@
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.DBUtility
{
public class DALHelperCustom<TEntity> where TEntity : class, new()
{
private string databasetablename; //数据库表名前缀
//private DbConfigsInfo confInfi;
public DALHelperCustom()
{
databasetablename = "TBL_UTS_Manage";
}
public DALHelperCustom(string _databaseprefix)
{
databasetablename = _databaseprefix;
}
/// <summary>
/// 是否存在该记录
/// </summary>
public bool Exists(TEntity entity, string strField, object keyValue)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select count(1) from " + databasetablename);
strSql.Append(" where " + strField + "=@keyValue ");
MySqlParameter[] parameters = {
new MySqlParameter("@keyValue",keyValue)
};
return DbHelperMySqlCustom.Exists(strSql.ToString(), parameters);
}
/// <summary>
/// 得到最大ID
/// </summary>
public int GetMaxId(TEntity entity, string strField)
{
return DbHelperMySqlCustom.GetMaxID(strField, databasetablename);
}
/// <summary>
/// 添加一条数据
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public bool Add(TEntity entity)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into " + databasetablename + "(");
PropertyInfo[] propertys = entity.GetType().GetProperties();// 获得此模型的公共属性
List<MySqlParameter> parameters = new List<MySqlParameter>();
foreach (PropertyInfo pi in propertys)
{
if (!pi.CanWrite) continue;
strSql.Append(pi.Name + ",");
}
strSql.Remove(strSql.Length - 1, 1);//移除最后一个逗号
strSql.Append(" ) values (");
foreach (PropertyInfo pi in propertys)
{
if (!pi.CanWrite) continue;
strSql.Append("@" + pi.Name + ",");
parameters.Add(new MySqlParameter("@" + pi.Name, pi.GetValue(entity)));
}
strSql.Remove(strSql.Length - 1, 1);//移除最后一个逗号
strSql.Append(");select @@IDENTITY");
int rows = DbHelperMySqlCustom.ExecuteSql(strSql.ToString(), parameters.ToArray());
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 修改一列数据
/// </summary>
/// <param name="entity"></param>
/// <param name="strField"></param>
/// <param name="keyValue"></param>
/// <returns></returns>
public bool Update(TEntity entity, string strField, object keyValue)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update " + databasetablename + " set ");
PropertyInfo[] propertys = entity.GetType().GetProperties();// 获得此模型的公共属性
List<MySqlParameter> parameters = new List<MySqlParameter>();
foreach (PropertyInfo pi in propertys)
{
if (!pi.CanWrite) continue;
strSql.Append(pi.Name + "=@" + pi.Name + ",");
parameters.Add(new MySqlParameter("@" + pi.Name, pi.GetValue(entity)));
}
strSql.Remove(strSql.Length - 1, 1);//移除最后一个逗号
strSql.Append(" where " + strField + "=@strValue");
System.Type keyType = keyValue.GetType();
switch (keyType.Name)
{
case "Int32":
MySqlParameter strValue = new MySqlParameter("@strValue", MySqlDbType.Int32)
{
Value = keyValue
};
parameters.Add(strValue);
break;
default:
parameters.Add(new MySqlParameter("@strValue", keyValue));
break;
}
int rows = DbHelperMySqlCustom.ExecuteSql(strSql.ToString(), parameters.ToArray());
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 修改一列数据
/// </summary>
public int UpdateField(TEntity entity, string strField, object strValue, string strWhere)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update " + databasetablename);
strSql.Append(" set " + strField + "=@strValue");
if (!string.IsNullOrEmpty(strWhere))
{
strSql.Append(" where " + strWhere);
}
MySqlParameter[] parameters = {
new MySqlParameter("@strValue",strValue)
};
return DbHelperMySqlCustom.ExecuteSql(strSql.ToString());
}
/// <summary>
/// 删除一条数据
/// </summary>
public bool Delete(TEntity entity, string strField, object keyValue)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("delete from " + databasetablename);
strSql.Append(" where " + strField + "=@keyValue ");
MySqlParameter[] parameters = {
new MySqlParameter("@keyValue",keyValue)
};
int rows = DbHelperMySqlCustom.ExecuteSql(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 得到一个对象实体
/// </summary>
/// <param name="uid"></param>
/// <returns></returns>
public TEntity GetModel(TEntity entity, string strField, object keyValue)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select * from " + databasetablename);
strSql.Append(" where " + strField + "=@keyValue ");
strSql.Append(" LIMIT 0,1;");
MySqlParameter[] parameters = {
new MySqlParameter("@keyValue",keyValue)
};
DataSet ds = DbHelperMySqlCustom.Query(strSql.ToString(), parameters);
if (ds.Tables[0].Rows.Count > 0)
{
return DataRowToModel(entity, ds.Tables[0]);
}
else
{
return null;
}
}
/// <summary>
/// 得到数据列表
/// </summary>
/// <param name="strWhere"></param>
/// <returns></returns>
public List<TEntity> GetList(string strWhere = null)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select * from " + databasetablename);
if (!string.IsNullOrEmpty(strWhere))
{
strSql.Append(" where " + strWhere);
}
//strSql.Append(" LIMIT 0,1;");
TEntity entity = new TEntity();
DataSet ds = DbHelperMySqlCustom.Query(strSql.ToString());
if (ds.Tables[0].Rows.Count > 0)
{
return DataRowToModels(entity, ds.Tables[0]);
}
else
{
return null;
}
}
/// <summary>
/// 将DataTable转换得到一个对象实体
/// </summary>
/// <param name="model"></param>
/// <param name="dt"></param>
/// <returns></returns>
public TEntity DataRowToModel(TEntity model, DataTable dt)
{
if (dt.Rows.Count > 0)
{
TEntity t = new TEntity();
PropertyInfo[] propertys = t.GetType().GetProperties();// 获得此模型的公共属性
foreach (PropertyInfo pi in propertys)
{
if (dt.Columns.Contains(pi.Name))
{
if (!pi.CanWrite) continue;
var value = dt.Rows[0][pi.Name];
if (value != DBNull.Value)
{
switch (pi.PropertyType.FullName)
{
case "System.Decimal":
pi.SetValue(t, decimal.Parse(value.ToString()), null);
break;
case "System.String":
pi.SetValue(t, value.ToString(), null);
break;
case "System.Single":
pi.SetValue(t, float.Parse(value.ToString()), null);
break;
case "System.Double":
pi.SetValue(t, double.Parse(value.ToString()), null);
break;
case "System.Int32":
pi.SetValue(t, int.Parse(value.ToString()), null);
break;
case "System.DateTime":
pi.SetValue(t, DateTime.Parse(value.ToString()), null);
break;
case "System.Boolean":
pi.SetValue(t, bool.Parse(value.ToString()), null);
break;
default:
pi.SetValue(t, value, null);
break;
}
}
}
}
return t;
}
else
{
return null;
}
}
/// <summary>
/// 将DataTable转换得到一个对象实体集合
/// </summary>
/// <param name="model"></param>
/// <param name="dt"></param>
/// <returns></returns>
public List<TEntity> DataRowToModels(TEntity model, DataTable dt)
{
List<TEntity> ts = new List<TEntity>();// 定义集合
foreach (DataRow dr in dt.Rows)
{
TEntity t = new TEntity();
PropertyInfo[] propertys = t.GetType().GetProperties();// 获得此模型的公共属性
foreach (PropertyInfo pi in propertys)
{
if (dt.Columns.Contains(pi.Name))
{
if (!pi.CanWrite) continue;
var value = dr[pi.Name];
if (value != DBNull.Value)
{
switch (pi.PropertyType.FullName)
{
case "System.Decimal":
pi.SetValue(t, decimal.Parse(value.ToString()), null);
break;
case "System.String":
pi.SetValue(t, value.ToString(), null);
break;
case "System.Single":
pi.SetValue(t, float.Parse(value.ToString()), null);
break;
case "System.Double":
pi.SetValue(t, double.Parse(value.ToString()), null);
break;
case "System.Int32":
pi.SetValue(t, int.Parse(value.ToString()), null);
break;
case "System.DateTime":
pi.SetValue(t, DateTime.Parse(value.ToString()), null);
break;
case "System.Boolean":
pi.SetValue(t, bool.Parse(value.ToString()), null);
break;
default:
pi.SetValue(t, value, null);
break;
}
}
}
}
ts.Add(t);
}
return ts;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,58 @@
using AUTS.Domain.Application;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.DBUtility
{
public partial class DbConfigsInfo
{
private static string onUserOperationSessionName = "UserOperationSessionName";//用户当前选择库
private static List<DBCofinStrModel> cacheSysDBCofinStrList
{
// get选择器获取Lazyk懒加载数据
get { return AUTS.Services.Cache.CacheHelp.GetDBCofinStrList(); }
}
#region
/// <summary>
/// 获取用户当前选择库信息
/// </summary>
/// <param name="userID">用户ID</param>
/// <returns></returns>
public static DBCofinStrModel GerOnUserDBCofinStr()
{
//var dbList = CacheHelp.GetSysDBList();
var onCustomer = System.Web.HttpContext.Current.Session[onUserOperationSessionName];
if (onCustomer != null)
{
return cacheSysDBCofinStrList.SingleOrDefault(x => x.ID == (int)onCustomer);
}
return null;
}
#endregion
#region
/// <summary>
/// 获取用户当前选择数据库连接串
/// </summary>
/// <returns></returns>
public static string GerOnUserCofin()
{
var connectionString = "";
connectionString = GerOnUserDBCofinStr().CofinStr;
if (!String.IsNullOrEmpty(connectionString))
{
return connectionString;
}
return System.Configuration.ConfigurationManager.ConnectionStrings["Uts_Manage"].ConnectionString;
}
#endregion
}
}

View File

@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2D329474-A40D-47BA-9CAD-036A794E80DD}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AUTS.DBUtility</RootNamespace>
<AssemblyName>AUTS.DBUtility</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.12\lib\net45\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="MySql.Data.Entity.EF6, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.Entity.6.9.12\lib\net45\MySql.Data.Entity.EF6.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CommandInfo.cs" />
<Compile Include="Common\DALHelper.cs" />
<Compile Include="Custom\DALHelperCustom.cs" />
<Compile Include="DbConfigsInfo.cs" />
<Compile Include="Common\DbHelperMySQL.cs" />
<Compile Include="Custom\DbHelperMySqlCustom.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AUTS.Domain\AUTS.Domain.csproj">
<Project>{709aa98f-388f-44dd-b64b-ad44e695c34c}</Project>
<Name>AUTS.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\AUTS.Services\AUTS.Services.csproj">
<Project>{56438f1c-ba3a-4272-964e-c6739ae0b4ec}</Project>
<Name>AUTS.Services</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,10 @@
""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = ""
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("AUTS.DBUtility")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AUTS.DBUtility")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("2d329474-a40d-47ba-9cad-036a794e80dd")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.2.0" targetFramework="net461" />
<package id="MySql.Data" version="6.9.12" targetFramework="net461" />
<package id="MySql.Data.Entity" version="6.9.12" targetFramework="net461" />
</packages>

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class RequestOrderStats
{
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public int ProjectID { get; set; }
public bool IsOrder { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class RequestOrdersPlanned
{
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public int ProjectID { get; set; }
public bool IsOrder { get; set; }
public int id { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class RequestOrdersRealTime
{
public int ProjectID { get; set; }
public int Order { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels.AutsChart
{
public class RequestStatsInProduc
{
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public int ProjectID { get; set; }
public string Order { get; set; }
}
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_DevNestable
{
public int ServiceID { get; set; }
public string HtmlText { get; set; }
public string TerminalName { get; set; }
public string TerminalType { get; set; }
public string TerminalMAC { get; set; }
public DateTime? ServiceLastActiveDateTime { get; set; }
public List<VM_AppListNestable> AppList { get; set; }
public VM_DevNestable()
{
AppList = new List<VM_AppListNestable>();
}
}
public class VM_AppListNestable
{
public string AppHtmlText { get; set; }
public string AppName { get; set; }
public string AppVersion { get; set; }
public DateTime? LastActiveDateTime { get; set; }
}
}

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_OrderRealTimeStats
{
}
public class OrderTestLogData
{
/// <summary>
/// 实际产量
/// </summary>
public int Total { get; set; }
/// <summary>
/// 时间
/// </summary>
public DateTime StartTime { get; set; }
public string DAYS { get; set; }
}
public class TbTotalDic
{
/// <summary>
/// 计划产量
/// </summary>
public int PlanTotal { get; set; }
/// <summary>
/// 实际产量
/// </summary>
public int ActualTotal { get; set; }
public TbTotalDic()
{
PlanTotal = 0;
ActualTotal = 0;
}
}
}

View File

@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_TBL_OrderStats
{
/// <summary>
/// 站名
/// </summary>
public List<Entities.TBL_Project> ProjectList { get; set; }
public string SearchKey { get; set; }
public List<Entities.TBL_Orders> OrderList { get; set; }
public RealTimeOrderInfo OrderInfo { get; set; }
//public VM_TBL_OrderStats()
//{
// OrderInfo = new RealTimeOrderInfo();
//}
}
public class RealTimeOrderInfo
{
/// <summary>
/// 订单号
/// </summary>
public string OrderNo { get; set; }
/// <summary>
/// 客户
/// </summary>
public string CustomerAbbr { get; set; }
/// <summary>
/// 机型
/// </summary>
public string ProjectName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTime { get; set; }
/// <summary>
/// 交期时间
/// </summary>
public string DeliveryTime { get; set; }
/// <summary>
/// 订单数量
/// </summary>
public int OrderCount { get; set; }
/// <summary>
/// 工艺站描述
/// </summary>
public string StationDes { get; set; }
}
}

View File

@@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_TreeNode
{
/// <summary>
/// id
/// </summary>
public int id { get; set; }
/// <summary>
/// 文本
/// </summary>
public string text { get; set; }
/// <summary>
/// 图标
/// </summary>
public string icon { get; set; }
/// <summary>
/// 是否有子节点
/// </summary>
public bool children { get; set; }
/// <summary>
/// 类型
/// </summary>
public string type { get; set; }
/// <summary>
/// 状态
/// </summary>
public string state { get; set; }
}
public class VM_TreeView
{
/// <summary>
/// 文本
/// </summary>
public string text { get; set; }
public string icon { get; set; }
public int id { get; set; }
/// <summary>
/// 文本
/// </summary>
public List<VM_TreeNodes> nodes { get; set; }
public VM_TreeView()
{
nodes = new List<VM_TreeNodes>();
}
}
public class VM_TreeNodes
{
/// <summary>
/// 文本
/// </summary>
public string text { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class RequestCapacitySearch
{
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public int? PlineID { get; set; }
public int? ProjectID { get; set; }
public int? StationID { get; set; }
public string Customer { get; set; }
public string Order { get; set; }
public string Internalorder { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class RequestQAAjaxSearch
{
/// <summary>
/// 机型ID
/// </summary>
public int ProjectID { get; set; }
/// <summary>
/// 序号
/// </summary>
public string Number { get; set; }
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
/// <summary>
/// 抽检记录查询
/// </summary>
public class RequestQALogSearch
{
/// <summary>
/// 开始时间
/// </summary>
public DateTime? StartDate { get; set; }
/// <summary>
/// 结束数据
/// </summary>
public DateTime? EndDate { get; set; }
/// <summary>
/// 机型ID
/// </summary>
public int ProjectID { get; set; }
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class RequestQASubmit
{
/// <summary>
/// 序号
/// </summary>
public string NumberSubmit { get; set; }
/// <summary>
/// QA_过程
/// </summary>
public string QA_CheckProcSubmit { get; set; }
/// <summary>
/// QA_结果
/// </summary>
public bool QA_TestResultSubmit { get; set; }
public string QARemarks { get; set; }
public int QA_ProjectID { get; set; }
public int QA_QAStationID { get; set; }
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class RequestTestLogSearch
{
public int ProjectID { get; set; }
public string Number { get; set; }
public int? TestLogID { get; set; }
public string KeyWhere { get; set; }
public string KeyWord { get; set; }
}
public class RequestTestLogDateSearch
{
public int page { get; set; }
public int pagesize { get; set; }
public int ProjectID { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
}
}

View File

@@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public partial class ResponseDataquerySearch
{
/// <summary>
/// 序号集
/// </summary>
public string ProductNumbers { get; set; }
/// <summary>
/// 数量
/// </summary>
public int numble { get; set; }
/// <summary>
/// 列表
/// </summary>
public List<DataQuerySearch> DataQuerySearchList { get; set; }
public ResponseDataquerySearch()
{
DataQuerySearchList = new List<DataQuerySearch>();
}
}
public class DataQuerySearch
{
/// <summary>
/// 主键
/// </summary>
public int ID { get; set; }
/// <summary>
/// 站名
/// </summary>
public string StationName { get; set; }
/// <summary>
/// 操作站
/// </summary>
public int StationID { get; set; }
/// <summary>
/// 机型ID
/// </summary>
public int ProjectID { get; set; }
/// <summary>
/// 时间
/// </summary>
public string StartTime { get; set; }
/// <summary>
/// 结果
/// </summary>
public string TestResult { get; set; }
///// <summary>
///// AssemblySn
///// </summary>
//public string AssemblySn { get; set; }
///// <summary>
///// DevSN
///// </summary>
//public string DevSN { get; set; }
///// <summary>
///// QA_结果
///// </summary>
//public string QA_CheckResult { get; set; }
/// <summary>
/// DUT_SN
/// </summary>
public string DUT_SN { get; set; }
}
}

View File

@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class ResponseEveryDaySearch
{
/// <summary>
/// 机型
/// </summary>
public string ProjectName { get; set; }
public string OrderNo { get; set; }
/// <summary>
/// 订单数量
/// </summary>
public int OrderCount { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTime { get; set; }
/// <summary>
/// 订单交期
/// </summary>
public string DeliveryTime { get; set; }
public List<Dictionary<string, object>> Rows { get; set; }
}
public class ResponseEveryDate
{
public int TotalCount { get; set; }
public List<DataQuerySearch> DataList { get; set; }
}
}

View File

@@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class ResponseQAAjaxSearch
{
/// <summary>
/// 数量
/// </summary>
public int numble { get; set; }
public QAResultVM qaResultVM { get; set; }
public List<QADataSearch> QADataSearchList { get; set; }
public ResponseQAAjaxSearch()
{
QADataSearchList = new List<QADataSearch>();
}
}
public class QADataSearch
{
/// <summary>
/// 站ID
/// </summary>
public int StationID { get; set; }
/// <summary>
/// 站名
/// </summary>
public string StationName { get; set; }
/// <summary>
/// 时间
/// </summary>
public string StartTime { get; set; }
/// <summary>
/// 结果
/// </summary>
public bool TestResult { get; set; }
}
public class QAResultVM
{
/// <summary>
/// 序号集
/// </summary>
public string ProductNumbers { get; set; }
/// <summary>
/// 检测结果
/// </summary>
public bool TestResult { get; set; }
/// <summary>
/// 检测过程
/// </summary>
public string CheckProc { get; set; }
/// <summary>
/// 项目ID
/// </summary>
public int ProjectID { get; set; }
/// <summary>
/// QA站ID
/// </summary>
public int QAStationID { get; set; }
}
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class ResponseQALogSearch
{
/// <summary>
/// DUT_SN
/// </summary>
public string DUT_SN { get; set; }
/// <summary>
/// 时间
/// </summary>
public string StartTime { get; set; }
/// <summary>
/// QA_结果
/// </summary>
public string QA_CheckResult { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class ResponseQASubmit
{
/// <summary>
/// 总数
/// </summary>
public int Total { get; set; }
/// <summary>
/// 今日总数
/// </summary>
public int TotalToday { get; set; }
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_TBL_CapacityEveryDay
{
/// <summary>
/// DUT_SN
/// </summary>
public string DUT_SN { get; set; }
/// <summary>
/// TestResult
/// </summary>
public bool TestResult { get; set; }
/// <summary>
/// StartTime
/// </summary>
public DateTime StartTime { get; set; }
}
public class VM_CapacityIndex
{
public List<Entities.TBL_Project> ProjectList { get; set; }
public List<Entities.TBL_Orders> OrdersList { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_TBL_CapacityIndex
{
/// <summary>
/// 站名
/// </summary>
public List<Entities.TBL_Project> ProjectList { get; set; }
public string[] SearchKey { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_TBL_ToDayCapacity
{
/// <summary>
/// 站名
/// </summary>
public string StationName { get; set; }
/// <summary>
/// 总数
/// </summary>
public int Total { get; set; }
/// <summary>
/// 有效值
/// </summary>
public int EffectiveNum { get; set; }
/// <summary>
/// Pass数
/// </summary>
public int PassNum { get; set; }
/// <summary>
/// Fail数
/// </summary>
public int FailNum { get; set; }
}
}

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BE790400-C1EE-4D97-B3F1-604F6831E5E7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Face.Domain.ViewModels</RootNamespace>
<AssemblyName>Face.Domain.ViewModels</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Interfacefield.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ReturnResult.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Face.Domain\Face.Domain.csproj">
<Project>{709aa98f-388f-44dd-b64b-ad44e695c34c}</Project>
<Name>Face.Domain</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,10 @@
""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = ""
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
}

View File

@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Face.Domain.ViewModels
{
public class Interfacefield
{
/// <summary>
/// 名称
/// </summary>
public string LodgerNmae { get; set; }
/// <summary>
/// 身份证
/// </summary>
public string IDNumber { get; set; }
/// <summary>
/// 性别 0女 1男
/// </summary>
public int Sex { get; set; }
/// <summary>
/// 图片
/// </summary>
public string picture { get; set; }
/// <summary>
/// 备注
/// </summary>
public string remark { get; set; }
/// <summary>
/// 酒店code
/// </summary>
public string HotelCode { get; set; }
/// <summary>
/// 房间号
/// </summary>
public string roomid { get; set; }
/// <summary>
/// 电话号码
/// </summary>
public string phonenumber { get; set; }
/// <summary>
/// 开房时间
/// </summary>
public DateTime CheckTime { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_OrderInfo
{
/// <summary>
/// 订单no
/// </summary>
public string OrderNo { get; set; }
/// <summary>
/// 客户
/// </summary>
public string CustomerAbbr { get; set; }
/// <summary>
/// 内部单No
/// </summary>
public string InternalNo { get; set; }
/// <summary>
/// 机型
/// </summary>
public string ProjectName { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_OrderInfoOnMO
{
/// <summary>
/// 交期时间
/// </summary>
public string DeliveryTime { get; set; }
/// <summary>
/// 客户
/// </summary>
public string CustomerAbbr { get; set; }
/// <summary>
/// 订单数量
/// </summary>
public int OrderCount { get; set; }
/// <summary>
/// 机型
/// </summary>
public string ProjectName { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_OrderInternalDetails
{
public int ID { get; set; }
public int OrderID { get; set; }
public string InternalNo { get; set; }
public System.DateTime CreateTime { get; set; }
public int ObjectiveYield { get; set; }
public int ObjectiveYieldTotal { get; set; }
public List<Entities.TBL_Orders> OrdersList { get; set; }
public VM_OrderInfoOnMO OrderInfoOnMO { get; set; }
}
}

View File

@@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_OrderInternalList
{
/// <summary>
/// ID
/// </summary>
public int ID { get; set; }
/// <summary>
/// 订单no
/// </summary>
public string OrderNo { get; set; }
/// <summary>
/// 内部单No
/// </summary>
public string InternalNo { get; set; }
/// <summary>
/// 目标产量
/// </summary>
public int ObjectiveYield { get; set; }
/// <summary>
/// 累计目标产量
/// </summary>
public int ObjectiveYieldTotal { get; set; }
///// <summary>
///// 起止SN
///// </summary>
//public string Sn_StartEnd { get; set; }
/// <summary>
/// 交期时间
/// </summary>
public string DeliveryTime { get; set; }
/// <summary>
/// 客户
/// </summary>
public string CustomerAbbr { get; set; }
/// <summary>
/// 订单数量
/// </summary>
public int OrderCount { get; set; }
/// <summary>
/// 机型
/// </summary>
public string ProjectName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTime { get; set; }
}
}

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_OrderList
{
public int OrderID { get; set; }
/// <summary>
/// 订单号
/// </summary>
public string OrderNo { get; set; }
/// <summary>
/// 客户
/// </summary>
public string CustomerAbbr { get; set; }
/// <summary>
/// 机型
/// </summary>
public string ProjectName { get; set; }
/// <summary>
/// 订单数量
/// </summary>
public int OrderCount { get; set; }
/// <summary>
/// 订单交期
/// </summary>
public string DeliveryTime { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTime { get; set; }
public string OrderStatus { get; set; }
public string Sn_Start { get; set; }
public string Sn_End { get; set; }
}
}

View File

@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_OrderPlannedSpeed
{
public int OrderID { get; set; }
/// <summary>
/// 订单号
/// </summary>
public string OrderNo { get; set; }
/// <summary>
/// 客户
/// </summary>
public string CustomerAbbr { get; set; }
/// <summary>
/// 机型
/// </summary>
public string ProjectName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTime { get; set; }
/// <summary>
/// 交期时间
/// </summary>
public string DeliveryTime { get; set; }
public string StationDes { get; set; }
/// <summary>
/// 订单数量
/// </summary>
public int OrderCount { get; set; }
public List<Dictionary<string, object>> Rows { get; set; }
public VM_OrderPlannedSpeed()
{
Rows = new List<Dictionary<string, object>>();
}
}
public class VM_PlannedSpeed
{
/// <summary>
/// 实际产量
/// </summary>
public int Total { get; set; }
/// <summary>
/// 时间
/// </summary>
public DateTime StartTime { get; set; }
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class RequestOVSearch
{
public DateTime? startDate { get; set; }
public DateTime? endDate { get; set; }
public int? plineID { get; set; }
public int? projectID { get; set; }
}
}

View File

@@ -0,0 +1,99 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_PPlanList
{
/// <summary>
/// ID
/// </summary>
public int ID { get; set; }
/// <summary>
/// 内部单NO
/// </summary>
public string InternalNo { get; set; }
/// <summary>
/// 订单NO
/// </summary>
public string OrderNo { get; set; }
/// <summary>
/// 产线名称
/// </summary>
public string PLName { get; set; }
/// <summary>
/// 目标产量
/// </summary>
public int ObjectiveYield { get; set; }
/// <summary>
/// 累计产量
/// </summary>
public int ActualOutput { get; set; }
/// <summary>
/// 生产时间
/// </summary>
public string ProductionTime { get; set; }
/// <summary>
/// 起止序号
/// </summary>
//public string Sn_StartEnd { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
public class VM_TBL_PPlanInternalTb
{
/// <summary>
/// 内部单ID
/// </summary>
public int ID { get; set; }
/// <summary>
/// 订单号
/// </summary>
public string OrderNo { get; set; }
/// <summary>
/// 内部单号
/// </summary>
public string InternalNo { get; set; }
/// <summary>
/// 机型
/// </summary>
public string ProjectName { get; set; }
/// <summary>
/// 客户
/// </summary>
public string CustomerAbbr { get; set; }
/// <summary>
/// 交期时间
/// </summary>
public string DeliveryTime { get; set; }
public System.DateTime CreateTime { get; set; }
public int OrderCount { get; set; }
}
}

View File

@@ -0,0 +1,107 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_SnRulesList
{
/// <summary>
/// 内部单NO
/// </summary>
public string InternalNo { get; set; }
/// <summary>
/// 机型名称
/// </summary>
public string ProjectName { get; set; }
/// <summary>
/// 交期时间
/// </summary>
public string DeliveryTime { get; set; }
public int OrderCount { get; set; }
/// <summary>
/// 图片
/// </summary>
public string Img { get; set; }
public List<VM_SnRules> SnRules { get; set; }
public VM_SnRulesList()
{
SnRules = new List<VM_SnRules>();
}
}
public class VM_SnRules
{
/// <summary>
/// ID
/// </summary>
public int ID { get; set; }
/// <summary>
/// 站位
/// </summary>
public string StationNames { get; set; }
/// <summary>
/// 条码范围
/// </summary>
public string Sn_Start { get; set; }
public string Sn_End { get; set; }
}
public class VM_SnList
{
/// <summary>
/// 内部单NO
/// </summary>
public string InternalNo { get; set; }
public string OrderNo { get; set; }
/// <summary>
/// 机型名称
/// </summary>
public string ProjectName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTime { get; set; }
public string UseTime { get; set; }
public int OrderCount { get; set; }
/// <summary>
/// 图片
/// </summary>
public string Img { get; set; }
public string BarCode { get; set; }
public bool IsUse { get; set; }
}
public class VM_DataTableSnList
{
public int TotalCount { get; set; }
public List<VM_SnList> SnList { get; set; }
}
}

View File

@@ -0,0 +1,110 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class VM_TBL_PPlanInternalDetails
{
/// <summary>
/// 内部单ID
/// </summary>
public int ID { get; set; }
/// <summary>
/// 订单号
/// </summary>
public string OrderNo { get; set; }
/// <summary>
/// 内部单号
/// </summary>
public string InternalNo { get; set; }
/// <summary>
/// 机型
/// </summary>
public string ProjectName { get; set; }
public int ProjectID { get; set; }
/// <summary>
/// 客户
/// </summary>
public string CustomerAbbr { get; set; }
/// <summary>
/// 交期时间
/// </summary>
public System.DateTime DeliveryTime { get; set; }
public string DeliveryTimeStr { get; set; }
public string StationText { get; set; }
///// <summary>
///// 开始序号
///// </summary>
//public string Sn_Start { get; set; }
///// <summary>
///// 结束序号
///// </summary>
//public string Sn_End { get; set; }
/// <summary>
/// 列表
/// </summary>
public List<VM_TBL_PPlan> PPlanList { get; set; }
public List<Dictionary<string, object>> rows { get; set; }
public VM_TBL_PPlanInternalDetails()
{
PPlanList = new List<VM_TBL_PPlan>();
}
}
public class VM_TBL_PPlan
{
/// <summary>
/// 计划ID
/// </summary>
public int ID { get; set; }
/// <summary>
/// 实际产量
/// </summary>
public int ActualOutput { get; set; }
/// <summary>
/// 目标产量
/// </summary>
public int ObjectiveYield { get; set; }
/// <summary>
/// 累计目标产量
/// </summary>
public int ObjectiveYieldTotal { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 生产时间
/// </summary>
public System.DateTime ProductionTime { get; set; }
public int ProductionLineID { get; set; }
public int StationID { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Face.Domain.ViewModels")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Face.Domain.ViewModels")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("be790400-c1ee-4d97-b3f1-604f6831e5e7")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels
{
public class ReturnResult
{
public int Status { get; set; }
public string Message { get; set; }
}
public class ReturnResult<TData> : ReturnResult
{
public TData Data { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.ViewModels.User
{
public class ResultAddUserVM
{
public List<Entities.TBL_UTS_Manage_Company> companyList { get; set; }
public List<Entities.TBL_UTS_Manage_DBList> dbList { get; set; }
}
}

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.29.0" newVersion="8.0.29.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" /></startup></configuration>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Azure.Core" version="1.14.0" targetFramework="net47" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" targetFramework="net47" />
<package id="Newtonsoft.Json" version="13.0.2" targetFramework="net47" />
<package id="System.Buffers" version="4.5.1" targetFramework="net47" />
<package id="System.Diagnostics.DiagnosticSource" version="4.6.0" targetFramework="net47" />
<package id="System.Memory" version="4.5.4" targetFramework="net47" />
<package id="System.Memory.Data" version="1.0.2" targetFramework="net47" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net47" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net47" />
<package id="System.Text.Encodings.Web" version="4.7.2" targetFramework="net47" />
<package id="System.Text.Json" version="4.6.0" targetFramework="net47" />
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net47" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net47" />
<package id="TencentCloudSDK.Common" version="3.0.902" targetFramework="net47" />
<package id="TencentCloudSDK.Sms" version="3.0.902" targetFramework="net47" />
</packages>

43
Face.Domain/App.config Normal file
View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
</providers>
</entityFramework>
<connectionStrings>
<add name="AuthorityDBTestEntities" connectionString="metadata=res://*/Entities.permissionModel.csdl|res://*/Entities.permissionModel.ssdl|res://*/Entities.permissionModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=47.119.147.104;initial catalog=AuthorityDBTest;user id=sa;password=9S844fK3;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="FaceEntitiesShow" connectionString="metadata=res://*/Entities.faceModelShow.csdl|res://*/Entities.faceModelShow.ssdl|res://*/Entities.faceModelShow.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=47.119.147.104;initial catalog=Face;user id=sa;password=9S844fK3;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="AuthorityDBEntities" connectionString="metadata=res://*/Entities.AuthorityDBModel.csdl|res://*/Entities.AuthorityDBModel.ssdl|res://*/Entities.AuthorityDBModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=47.119.147.104;initial catalog=AuthorityDB;user id=sa;password=9S844fK3;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="hfEntities" connectionString="metadata=res://*/Entities.SumInfoModel.csdl|res://*/Entities.SumInfoModel.ssdl|res://*/Entities.SumInfoModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=47.119.147.104;initial catalog=hf;user id=sa;password=9S844fK3;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="AuthorityDBEntitiesShow" connectionString="metadata=res://*/Entities.AuthorityDBModel.csdl|res://*/Entities.AuthorityDBModel.ssdl|res://*/Entities.AuthorityDBModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=47.119.147.104;initial catalog=AuthorityDB;user id=sa;password=9S844fK3;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="blv_rul" connectionString="data source=(LocalDb)\MSSQLLocalDB;initial catalog=Face.Domain.Entities.blv_rul;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.29.0" newVersion="8.0.29.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" /></startup></configuration>

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application
{
/// <summary>
/// 数据库连接串实体
/// </summary>
public class DBCofinStrModel
{
/// <summary>
/// iD
/// </summary>
public int ID { get; set; }
/// <summary>
/// 数据库连接串
/// </summary>
public string CofinStr { get; set; }
}
}

View File

@@ -0,0 +1,78 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
/// 入住表
/// </summary>
public class CheckInInfo
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int id { get; set; }
/// <summary>
/// 客户名字
/// </summary>
[SugarColumn(ColumnDataType = "varchar(20)")]
public string Name { get; set; }
/// <summary>
/// 身份证
/// </summary>
[SugarColumn(ColumnDataType = "varchar(100)",IsNullable =true)]
public string IdNumber { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable = true)]
public Nullable<System.DateTime> CreationTime { get; set; }
/// <summary>
/// 信息来源
/// </summary>
[SugarColumn(ColumnDataType = "int")]
public int InfoSource { get; set; }
/// <summary>
/// 酒店code
/// </summary>
[SugarColumn(ColumnDataType = "int",IsNullable =true)]
public Nullable<int> HotelCode { get; set; }
/// <summary>
/// 房间id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> Roomid { get; set; }
/// <summary>
/// 开房时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable = true)]
public Nullable<System.DateTime> CheckTime { get; set; }
/// <summary>
/// 退房时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable = true)]
public Nullable<System.DateTime> checkOutTime { get; set; }
/// <summary>
/// 图片
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)")]
public string picture { get; set; }
/// <summary>
/// 身份
/// </summary>
[SugarColumn(ColumnDataType = "varchar(20)", IsNullable = true)]
public string identitys { get; set; }
}
}

View File

@@ -0,0 +1,65 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
/// 开房测试表
/// </summary>
public class CheckinTest
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int id { get; set; }
/// <summary>
/// 测试状态 0是预开 1是已开 2.已退 3.退房失败 4.开房失败
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> testState { get; set; }
/// <summary>
/// 预计开房时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable = true)]
public Nullable<System.DateTime> predictCheckIn { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable = true)]
public Nullable<System.DateTime> creationTime { get; set; }
/// <summary>
/// 开房时长
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> checkInduration { get; set; }
/// <summary>
/// 酒店id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> hotelid { get; set; }
/// <summary>
/// 房间id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> Roomid { get; set; }
/// <summary>
/// 退房时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable = true)]
public Nullable<System.DateTime> CheckoutTime { get; set; }
}
}

View File

@@ -0,0 +1,50 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
/// 日常操作表
/// </summary>
public class Dailyoperation
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int id { get; set; }
/// <summary>
/// 操作人
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)")]
public string Uname { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)")]
public System.DateTime Creationtime { get; set; }
/// <summary>
/// 操作类型
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)",IsNullable =true)]
public string operatetype { get; set; }
/// <summary>
/// 操作数据
/// </summary>
[SugarColumn(ColumnDataType = "varchar(200)", IsNullable = true)]
public string operatedata { get; set; }
/// <summary>
/// 酒店id
/// </summary>
[SugarColumn(ColumnDataType = "int")]
public int hotelCode { get; set; }
}
}

View File

@@ -0,0 +1,85 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{/// <summary>
/// 人脸机设备表
/// </summary>
public class DeviceManage
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int Facelid { get; set; }
/// <summary>
/// SN号
/// </summary>
[SugarColumn(ColumnDataType = "varchar(20)")]
public string SerialNo { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable =true)]
public Nullable<System.DateTime> CreatedDate { get; set; }
/// <summary>
/// 酒店code
/// </summary>
[SugarColumn(ColumnDataType = "varchar(20)", IsNullable = true)]
public string HotelCode { get; set; }
/// <summary>
/// 房间id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> RoomId { get; set; }
/// <summary>
/// 厂家
/// </summary>
[SugarColumn(ColumnDataType = "varchar(10)", IsNullable = true)]
public string Factory { get; set; }
/// <summary>
/// 状态
/// </summary>
[SugarColumn(ColumnDataType = "bit")]
public bool Status { get; set; }
/// <summary>
/// 绑定时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable = true)]
public Nullable<System.DateTime> bindingDate { get; set; }
/// <summary>
/// 绑定状态 1是绑定 0是解绑
/// </summary>
[SugarColumn(ColumnDataType = "bit")]
public bool bindingStatus { get; set; }
/// <summary>
/// ip地址
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)", IsNullable = true)]
public string faceIp { get; set; }
/// <summary>
/// 地理位置
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)")]
public string faceAddress { get; set; }
/// <summary>
/// 维修状态 0是正常 1是故障
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> maintainStatus { get; set; }
}
}

View File

@@ -0,0 +1,55 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
/// 人脸机绑定表
/// </summary>
public class FaceBinding
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int ID { get; set; }
/// <summary>
/// SN号
/// </summary>
[SugarColumn(ColumnDataType = "varchar(100)", IsNullable = true)]
public string SerialNo { get; set; }
/// <summary>
/// 操作人
/// </summary>
[SugarColumn(ColumnDataType = "varchar(20)", IsNullable = true)]
public string Operator { get; set; }
/// <summary>
/// 操作类型
/// </summary>
[SugarColumn(ColumnDataType = "bit", IsNullable = true)]
public Nullable<bool> OperatorType { get; set; }
/// <summary>
/// 绑定时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable = true)]
public Nullable<System.DateTime> bindingDate { get; set; }
/// <summary>
/// 酒店id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> HotelCode { get; set; }
/// <summary>
/// 房间id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> RoomId { get; set; }
}
}

View File

@@ -0,0 +1,60 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
/// 人脸机信息表
/// </summary>
public class FaceInfo
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int id { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)")]
public System.DateTime CreationDate { get; set; }
/// <summary>
/// SN号
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)")]
public string SerialNo { get; set; }
/// <summary>
/// 绑定状态
/// </summary>
[SugarColumn(ColumnDataType = "bit")]
public bool BindingState { get; set; }
/// <summary>
/// 绑定时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable =true)]
public Nullable<System.DateTime> BindingDate { get; set; }
/// <summary>
/// 酒店id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> HotelCode { get; set; }
/// <summary>
/// 房间id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> Roomid { get; set; }
/// <summary>
/// 人脸机状态
/// </summary>
[SugarColumn(ColumnDataType = "bit")]
public bool FaceState { get; set; }
}
}

View File

@@ -0,0 +1,58 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
/// 人脸机流程
/// </summary>
public class FaceIssue
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int id { get; set; }
/// <summary>
/// SN号
/// </summary>
[SugarColumn(ColumnDataType = "varchar(100)")]
public string faceSn { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)")]
public System.DateTime creationtime { get; set; }
/// <summary>
/// pmsid
/// </summary>
[SugarColumn(ColumnDataType = "varchar(200)",IsNullable =true)]
public string pmsid { get; set; }
/// <summary>
/// 图片
/// </summary>
[SugarColumn(ColumnDataType = "varchar(100)", IsNullable = true)]
public string picture { get; set; }
/// <summary>
/// 下发状态 0是成功 1是失败
/// </summary>
[SugarColumn(ColumnDataType = "int")]
public int issuestate { get; set; }
/// <summary>
/// 信息id
/// </summary>
[SugarColumn(ColumnDataType = "varchar(100)")]
public string messageid { get; set; }
}
}

View File

@@ -0,0 +1,47 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
/// 酒店表
/// </summary>
public class Hotel
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int ID { get; set; }
/// <summary>
/// 酒店code
/// </summary>
[SugarColumn(ColumnDataType = "varchar(20)")]
public string Code { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)")]
public string Remark { get; set; }
/// <summary>
/// 是否使用微信
/// </summary>
[SugarColumn(ColumnDataType = "bit")]
public bool UserWX { get; set; }
/// <summary>
/// 酒店ID跟云端对应
/// </summary>
[SugarColumn(ColumnDataType = "int")]
public int HotelID { get; set; }
}
}

View File

@@ -0,0 +1,61 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
/// 入住客人表
/// </summary>
public class Lodger
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int LodgerId { get; set; }
/// <summary>
/// 客户名字
/// </summary>
[SugarColumn(ColumnDataType = "varchar(20)")]
public string LodgerNmae { get; set; }
/// <summary>
/// 客户身份证
/// </summary>
[SugarColumn(ColumnDataType = "varchar(100)")]
public string IDNumber { get; set; }
/// <summary>
/// 性别 0女 1男
/// </summary>
[SugarColumn(ColumnDataType = "int",IsNullable =true)]
public Nullable<int> Sex { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable = true)]
public Nullable<System.DateTime> CheckInDate { get; set; }
/// <summary>
/// 信息来源 0是人工 1是pms接口
/// </summary>
[SugarColumn(ColumnDataType = "int")]
public int Sourcedian { get; set; }
/// <summary>
/// 电话号码
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)", IsNullable = true)]
public string phonenumber { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)", IsNullable = true)]
public string remark { get; set; }
}
}

View File

@@ -0,0 +1,61 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
/// 测试用户表
/// </summary>
public class TestUser
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int id { get; set; }
/// <summary>
/// 测试名字
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)", IsNullable = true)]
public string name { get; set; }
/// <summary>
/// 性别
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> sex { get; set; }
/// <summary>
/// 电话
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)", IsNullable = true)]
public string phone { get; set; }
/// <summary>
/// 身份证
/// </summary>
[SugarColumn(ColumnDataType = "varchar(100)", IsNullable = true)]
public string idNumber { get; set; }
/// <summary>
/// 图片
/// </summary>
[SugarColumn(ColumnDataType = "varchar(200)", IsNullable = true)]
public string picture { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime", IsNullable = true)]
public Nullable<System.DateTime> creationTime { get; set; }
/// <summary>
/// 状态 0是冻结 1是正常
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> state { get; set; }
/// <summary>
/// 创建人
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)", IsNullable = true)]
public string establish { get; set; }
}
}

View File

@@ -0,0 +1,55 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
/// 操作日志表
/// </summary>
public class ULog
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int id { get; set; }
/// <summary>
/// 操作人
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)")]
public string Uname { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)")]
public System.DateTime Creationtime { get; set; }
/// <summary>
/// 操作类型
/// </summary>
[SugarColumn(ColumnDataType = "varchar(20)")]
public string operatetype { get; set; }
/// <summary>
/// SN号
/// </summary>
[SugarColumn(ColumnDataType = "varchar(100)",IsNullable =true)]
public string faceSN { get; set; }
/// <summary>
/// 酒店id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> hotelcode { get; set; }
/// <summary>
/// 房间id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> roomid { get; set; }
}
}

View File

@@ -0,0 +1,45 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
public class devicestatushistory
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int ID { get; set; }
/// <summary>
/// 人脸机串号
/// </summary>
public string SN { get; set; }
/// <summary>
/// 人脸机生产厂家
/// </summary>
public string Factory { get; set; }
/// <summary>
/// 新状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 原因描述
/// </summary>
public string Reason { get; set; }
}
}

View File

@@ -0,0 +1,82 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
public class facedevicerxtxinfo
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int id { get; set; }
/// <summary>
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> pmsid { get; set; }
/// <summary>
/// 数据
/// </summary>
[SugarColumn(ColumnDataType = "varchar(256)", IsNullable = true)]
public string sn { get; set; }
/// <summary>
/// 数据
/// </summary>
[SugarColumn(ColumnDataType = "varchar(256)", IsNullable = true)]
public string msgid { get; set; }
/// <summary>
/// 数据
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)", IsNullable = true)]
public string cmd { get; set; }
/// <summary>
/// 数据
/// </summary>
[SugarColumn(ColumnDataType = "varchar(10)", IsNullable = true)]
public string direction { get; set; }
/// <summary>
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> trresult { get; set; }
/// <summary>
/// 数据
/// </summary>
[SugarColumn(ColumnDataType = "varchar(700)", IsNullable = true)]
public string data { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable = true)]
public Nullable<System.DateTime> datatime { get; set; }
/// <summary>
/// 数据
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)", IsNullable = true)]
public string ipaddr { get; set; }
/// <summary>
/// 数据
/// </summary>
[SugarColumn(ColumnDataType = "varchar(256)", IsNullable = true)]
public string iplocation { get; set; }
}
}

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
public class fileawholelog
{
public int id { get; set; }
public string filename { get; set; }
public string md5 { get; set; }
public DateTime creationtime { get; set; }
public int filetype { get; set; }
public int hotelid { get; set; }
public int roomid { get; set; }
public int type { get; set; }
public string remark { get; set; }
public double firmwaresize { get; set; }
}
}

View File

@@ -0,0 +1,51 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
/// pms信息
/// </summary>
public class pmsInfo
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int pmsid { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable =true)]
public Nullable<System.DateTime> Creationtime { get; set; }
/// <summary>
/// 数据
/// </summary>
[SugarColumn(ColumnDataType = "varchar(300)")]
public string data { get; set; }
/// <summary>
/// 信息类型 0是退房 1是开房
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> infotype { get; set; }
/// <summary>
/// 酒店id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> hotelid { get; set; }
/// <summary>
/// 房间id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> room { get; set; }
}
}

View File

@@ -0,0 +1,67 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
/// pms传输人脸机表
/// </summary>
public class pmsInterface
{
/// <summary>
/// pmsid
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int pmsId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)")]
public System.DateTime DateTime { get; set; }
/// <summary>
/// pms 传输内容
/// </summary>
[SugarColumn(ColumnDataType = "varchar(300)")]
public string pmsContent { get; set; }
/// <summary>
/// 酒店id
/// </summary>
[SugarColumn(ColumnDataType = "int",IsNullable =true)]
public Nullable<int> hotelid { get; set; }
/// <summary>
/// 房间id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> room { get; set; }
/// <summary>
/// SN号
/// </summary>
[SugarColumn(ColumnDataType = "varchar(100)", IsNullable = true)]
public string faceSN { get; set; }
/// <summary>
/// 1是成功 2是失败 3是人脸机不在线 下发结果
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> issueresult { get; set; }
/// <summary>
/// 1是开房 0是退房
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> pmstype { get; set; }
/// <summary>
/// 信息id
/// </summary>
[SugarColumn(ColumnDataType = "varchar(100)", IsNullable = true)]
public string messageid { get; set; }
}
}

View File

@@ -0,0 +1,57 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
/// pms日志表
/// </summary>
public class pmsLog
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int id { get; set; }
/// <summary>
/// pmsid
/// </summary>
[SugarColumn(ColumnDataType = "int")]
public int pmsid { get; set; }
/// <summary>
/// 步骤
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> step { get; set; }
/// <summary>
/// app 1是face 2是console
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> app { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable = true)]
public Nullable<System.DateTime> Creationtime { get; set; }
/// <summary>
/// 说明
/// </summary>
[SugarColumn(ColumnDataType = "varchar(50)", IsNullable = true)]
public string message { get; set; }
/// <summary>
/// 数据
/// </summary>
[SugarColumn(ColumnDataType = "varchar(500)", IsNullable = true)]
public string Data { get; set; }
}
}

View File

@@ -0,0 +1,33 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
///
/// </summary>
public class subtabulation
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int id { get; set; }
/// <summary>
/// 信息id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> masterid { get; set; }
/// <summary>
/// 用户id
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> Lodgerid { get; set; }
}
}

View File

@@ -0,0 +1,44 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application.FaceAll
{
/// <summary>
///
/// </summary>
public class transferFace
{
/// <summary>
/// id
/// </summary>
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int id { get; set; }
/// <summary>
/// SN号
/// </summary>
[SugarColumn(ColumnDataType = "varchar(100)", IsNullable = true)]
public string faceSN { get; set; }
/// <summary>
/// 信息id
/// </summary>
[SugarColumn(ColumnDataType = "varchar(150)", IsNullable = true)]
public string infoid { get; set; }
/// <summary>
/// 故障状态 0是收到 1是正处理 2是失败 3是已成功
/// </summary>
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public Nullable<int> faultState { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable = true)]
public Nullable<System.DateTime> creationTime { get; set; }
}
}

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain
{
public class NurseScheduleStatisticsModel : DynamicObject
{
public string EmpName { get; set; }
public string TotalHour { get; set; }
public string TotalWork { get; set; }
Dictionary<string, object> Properties = new Dictionary<string, object>();
public override bool TrySetMember(SetMemberBinder binder, object value)
{
if (!Properties.Keys.Contains(binder.Name))
{
//在此可以做一些小动作
//if (binder.Name == "Col")
//  Properties.Add(binder.Name + (Properties.Count), value.ToString());
//else
//  Properties.Add(binder.Name, value.ToString());
Properties.Add(binder.Name, value.ToString());
}
return true;
}
public override bool TryGetMember(GetMemberBinder binder, out object result)
{
return Properties.TryGetValue(binder.Name, out result);
}
}
}

View File

@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain
{
/// <summary>
/// 产值查询实体
/// </summary>
public class OutputValueModel
{
public int ID { get; set; }
/// <summary>
/// 订单ID
/// </summary>
public int OrderID { get; set; }
/// <summary>
/// 产线ID
/// </summary>
public int ProductionLineID { get; set; }
/// <summary>
/// 产线名称
/// </summary>
public string ProductionLineName { get; set; }
/// <summary>
/// 生产时间
/// </summary>
public string ProductionTime { get; set; }
/// <summary>
/// 已完成产量
/// </summary>
public int ActualOutput { get; set; }
/// <summary>
/// 价格
/// </summary>
public float Price { get; set; }
/// <summary>
/// 价格
/// </summary>
public float OutputPrice { get; set; }
}
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain
{
public class Sys_Currency
{
/// <summary>
/// 币种
/// </summary>
public string Currency { get; set; }
/// <summary>
/// 币种名称
/// </summary>
public string CurrencyName { get; set; }
/// <summary>
/// 币种符号
/// </summary>
public string CurrencySymbol { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain
{
public class TBL_Station
{
/// <summary>
/// 站ID
/// </summary>
public int StationID { get; set; }
/// <summary>
/// 站名
/// </summary>
public string StationName { get; set; }
/// <summary>
/// 操作站类型
/// </summary>
public string StationType { get; set; }
/// <summary>
/// 工艺排序
/// </summary>
public int ArtworkOrder { get; set; }
}
}

View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain
{
public class TBL_QA_TestLog
{
/// <summary>
/// 用户ID
/// </summary>
public int UserID { get; set; }
/// <summary>
/// 序号
/// </summary>
public string DUT_SN { get; set; }
/// <summary>
/// 时间
/// </summary>
public DateTime StartTime { get; set; }
/// <summary>
/// 测试结果
/// </summary>
public bool TestResult { get; set; }
/// <summary>
/// 检测过程
/// </summary>
public string QA_FlowLog { get; set; }
/// <summary>
/// 检测备注
/// </summary>
public string QA_CheckResult { get; set; }
}
}

View File

@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application
{
/// <summary>
/// 房间 基本信息
/// </summary>
[Table("TBL_ROOM_BASIC_INFO")]
public class TBL_ROOM_BASIC_INFO
{
/// <summary>
/// 自增id
/// </summary>
[Key, Column(TypeName = "int"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int ROOM_ID { get; set; }
/// <summary>
/// 酒店编号
/// </summary>
[Required, Column(TypeName = "int"), ]
public int HOTEL_ID { get; set; }
/// <summary>
/// 房型id
/// </summary>
[Required, Column(TypeName = "int")]
public int ROOM_TYPE_ID { get; set; }
public int RoomStatusID { get; set; }
/// <summary>
/// 房间号
/// </summary>
[Required, Column(TypeName = "varchar(20)")]
public string ROOM_NUMBER { get; set; }
/// <summary>
/// 房间描述
/// </summary>
[Column(TypeName = "varchar(200)")]
public string DESCRPTION { get; set; }
/// <summary>
/// RCU_ID TBL_RCU_BASIC_INFO表MAC
/// </summary>
[Column(TypeName = "varchar(50)")]
public string MAC { get; set; }
/// <summary>
/// 记录更新时间
/// </summary>
[Required, Column(TypeName = "datetime")]
public DateTime UPDATE_TIMEMARK { get; set; }
/// <summary>
/// 备注
/// </summary>
[Column(TypeName = "varchar(200)")]
public string REMARK { get; set; }
/// <summary>
/// 房型id 巫工
/// </summary>
[Required, Column(TypeName = "int")]
public int ROOM_TYPE_OLD_ID { get; set; }
/// <summary>
/// 酒店编号 巫工
/// </summary>
[Required, Column(TypeName = "int")]
public int HOTEL_OLD_ID { get; set; }
/// <summary>
/// id 巫工
/// </summary>
[Column(TypeName = "int")]
public int ROOM_OLD_ID { get; set; }
}
}

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain
{
/// <summary>
/// 测试记录实体
/// </summary>
public class TBL_TestLog
{
/// <summary>
/// ID
/// </summary>
public int ID { get; set; }
/// <summary>
/// sn号
/// </summary>
public string Tester_SN { get; set; }
/// <summary>
/// 测试结果
/// </summary>
public bool TestResult { get; set; }
/// <summary>
/// 订单ID
/// </summary>
public int OrderID { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain
{
public class ToDayCapacity
{
/// <summary>
/// DUT序号
/// </summary>
public string DUT_SN { get; set; }
/// <summary>
/// 检测时间
/// </summary>
public DateTime StartTime { get; set; }
/// <summary>
/// T5-2检测时间
/// </summary>
public string DateTime_2nd { get; set; }
/// <summary>
/// 检测结果
/// </summary>
public bool TestResult { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application
{
public class UserAdmin
{
public int Id { get; set; }
public string Uid { get; set; }
public string Pwd { get; set; }
public string PwdSee { get; set; }
public string HeadImg { get; set; }
public int Sex { get; set; }
public int Age { get; set; }
public int IsValid { get; set; }
public string Desc { get; set; }
public string CreateTime { get; set; }
public string CreatedBy { get; set; }
public int HotelID { get; set; }
public int HotelGroupID { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Face.Domain.Application
{
public class tb_HotelCode
{
public string Code { get; set; }
public string Remark { get; set; }
public bool UserWX { get; set; }
public int HotelID { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Face.Domain.Entities
{
using System;
using System.Collections.Generic;
public partial class AppAutho
{
public int AppId { get; set; }
public int AuthorityId { get; set; }
public int Id { get; set; }
public System.DateTime CreateTime { get; set; }
public string CreatedBy { get; set; }
public virtual Authority Authority { get; set; }
}
}

View File

@@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Face.Domain.Entities
{
using System;
using System.Collections.Generic;
public partial class AuthoStatusType
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public AuthoStatusType()
{
this.OrgAuthority = new HashSet<OrgAuthority>();
this.UserAuthoes = new HashSet<UserAuthoes>();
}
public int Id { get; set; }
public string Name { get; set; }
public string Desc { get; set; }
public System.DateTime CreateTime { get; set; }
public string CreatedBy { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<OrgAuthority> OrgAuthority { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<UserAuthoes> UserAuthoes { get; set; }
}
}

View File

@@ -0,0 +1,40 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Face.Domain.Entities
{
using System;
using System.Collections.Generic;
public partial class Authority
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public Authority()
{
this.AppAutho = new HashSet<AppAutho>();
this.OrgAuthority = new HashSet<OrgAuthority>();
this.UserAuthoes = new HashSet<UserAuthoes>();
}
public int Id { get; set; }
public string AuthorityName { get; set; }
public string Desc { get; set; }
public System.DateTime CreateTime { get; set; }
public string CreatedBy { get; set; }
public Nullable<int> IsValid { get; set; }
public string AuthoStatusTypeId { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<AppAutho> AppAutho { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<OrgAuthority> OrgAuthority { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<UserAuthoes> UserAuthoes { get; set; }
}
}

View File

@@ -0,0 +1,45 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Face.Domain.Entities
{
using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
public partial class AuthorityDBEntitiesShow : DbContext
{
public AuthorityDBEntitiesShow()
: base("name=AuthorityDBEntitiesShow")
{
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
throw new UnintentionalCodeFirstException();
}
public virtual DbSet<C__MigrationHistory> C__MigrationHistory { get; set; }
public virtual DbSet<AppAutho> AppAutho { get; set; }
public virtual DbSet<Authority> Authority { get; set; }
public virtual DbSet<AuthoStatusType> AuthoStatusType { get; set; }
public virtual DbSet<DbLog> DbLog { get; set; }
public virtual DbSet<Hosts> Hosts { get; set; }
public virtual DbSet<HotelGroups> HotelGroups { get; set; }
public virtual DbSet<OrgAuthority> OrgAuthority { get; set; }
public virtual DbSet<TBL_Multilingual> TBL_Multilingual { get; set; }
public virtual DbSet<TBL_RCU_InfraredPacket> TBL_RCU_InfraredPacket { get; set; }
public virtual DbSet<UserAuthoes> UserAuthoes { get; set; }
public virtual DbSet<UserLog> UserLog { get; set; }
public virtual DbSet<TBL_MultilingualApps> TBL_MultilingualApps { get; set; }
public virtual DbSet<TBL_MultilingualData> TBL_MultilingualData { get; set; }
public virtual DbSet<Hotels> Hotels { get; set; }
public virtual DbSet<UserInfo> UserInfo { get; set; }
}
}

View File

@@ -0,0 +1,636 @@
<#@ template language="C#" debug="false" hostspecific="true"#>
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
output extension=".cs"#><#
const string inputFile = @"AuthorityDBModel.edmx";
var textTransform = DynamicTextTransformation.Create(this);
var code = new CodeGenerationTools(this);
var ef = new MetadataTools(this);
var typeMapper = new TypeMapper(code, ef, textTransform.Errors);
var loader = new EdmMetadataLoader(textTransform.Host, textTransform.Errors);
var itemCollection = loader.CreateEdmItemCollection(inputFile);
var modelNamespace = loader.GetModelNamespace(inputFile);
var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef);
var container = itemCollection.OfType<EntityContainer>().FirstOrDefault();
if (container == null)
{
return string.Empty;
}
#>
//------------------------------------------------------------------------------
// <auto-generated>
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#>
//
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#>
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#>
// </auto-generated>
//------------------------------------------------------------------------------
<#
var codeNamespace = code.VsNamespaceSuggestion();
if (!String.IsNullOrEmpty(codeNamespace))
{
#>
namespace <#=code.EscapeNamespace(codeNamespace)#>
{
<#
PushIndent(" ");
}
#>
using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
<#
if (container.FunctionImports.Any())
{
#>
using System.Data.Entity.Core.Objects;
using System.Linq;
<#
}
#>
<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : DbContext
{
public <#=code.Escape(container)#>()
: base("name=<#=container.Name#>")
{
<#
if (!loader.IsLazyLoadingEnabled(container))
{
#>
this.Configuration.LazyLoadingEnabled = false;
<#
}
foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>())
{
// Note: the DbSet members are defined below such that the getter and
// setter always have the same accessibility as the DbSet definition
if (Accessibility.ForReadOnlyProperty(entitySet) != "public")
{
#>
<#=codeStringGenerator.DbSetInitializer(entitySet)#>
<#
}
}
#>
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
throw new UnintentionalCodeFirstException();
}
<#
foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>())
{
#>
<#=codeStringGenerator.DbSet(entitySet)#>
<#
}
foreach (var edmFunction in container.FunctionImports)
{
WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: false);
}
#>
}
<#
if (!String.IsNullOrEmpty(codeNamespace))
{
PopIndent();
#>
}
<#
}
#>
<#+
private void WriteFunctionImport(TypeMapper typeMapper, CodeStringGenerator codeStringGenerator, EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
{
if (typeMapper.IsComposable(edmFunction))
{
#>
[DbFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")]
<#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#>
{
<#+
codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter);
#>
<#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#>
}
<#+
}
else
{
#>
<#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#>
{
<#+
codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter);
#>
<#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#>
}
<#+
if (typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption))
{
WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: true);
}
}
}
public void WriteFunctionParameter(string name, string isNotNull, string notNullInit, string nullInit)
{
#>
var <#=name#> = <#=isNotNull#> ?
<#=notNullInit#> :
<#=nullInit#>;
<#+
}
public const string TemplateId = "CSharp_DbContext_Context_EF6";
public class CodeStringGenerator
{
private readonly CodeGenerationTools _code;
private readonly TypeMapper _typeMapper;
private readonly MetadataTools _ef;
public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef)
{
ArgumentNotNull(code, "code");
ArgumentNotNull(typeMapper, "typeMapper");
ArgumentNotNull(ef, "ef");
_code = code;
_typeMapper = typeMapper;
_ef = ef;
}
public string Property(EdmProperty edmProperty)
{
return string.Format(
CultureInfo.InvariantCulture,
"{0} {1} {2} {{ {3}get; {4}set; }}",
Accessibility.ForProperty(edmProperty),
_typeMapper.GetTypeName(edmProperty.TypeUsage),
_code.Escape(edmProperty),
_code.SpaceAfter(Accessibility.ForGetter(edmProperty)),
_code.SpaceAfter(Accessibility.ForSetter(edmProperty)));
}
public string NavigationProperty(NavigationProperty navProp)
{
var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType());
return string.Format(
CultureInfo.InvariantCulture,
"{0} {1} {2} {{ {3}get; {4}set; }}",
AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)),
navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType,
_code.Escape(navProp),
_code.SpaceAfter(Accessibility.ForGetter(navProp)),
_code.SpaceAfter(Accessibility.ForSetter(navProp)));
}
public string AccessibilityAndVirtual(string accessibility)
{
return accessibility + (accessibility != "private" ? " virtual" : "");
}
public string EntityClassOpening(EntityType entity)
{
return string.Format(
CultureInfo.InvariantCulture,
"{0} {1}partial class {2}{3}",
Accessibility.ForType(entity),
_code.SpaceAfter(_code.AbstractOption(entity)),
_code.Escape(entity),
_code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType)));
}
public string EnumOpening(SimpleType enumType)
{
return string.Format(
CultureInfo.InvariantCulture,
"{0} enum {1} : {2}",
Accessibility.ForType(enumType),
_code.Escape(enumType),
_code.Escape(_typeMapper.UnderlyingClrType(enumType)));
}
public void WriteFunctionParameters(EdmFunction edmFunction, Action<string, string, string, string> writeParameter)
{
var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable))
{
var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null";
var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")";
var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))";
writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit);
}
}
public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace)
{
var parameters = _typeMapper.GetParameters(edmFunction);
return string.Format(
CultureInfo.InvariantCulture,
"{0} IQueryable<{1}> {2}({3})",
AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
_typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
_code.Escape(edmFunction),
string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()));
}
public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace)
{
var parameters = _typeMapper.GetParameters(edmFunction);
return string.Format(
CultureInfo.InvariantCulture,
"return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});",
_typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
edmFunction.NamespaceName,
edmFunction.Name,
string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()),
_code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())));
}
public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
{
var parameters = _typeMapper.GetParameters(edmFunction);
var returnType = _typeMapper.GetReturnType(edmFunction);
var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray());
if (includeMergeOption)
{
paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption";
}
return string.Format(
CultureInfo.InvariantCulture,
"{0} {1} {2}({3})",
AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
_code.Escape(edmFunction),
paramList);
}
public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
{
var parameters = _typeMapper.GetParameters(edmFunction);
var returnType = _typeMapper.GetReturnType(edmFunction);
var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()));
if (includeMergeOption)
{
callParams = ", mergeOption" + callParams;
}
return string.Format(
CultureInfo.InvariantCulture,
"return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});",
returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
edmFunction.Name,
callParams);
}
public string DbSet(EntitySet entitySet)
{
return string.Format(
CultureInfo.InvariantCulture,
"{0} virtual DbSet<{1}> {2} {{ get; set; }}",
Accessibility.ForReadOnlyProperty(entitySet),
_typeMapper.GetTypeName(entitySet.ElementType),
_code.Escape(entitySet));
}
public string DbSetInitializer(EntitySet entitySet)
{
return string.Format(
CultureInfo.InvariantCulture,
"{0} = Set<{1}>();",
_code.Escape(entitySet),
_typeMapper.GetTypeName(entitySet.ElementType));
}
public string UsingDirectives(bool inHeader, bool includeCollections = true)
{
return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion())
? string.Format(
CultureInfo.InvariantCulture,
"{0}using System;{1}" +
"{2}",
inHeader ? Environment.NewLine : "",
includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "",
inHeader ? "" : Environment.NewLine)
: "";
}
}
public class TypeMapper
{
private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName";
private readonly System.Collections.IList _errors;
private readonly CodeGenerationTools _code;
private readonly MetadataTools _ef;
public static string FixNamespaces(string typeName)
{
return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial.");
}
public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors)
{
ArgumentNotNull(code, "code");
ArgumentNotNull(ef, "ef");
ArgumentNotNull(errors, "errors");
_code = code;
_ef = ef;
_errors = errors;
}
public string GetTypeName(TypeUsage typeUsage)
{
return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null);
}
public string GetTypeName(EdmType edmType)
{
return GetTypeName(edmType, isNullable: null, modelNamespace: null);
}
public string GetTypeName(TypeUsage typeUsage, string modelNamespace)
{
return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace);
}
public string GetTypeName(EdmType edmType, string modelNamespace)
{
return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace);
}
public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace)
{
if (edmType == null)
{
return null;
}
var collectionType = edmType as CollectionType;
if (collectionType != null)
{
return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace));
}
var typeName = _code.Escape(edmType.MetadataProperties
.Where(p => p.Name == ExternalTypeNameAttributeName)
.Select(p => (string)p.Value)
.FirstOrDefault())
?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ?
_code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) :
_code.Escape(edmType));
if (edmType is StructuralType)
{
return typeName;
}
if (edmType is SimpleType)
{
var clrType = UnderlyingClrType(edmType);
if (!IsEnumType(edmType))
{
typeName = _code.Escape(clrType);
}
typeName = FixNamespaces(typeName);
return clrType.IsValueType && isNullable == true ?
String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) :
typeName;
}
throw new ArgumentException("edmType");
}
public Type UnderlyingClrType(EdmType edmType)
{
ArgumentNotNull(edmType, "edmType");
var primitiveType = edmType as PrimitiveType;
if (primitiveType != null)
{
return primitiveType.ClrEquivalentType;
}
if (IsEnumType(edmType))
{
return GetEnumUnderlyingType(edmType).ClrEquivalentType;
}
return typeof(object);
}
public object GetEnumMemberValue(MetadataItem enumMember)
{
ArgumentNotNull(enumMember, "enumMember");
var valueProperty = enumMember.GetType().GetProperty("Value");
return valueProperty == null ? null : valueProperty.GetValue(enumMember, null);
}
public string GetEnumMemberName(MetadataItem enumMember)
{
ArgumentNotNull(enumMember, "enumMember");
var nameProperty = enumMember.GetType().GetProperty("Name");
return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null);
}
public System.Collections.IEnumerable GetEnumMembers(EdmType enumType)
{
ArgumentNotNull(enumType, "enumType");
var membersProperty = enumType.GetType().GetProperty("Members");
return membersProperty != null
? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null)
: Enumerable.Empty<MetadataItem>();
}
public bool EnumIsFlags(EdmType enumType)
{
ArgumentNotNull(enumType, "enumType");
var isFlagsProperty = enumType.GetType().GetProperty("IsFlags");
return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null);
}
public bool IsEnumType(GlobalItem edmType)
{
ArgumentNotNull(edmType, "edmType");
return edmType.GetType().Name == "EnumType";
}
public PrimitiveType GetEnumUnderlyingType(EdmType enumType)
{
ArgumentNotNull(enumType, "enumType");
return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null);
}
public string CreateLiteral(object value)
{
if (value == null || value.GetType() != typeof(TimeSpan))
{
return _code.CreateLiteral(value);
}
return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks);
}
public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable<string> types, string sourceFile)
{
ArgumentNotNull(types, "types");
ArgumentNotNull(sourceFile, "sourceFile");
var hash = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
if (types.Any(item => !hash.Add(item)))
{
_errors.Add(
new CompilerError(sourceFile, -1, -1, "6023",
String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict"))));
return false;
}
return true;
}
public IEnumerable<SimpleType> GetEnumItemsToGenerate(IEnumerable<GlobalItem> itemCollection)
{
return GetItemsToGenerate<SimpleType>(itemCollection)
.Where(e => IsEnumType(e));
}
public IEnumerable<T> GetItemsToGenerate<T>(IEnumerable<GlobalItem> itemCollection) where T: EdmType
{
return itemCollection
.OfType<T>()
.Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName))
.OrderBy(i => i.Name);
}
public IEnumerable<string> GetAllGlobalItems(IEnumerable<GlobalItem> itemCollection)
{
return itemCollection
.Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i))
.Select(g => GetGlobalItemName(g));
}
public string GetGlobalItemName(GlobalItem item)
{
if (item is EdmType)
{
return ((EdmType)item).Name;
}
else
{
return ((EntityContainer)item).Name;
}
}
public IEnumerable<EdmProperty> GetSimpleProperties(EntityType type)
{
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
}
public IEnumerable<EdmProperty> GetSimpleProperties(ComplexType type)
{
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
}
public IEnumerable<EdmProperty> GetComplexProperties(EntityType type)
{
return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
}
public IEnumerable<EdmProperty> GetComplexProperties(ComplexType type)
{
return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
}
public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(EntityType type)
{
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
}
public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(ComplexType type)
{
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
}
public IEnumerable<NavigationProperty> GetNavigationProperties(EntityType type)
{
return type.NavigationProperties.Where(np => np.DeclaringType == type);
}
public IEnumerable<NavigationProperty> GetCollectionNavigationProperties(EntityType type)
{
return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many);
}
public FunctionParameter GetReturnParameter(EdmFunction edmFunction)
{
ArgumentNotNull(edmFunction, "edmFunction");
var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters");
return returnParamsProperty == null
? edmFunction.ReturnParameter
: ((IEnumerable<FunctionParameter>)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault();
}
public bool IsComposable(EdmFunction edmFunction)
{
ArgumentNotNull(edmFunction, "edmFunction");
var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute");
return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null);
}
public IEnumerable<FunctionImportParameter> GetParameters(EdmFunction edmFunction)
{
return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
}
public TypeUsage GetReturnType(EdmFunction edmFunction)
{
var returnParam = GetReturnParameter(edmFunction);
return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage);
}
public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption)
{
var returnType = GetReturnType(edmFunction);
return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType;
}
}
public static void ArgumentNotNull<T>(T arg, string name) where T : class
{
if (arg == null)
{
throw new ArgumentNullException(name);
}
}
#>

View File

@@ -0,0 +1,10 @@
// 为模型“D:\BLV_SYNC\RD_WEB\SynologyDrive\欧阳磊\Faces\Face.Domain\Entities\AuthorityDBModel.edmx”启用了 T4 代码生成。
// 要启用旧代码生成功能,请将“代码生成策略”设计器属性的值
// 更改为“旧的 ObjectContext”。当在设计器中打开该模型时此属性会出现在
// “属性”窗口中。
// 如果没有生成任何上下文和实体类,可能是因为您创建了空模型但是
// 尚未选择要使用的实体框架版本。要为您的模型生成一个上下文类和实体
// 类,请在设计器中打开该模型,右键单击设计器图面,然后
// 选择“从数据库更新模型...”、“从模型生成数据库...”或“添加代码生成
// 项...”。

View File

@@ -0,0 +1,9 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------

View File

@@ -0,0 +1,905 @@
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
<!-- EF Runtime content -->
<edmx:Runtime>
<!-- SSDL content -->
<edmx:StorageModels>
<Schema Namespace="AuthorityDBModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
<EntityType Name="__MigrationHistory">
<Key>
<PropertyRef Name="MigrationId" />
<PropertyRef Name="ContextKey" />
</Key>
<Property Name="MigrationId" Type="nvarchar" MaxLength="150" Nullable="false" />
<Property Name="ContextKey" Type="nvarchar" MaxLength="300" Nullable="false" />
<Property Name="Model" Type="varbinary(max)" Nullable="false" />
<Property Name="ProductVersion" Type="nvarchar" MaxLength="32" Nullable="false" />
</EntityType>
<EntityType Name="AppAutho">
<Key>
<PropertyRef Name="AppId" />
<PropertyRef Name="AuthorityId" />
</Key>
<Property Name="AppId" Type="int" Nullable="false" />
<Property Name="AuthorityId" Type="int" Nullable="false" />
<Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="CreateTime" Type="datetime" Nullable="false" />
<Property Name="CreatedBy" Type="nvarchar(max)" />
</EntityType>
<EntityType Name="Authority">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="AuthorityName" Type="nvarchar(max)" Nullable="false" />
<Property Name="Desc" Type="nvarchar(max)" />
<Property Name="CreateTime" Type="datetime" Nullable="false" />
<Property Name="CreatedBy" Type="nvarchar(max)" />
<Property Name="IsValid" Type="int" />
<Property Name="AuthoStatusTypeId" Type="nvarchar(max)" />
</EntityType>
<EntityType Name="AuthoStatusType">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="Name" Type="nvarchar(max)" Nullable="false" />
<Property Name="Desc" Type="nvarchar(max)" />
<Property Name="CreateTime" Type="datetime" Nullable="false" />
<Property Name="CreatedBy" Type="nvarchar(max)" />
</EntityType>
<EntityType Name="DbLog">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="Content" Type="nvarchar(max)" />
<Property Name="Uid" Type="nvarchar(max)" />
<Property Name="CreateTime" Type="datetime" Nullable="false" />
<Property Name="Type" Type="int" Nullable="false" />
<Property Name="Ip" Type="nvarchar" MaxLength="50" />
<Property Name="Client" Type="nvarchar(max)" />
<Property Name="location" Type="nvarchar" MaxLength="150" />
</EntityType>
<EntityType Name="Hosts">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="HotelID" Type="int" Nullable="false" />
<Property Name="RoomNumber" Type="nvarchar(max)" />
<Property Name="Status" Type="int" Nullable="false" />
<Property Name="Desc" Type="nvarchar(max)" />
<Property Name="CreateTime" Type="datetime" Nullable="false" />
<Property Name="RoomStatusID" Type="int" />
</EntityType>
<EntityType Name="HotelGroups">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="Name" Type="nvarchar(max)" />
<Property Name="ParentId" Type="int" Nullable="false" />
<Property Name="Desc" Type="nvarchar(max)" />
<Property Name="CreateTime" Type="datetime" Nullable="false" />
</EntityType>
<EntityType Name="Hotels">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="int" Nullable="false" />
<Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
<Property Name="Desc" Type="nvarchar" MaxLength="50" />
<Property Name="GroupId" Type="int" Nullable="false" />
<Property Name="Code" Type="nvarchar" MaxLength="50" />
<Property Name="Status" Type="int" Nullable="false" />
<Property Name="IsApprove" Type="int" Nullable="false" />
<Property Name="CreateTime" Type="datetime" Nullable="false" />
</EntityType>
<EntityType Name="OrgAuthority">
<Key>
<PropertyRef Name="OrgId" />
<PropertyRef Name="AuthorityId" />
<PropertyRef Name="HotelId" />
</Key>
<Property Name="OrgId" Type="int" Nullable="false" />
<Property Name="AuthorityId" Type="int" Nullable="false" />
<Property Name="HotelId" Type="int" Nullable="false" />
<Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="AuthotypeId" Type="int" Nullable="false" />
<Property Name="CreateTime" Type="datetime" />
<Property Name="CreatedBy" Type="nvarchar(max)" />
</EntityType>
<EntityType Name="TBL_Multilingual">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="Language" Type="nvarchar" MaxLength="254" />
<Property Name="ApplicationID" Type="nvarchar" MaxLength="254" />
<Property Name="Version" Type="int" />
</EntityType>
<!--生成过程中发现错误:
警告 6002: 表/视图“AuthorityDB.dbo.TBL_MultilingualApps”未定义主键。已推断出该键并将定义创建为只读的表/视图。-->
<EntityType Name="TBL_MultilingualApps">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="Application" Type="nvarchar" MaxLength="254" />
<Property Name="Remark" Type="nvarchar" MaxLength="254" />
</EntityType>
<!--生成过程中发现错误:
警告 6002: 表/视图“AuthorityDB.dbo.TBL_MultilingualData”未定义主键。已推断出该键并将定义创建为只读的表/视图。-->
<EntityType Name="TBL_MultilingualData">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="中文" Type="nvarchar" MaxLength="254" />
<Property Name="English" Type="nvarchar" MaxLength="254" />
<Property Name="ApplicationID" Type="nvarchar" MaxLength="254" />
</EntityType>
<EntityType Name="TBL_RCU_InfraredPacket">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="Type" Type="varchar" MaxLength="254" />
<Property Name="Brand" Type="varchar" MaxLength="254" />
<Property Name="Model" Type="varchar" MaxLength="254" />
<Property Name="Version" Type="varchar" MaxLength="254" />
<Property Name="CreateDate" Type="datetime" />
<Property Name="PacketName" Type="varchar" MaxLength="254" />
<Property Name="PacketData" Type="image" />
<Property Name="PacketMD5" Type="varchar" MaxLength="254" />
<Property Name="Remark" Type="text" />
<Property Name="OldPacket" Type="bit" />
</EntityType>
<EntityType Name="UserAuthoes">
<Key>
<PropertyRef Name="UserId" />
<PropertyRef Name="AuthorityId" />
<PropertyRef Name="HotelId" />
</Key>
<Property Name="UserId" Type="int" Nullable="false" />
<Property Name="AuthorityId" Type="int" Nullable="false" />
<Property Name="HotelId" Type="int" Nullable="false" />
<Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="AuthotypeId" Type="int" Nullable="false" />
<Property Name="CreateTime" Type="nvarchar(max)" />
<Property Name="CreatedBy" Type="nvarchar(max)" />
</EntityType>
<EntityType Name="UserInfo">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="Uid" Type="nvarchar" MaxLength="50" Nullable="false" />
<Property Name="Pwd" Type="nvarchar" MaxLength="50" Nullable="false" />
<Property Name="PwdSee" Type="nvarchar(max)" />
<Property Name="HeadImg" Type="nvarchar(max)" Nullable="false" />
<Property Name="Sex" Type="int" Nullable="false" />
<Property Name="Age" Type="int" />
<Property Name="IsValid" Type="int" />
<Property Name="Desc" Type="nvarchar(max)" />
<Property Name="CreateTime" Type="datetime" />
<Property Name="CreatedBy" Type="nvarchar(max)" />
<Property Name="HotelID" Type="int" />
<Property Name="HotelGroupID" Type="int" />
<Property Name="IsImport" Type="int" Nullable="false" />
<Property Name="Company" Type="int" />
<Property Name="OldId" Type="int" />
<Property Name="EndTime" Type="datetime" />
<Property Name="Autho" Type="int" Nullable="false" />
</EntityType>
<EntityType Name="UserLog">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="Name" Type="nvarchar" MaxLength="254" />
</EntityType>
<Association Name="FK_dbo_AppAutho_dbo_Authority_AuthorityId">
<End Role="Authority" Type="Self.Authority" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="AppAutho" Type="Self.AppAutho" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Authority">
<PropertyRef Name="Id" />
</Principal>
<Dependent Role="AppAutho">
<PropertyRef Name="AuthorityId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_dbo_OrgAuthority_dbo_Authority_AuthorityId">
<End Role="Authority" Type="Self.Authority" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="OrgAuthority" Type="Self.OrgAuthority" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Authority">
<PropertyRef Name="Id" />
</Principal>
<Dependent Role="OrgAuthority">
<PropertyRef Name="AuthorityId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_dbo_OrgAuthority_dbo_AuthoStatusType_AuthotypeId">
<End Role="AuthoStatusType" Type="Self.AuthoStatusType" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="OrgAuthority" Type="Self.OrgAuthority" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="AuthoStatusType">
<PropertyRef Name="Id" />
</Principal>
<Dependent Role="OrgAuthority">
<PropertyRef Name="AuthotypeId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_dbo_UserAuthoes_dbo_Authority_AuthorityId">
<End Role="Authority" Type="Self.Authority" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="UserAuthoes" Type="Self.UserAuthoes" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Authority">
<PropertyRef Name="Id" />
</Principal>
<Dependent Role="UserAuthoes">
<PropertyRef Name="AuthorityId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_dbo_UserAuthoes_dbo_AuthoStatusType_AuthotypeId">
<End Role="AuthoStatusType" Type="Self.AuthoStatusType" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="UserAuthoes" Type="Self.UserAuthoes" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="AuthoStatusType">
<PropertyRef Name="Id" />
</Principal>
<Dependent Role="UserAuthoes">
<PropertyRef Name="AuthotypeId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_dbo_UserAuthoes_dbo_UserInfo_UserId">
<End Role="UserInfo" Type="Self.UserInfo" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="UserAuthoes" Type="Self.UserAuthoes" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="UserInfo">
<PropertyRef Name="Id" />
</Principal>
<Dependent Role="UserAuthoes">
<PropertyRef Name="UserId" />
</Dependent>
</ReferentialConstraint>
</Association>
<EntityContainer Name="AuthorityDBModelStoreContainer">
<EntitySet Name="__MigrationHistory" EntityType="Self.__MigrationHistory" Schema="dbo" store:Type="Tables" />
<EntitySet Name="AppAutho" EntityType="Self.AppAutho" Schema="dbo" store:Type="Tables" />
<EntitySet Name="Authority" EntityType="Self.Authority" Schema="dbo" store:Type="Tables" />
<EntitySet Name="AuthoStatusType" EntityType="Self.AuthoStatusType" Schema="dbo" store:Type="Tables" />
<EntitySet Name="DbLog" EntityType="Self.DbLog" Schema="dbo" store:Type="Tables" />
<EntitySet Name="Hosts" EntityType="Self.Hosts" Schema="dbo" store:Type="Tables" />
<EntitySet Name="HotelGroups" EntityType="Self.HotelGroups" Schema="dbo" store:Type="Tables" />
<EntitySet Name="Hotels" EntityType="Self.Hotels" Schema="dbo" store:Type="Tables" />
<EntitySet Name="OrgAuthority" EntityType="Self.OrgAuthority" Schema="dbo" store:Type="Tables" />
<EntitySet Name="TBL_Multilingual" EntityType="Self.TBL_Multilingual" Schema="dbo" store:Type="Tables" />
<EntitySet Name="TBL_RCU_InfraredPacket" EntityType="Self.TBL_RCU_InfraredPacket" Schema="dbo" store:Type="Tables" />
<EntitySet Name="UserAuthoes" EntityType="Self.UserAuthoes" Schema="dbo" store:Type="Tables" />
<EntitySet Name="UserInfo" EntityType="Self.UserInfo" Schema="dbo" store:Type="Tables" />
<EntitySet Name="UserLog" EntityType="Self.UserLog" Schema="dbo" store:Type="Tables" />
<EntitySet Name="TBL_MultilingualApps" EntityType="Self.TBL_MultilingualApps" store:Type="Tables" store:Schema="dbo">
<DefiningQuery>SELECT
[TBL_MultilingualApps].[ID] AS [ID],
[TBL_MultilingualApps].[Application] AS [Application],
[TBL_MultilingualApps].[Remark] AS [Remark]
FROM [dbo].[TBL_MultilingualApps] AS [TBL_MultilingualApps]</DefiningQuery>
</EntitySet>
<EntitySet Name="TBL_MultilingualData" EntityType="Self.TBL_MultilingualData" store:Type="Tables" store:Schema="dbo">
<DefiningQuery>SELECT
[TBL_MultilingualData].[ID] AS [ID],
[TBL_MultilingualData].[中文] AS [中文],
[TBL_MultilingualData].[English] AS [English],
[TBL_MultilingualData].[ApplicationID] AS [ApplicationID]
FROM [dbo].[TBL_MultilingualData] AS [TBL_MultilingualData]</DefiningQuery>
</EntitySet>
<AssociationSet Name="FK_dbo_AppAutho_dbo_Authority_AuthorityId" Association="Self.FK_dbo_AppAutho_dbo_Authority_AuthorityId">
<End Role="Authority" EntitySet="Authority" />
<End Role="AppAutho" EntitySet="AppAutho" />
</AssociationSet>
<AssociationSet Name="FK_dbo_OrgAuthority_dbo_Authority_AuthorityId" Association="Self.FK_dbo_OrgAuthority_dbo_Authority_AuthorityId">
<End Role="Authority" EntitySet="Authority" />
<End Role="OrgAuthority" EntitySet="OrgAuthority" />
</AssociationSet>
<AssociationSet Name="FK_dbo_OrgAuthority_dbo_AuthoStatusType_AuthotypeId" Association="Self.FK_dbo_OrgAuthority_dbo_AuthoStatusType_AuthotypeId">
<End Role="AuthoStatusType" EntitySet="AuthoStatusType" />
<End Role="OrgAuthority" EntitySet="OrgAuthority" />
</AssociationSet>
<AssociationSet Name="FK_dbo_UserAuthoes_dbo_Authority_AuthorityId" Association="Self.FK_dbo_UserAuthoes_dbo_Authority_AuthorityId">
<End Role="Authority" EntitySet="Authority" />
<End Role="UserAuthoes" EntitySet="UserAuthoes" />
</AssociationSet>
<AssociationSet Name="FK_dbo_UserAuthoes_dbo_AuthoStatusType_AuthotypeId" Association="Self.FK_dbo_UserAuthoes_dbo_AuthoStatusType_AuthotypeId">
<End Role="AuthoStatusType" EntitySet="AuthoStatusType" />
<End Role="UserAuthoes" EntitySet="UserAuthoes" />
</AssociationSet>
<AssociationSet Name="FK_dbo_UserAuthoes_dbo_UserInfo_UserId" Association="Self.FK_dbo_UserAuthoes_dbo_UserInfo_UserId">
<End Role="UserInfo" EntitySet="UserInfo" />
<End Role="UserAuthoes" EntitySet="UserAuthoes" />
</AssociationSet>
</EntityContainer>
</Schema></edmx:StorageModels>
<!-- CSDL content -->
<edmx:ConceptualModels>
<Schema Namespace="AuthorityDBModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
<EntityType Name="C__MigrationHistory">
<Key>
<PropertyRef Name="MigrationId" />
<PropertyRef Name="ContextKey" />
</Key>
<Property Name="MigrationId" Type="String" MaxLength="150" FixedLength="false" Unicode="true" Nullable="false" />
<Property Name="ContextKey" Type="String" MaxLength="300" FixedLength="false" Unicode="true" Nullable="false" />
<Property Name="Model" Type="Binary" MaxLength="Max" FixedLength="false" Nullable="false" />
<Property Name="ProductVersion" Type="String" MaxLength="32" FixedLength="false" Unicode="true" Nullable="false" />
</EntityType>
<EntityType Name="AppAutho">
<Key>
<PropertyRef Name="AppId" />
<PropertyRef Name="AuthorityId" />
</Key>
<Property Name="AppId" Type="Int32" Nullable="false" />
<Property Name="AuthorityId" Type="Int32" Nullable="false" />
<Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="CreateTime" Type="DateTime" Nullable="false" Precision="3" />
<Property Name="CreatedBy" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<NavigationProperty Name="Authority" Relationship="Self.FK_dbo_AppAutho_dbo_Authority_AuthorityId" FromRole="AppAutho" ToRole="Authority" />
</EntityType>
<EntityType Name="Authority">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="AuthorityName" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
<Property Name="Desc" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="CreateTime" Type="DateTime" Nullable="false" Precision="3" />
<Property Name="CreatedBy" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="IsValid" Type="Int32" />
<NavigationProperty Name="AppAutho" Relationship="Self.FK_dbo_AppAutho_dbo_Authority_AuthorityId" FromRole="Authority" ToRole="AppAutho" />
<NavigationProperty Name="OrgAuthority" Relationship="Self.FK_dbo_OrgAuthority_dbo_Authority_AuthorityId" FromRole="Authority" ToRole="OrgAuthority" />
<NavigationProperty Name="UserAuthoes" Relationship="Self.FK_dbo_UserAuthoes_dbo_Authority_AuthorityId" FromRole="Authority" ToRole="UserAuthoes" />
<Property Name="AuthoStatusTypeId" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
</EntityType>
<EntityType Name="AuthoStatusType">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="Name" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
<Property Name="Desc" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="CreateTime" Type="DateTime" Nullable="false" Precision="3" />
<Property Name="CreatedBy" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<NavigationProperty Name="OrgAuthority" Relationship="Self.FK_dbo_OrgAuthority_dbo_AuthoStatusType_AuthotypeId" FromRole="AuthoStatusType" ToRole="OrgAuthority" />
<NavigationProperty Name="UserAuthoes" Relationship="Self.FK_dbo_UserAuthoes_dbo_AuthoStatusType_AuthotypeId" FromRole="AuthoStatusType" ToRole="UserAuthoes" />
</EntityType>
<EntityType Name="DbLog">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="Content" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="Uid" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="CreateTime" Type="DateTime" Nullable="false" Precision="3" />
<Property Name="Type" Type="Int32" Nullable="false" />
<Property Name="Ip" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="Client" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="location" Type="String" MaxLength="150" FixedLength="false" Unicode="true" />
</EntityType>
<EntityType Name="Hosts">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="HotelID" Type="Int32" Nullable="false" />
<Property Name="RoomNumber" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="Status" Type="Int32" Nullable="false" />
<Property Name="Desc" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="CreateTime" Type="DateTime" Nullable="false" Precision="3" />
<Property Name="RoomStatusID" Type="Int32" />
</EntityType>
<EntityType Name="HotelGroups">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="Name" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="ParentId" Type="Int32" Nullable="false" />
<Property Name="Desc" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="CreateTime" Type="DateTime" Nullable="false" Precision="3" />
</EntityType>
<EntityType Name="OrgAuthority">
<Key>
<PropertyRef Name="OrgId" />
<PropertyRef Name="AuthorityId" />
<PropertyRef Name="HotelId" />
</Key>
<Property Name="OrgId" Type="Int32" Nullable="false" />
<Property Name="AuthorityId" Type="Int32" Nullable="false" />
<Property Name="HotelId" Type="Int32" Nullable="false" />
<Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="AuthotypeId" Type="Int32" Nullable="false" />
<Property Name="CreateTime" Type="DateTime" Precision="3" />
<Property Name="CreatedBy" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<NavigationProperty Name="Authority" Relationship="Self.FK_dbo_OrgAuthority_dbo_Authority_AuthorityId" FromRole="OrgAuthority" ToRole="Authority" />
<NavigationProperty Name="AuthoStatusType" Relationship="Self.FK_dbo_OrgAuthority_dbo_AuthoStatusType_AuthotypeId" FromRole="OrgAuthority" ToRole="AuthoStatusType" />
</EntityType>
<EntityType Name="TBL_Multilingual">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="Language" Type="String" MaxLength="254" FixedLength="false" Unicode="true" />
<Property Name="ApplicationID" Type="String" MaxLength="254" FixedLength="false" Unicode="true" />
<Property Name="Version" Type="Int32" />
</EntityType>
<EntityType Name="TBL_RCU_InfraredPacket">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="Type" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
<Property Name="Brand" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
<Property Name="Model" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
<Property Name="Version" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
<Property Name="CreateDate" Type="DateTime" Precision="3" />
<Property Name="PacketName" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
<Property Name="PacketData" Type="Binary" MaxLength="Max" FixedLength="false" />
<Property Name="PacketMD5" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
<Property Name="Remark" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
<Property Name="OldPacket" Type="Boolean" />
</EntityType>
<EntityType Name="UserAuthoes">
<Key>
<PropertyRef Name="UserId" />
<PropertyRef Name="AuthorityId" />
<PropertyRef Name="HotelId" />
</Key>
<Property Name="UserId" Type="Int32" Nullable="false" />
<Property Name="AuthorityId" Type="Int32" Nullable="false" />
<Property Name="HotelId" Type="Int32" Nullable="false" />
<Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="AuthotypeId" Type="Int32" Nullable="false" />
<Property Name="CreateTime" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="CreatedBy" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<NavigationProperty Name="Authority" Relationship="Self.FK_dbo_UserAuthoes_dbo_Authority_AuthorityId" FromRole="UserAuthoes" ToRole="Authority" />
<NavigationProperty Name="AuthoStatusType" Relationship="Self.FK_dbo_UserAuthoes_dbo_AuthoStatusType_AuthotypeId" FromRole="UserAuthoes" ToRole="AuthoStatusType" />
<NavigationProperty Name="UserInfo" Relationship="AuthorityDBModel.FK_dbo_UserAuthoes_dbo_UserInfo_UserId" FromRole="UserAuthoes" ToRole="UserInfo" />
</EntityType>
<EntityType Name="UserLog">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="Name" Type="String" MaxLength="254" FixedLength="false" Unicode="true" />
</EntityType>
<EntityType Name="TBL_MultilingualApps">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="Application" Type="String" MaxLength="254" FixedLength="false" Unicode="true" />
<Property Name="Remark" Type="String" MaxLength="254" FixedLength="false" Unicode="true" />
</EntityType>
<EntityType Name="TBL_MultilingualData">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="中文" Type="String" MaxLength="254" FixedLength="false" Unicode="true" />
<Property Name="English" Type="String" MaxLength="254" FixedLength="false" Unicode="true" />
<Property Name="ApplicationID" Type="String" MaxLength="254" FixedLength="false" Unicode="true" />
</EntityType>
<Association Name="FK_dbo_AppAutho_dbo_Authority_AuthorityId">
<End Role="Authority" Type="Self.Authority" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="AppAutho" Type="Self.AppAutho" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Authority">
<PropertyRef Name="Id" />
</Principal>
<Dependent Role="AppAutho">
<PropertyRef Name="AuthorityId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_dbo_OrgAuthority_dbo_Authority_AuthorityId">
<End Role="Authority" Type="Self.Authority" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="OrgAuthority" Type="Self.OrgAuthority" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Authority">
<PropertyRef Name="Id" />
</Principal>
<Dependent Role="OrgAuthority">
<PropertyRef Name="AuthorityId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_dbo_UserAuthoes_dbo_Authority_AuthorityId">
<End Role="Authority" Type="Self.Authority" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="UserAuthoes" Type="Self.UserAuthoes" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Authority">
<PropertyRef Name="Id" />
</Principal>
<Dependent Role="UserAuthoes">
<PropertyRef Name="AuthorityId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_dbo_OrgAuthority_dbo_AuthoStatusType_AuthotypeId">
<End Role="AuthoStatusType" Type="Self.AuthoStatusType" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="OrgAuthority" Type="Self.OrgAuthority" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="AuthoStatusType">
<PropertyRef Name="Id" />
</Principal>
<Dependent Role="OrgAuthority">
<PropertyRef Name="AuthotypeId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_dbo_UserAuthoes_dbo_AuthoStatusType_AuthotypeId">
<End Role="AuthoStatusType" Type="Self.AuthoStatusType" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="UserAuthoes" Type="Self.UserAuthoes" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="AuthoStatusType">
<PropertyRef Name="Id" />
</Principal>
<Dependent Role="UserAuthoes">
<PropertyRef Name="AuthotypeId" />
</Dependent>
</ReferentialConstraint>
</Association>
<EntityContainer Name="AuthorityDBEntitiesShow" annotation:LazyLoadingEnabled="true">
<EntitySet Name="C__MigrationHistory" EntityType="Self.C__MigrationHistory" />
<EntitySet Name="AppAutho" EntityType="Self.AppAutho" />
<EntitySet Name="Authority" EntityType="Self.Authority" />
<EntitySet Name="AuthoStatusType" EntityType="Self.AuthoStatusType" />
<EntitySet Name="DbLog" EntityType="Self.DbLog" />
<EntitySet Name="Hosts" EntityType="Self.Hosts" />
<EntitySet Name="HotelGroups" EntityType="Self.HotelGroups" />
<EntitySet Name="OrgAuthority" EntityType="Self.OrgAuthority" />
<EntitySet Name="TBL_Multilingual" EntityType="Self.TBL_Multilingual" />
<EntitySet Name="TBL_RCU_InfraredPacket" EntityType="Self.TBL_RCU_InfraredPacket" />
<EntitySet Name="UserAuthoes" EntityType="Self.UserAuthoes" />
<EntitySet Name="UserLog" EntityType="Self.UserLog" />
<EntitySet Name="TBL_MultilingualApps" EntityType="Self.TBL_MultilingualApps" />
<EntitySet Name="TBL_MultilingualData" EntityType="Self.TBL_MultilingualData" />
<AssociationSet Name="FK_dbo_AppAutho_dbo_Authority_AuthorityId" Association="Self.FK_dbo_AppAutho_dbo_Authority_AuthorityId">
<End Role="Authority" EntitySet="Authority" />
<End Role="AppAutho" EntitySet="AppAutho" />
</AssociationSet>
<AssociationSet Name="FK_dbo_OrgAuthority_dbo_Authority_AuthorityId" Association="Self.FK_dbo_OrgAuthority_dbo_Authority_AuthorityId">
<End Role="Authority" EntitySet="Authority" />
<End Role="OrgAuthority" EntitySet="OrgAuthority" />
</AssociationSet>
<AssociationSet Name="FK_dbo_UserAuthoes_dbo_Authority_AuthorityId" Association="Self.FK_dbo_UserAuthoes_dbo_Authority_AuthorityId">
<End Role="Authority" EntitySet="Authority" />
<End Role="UserAuthoes" EntitySet="UserAuthoes" />
</AssociationSet>
<AssociationSet Name="FK_dbo_OrgAuthority_dbo_AuthoStatusType_AuthotypeId" Association="Self.FK_dbo_OrgAuthority_dbo_AuthoStatusType_AuthotypeId">
<End Role="AuthoStatusType" EntitySet="AuthoStatusType" />
<End Role="OrgAuthority" EntitySet="OrgAuthority" />
</AssociationSet>
<AssociationSet Name="FK_dbo_UserAuthoes_dbo_AuthoStatusType_AuthotypeId" Association="Self.FK_dbo_UserAuthoes_dbo_AuthoStatusType_AuthotypeId">
<End Role="AuthoStatusType" EntitySet="AuthoStatusType" />
<End Role="UserAuthoes" EntitySet="UserAuthoes" />
</AssociationSet>
<EntitySet Name="Hotels" EntityType="AuthorityDBModel.Hotels" />
<EntitySet Name="UserInfo" EntityType="AuthorityDBModel.UserInfo" />
<AssociationSet Name="FK_dbo_UserAuthoes_dbo_UserInfo_UserId" Association="AuthorityDBModel.FK_dbo_UserAuthoes_dbo_UserInfo_UserId">
<End Role="UserInfo" EntitySet="UserInfo" />
<End Role="UserAuthoes" EntitySet="UserAuthoes" />
</AssociationSet>
</EntityContainer>
<EntityType Name="Hotels">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="Int32" Nullable="false" />
<Property Name="Name" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="Desc" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="GroupId" Type="Int32" Nullable="false" />
<Property Name="Code" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="Status" Type="Int32" Nullable="false" />
<Property Name="IsApprove" Type="Int32" Nullable="false" />
<Property Name="CreateTime" Type="DateTime" Nullable="false" Precision="3" />
</EntityType>
<EntityType Name="UserInfo">
<Key>
<PropertyRef Name="Id" />
</Key>
<Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="Uid" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="Pwd" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="PwdSee" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="HeadImg" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="Sex" Type="Int32" Nullable="false" />
<Property Name="Age" Type="Int32" />
<Property Name="IsValid" Type="Int32" />
<Property Name="Desc" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="CreateTime" Type="DateTime" Precision="3" />
<Property Name="CreatedBy" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="HotelID" Type="Int32" />
<Property Name="HotelGroupID" Type="Int32" />
<Property Name="IsImport" Type="Int32" Nullable="false" />
<Property Name="Company" Type="Int32" />
<Property Name="OldId" Type="Int32" />
<Property Name="EndTime" Type="DateTime" Precision="3" />
<Property Name="Autho" Type="Int32" Nullable="false" />
<NavigationProperty Name="UserAuthoes" Relationship="AuthorityDBModel.FK_dbo_UserAuthoes_dbo_UserInfo_UserId" FromRole="UserInfo" ToRole="UserAuthoes" />
</EntityType>
<Association Name="FK_dbo_UserAuthoes_dbo_UserInfo_UserId">
<End Type="AuthorityDBModel.UserInfo" Role="UserInfo" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Type="AuthorityDBModel.UserAuthoes" Role="UserAuthoes" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="UserInfo">
<PropertyRef Name="Id" />
</Principal>
<Dependent Role="UserAuthoes">
<PropertyRef Name="UserId" />
</Dependent>
</ReferentialConstraint>
</Association>
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
<edmx:Mappings>
<Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
<EntityContainerMapping StorageEntityContainer="AuthorityDBModelStoreContainer" CdmEntityContainer="AuthorityDBEntitiesShow">
<EntitySetMapping Name="C__MigrationHistory">
<EntityTypeMapping TypeName="AuthorityDBModel.C__MigrationHistory">
<MappingFragment StoreEntitySet="__MigrationHistory">
<ScalarProperty Name="MigrationId" ColumnName="MigrationId" />
<ScalarProperty Name="ContextKey" ColumnName="ContextKey" />
<ScalarProperty Name="Model" ColumnName="Model" />
<ScalarProperty Name="ProductVersion" ColumnName="ProductVersion" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="AppAutho">
<EntityTypeMapping TypeName="AuthorityDBModel.AppAutho">
<MappingFragment StoreEntitySet="AppAutho">
<ScalarProperty Name="AppId" ColumnName="AppId" />
<ScalarProperty Name="AuthorityId" ColumnName="AuthorityId" />
<ScalarProperty Name="Id" ColumnName="Id" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="CreatedBy" ColumnName="CreatedBy" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="Authority">
<EntityTypeMapping TypeName="AuthorityDBModel.Authority">
<MappingFragment StoreEntitySet="Authority">
<ScalarProperty Name="AuthoStatusTypeId" ColumnName="AuthoStatusTypeId" />
<ScalarProperty Name="Id" ColumnName="Id" />
<ScalarProperty Name="AuthorityName" ColumnName="AuthorityName" />
<ScalarProperty Name="Desc" ColumnName="Desc" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="CreatedBy" ColumnName="CreatedBy" />
<ScalarProperty Name="IsValid" ColumnName="IsValid" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="AuthoStatusType">
<EntityTypeMapping TypeName="AuthorityDBModel.AuthoStatusType">
<MappingFragment StoreEntitySet="AuthoStatusType">
<ScalarProperty Name="Id" ColumnName="Id" />
<ScalarProperty Name="Name" ColumnName="Name" />
<ScalarProperty Name="Desc" ColumnName="Desc" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="CreatedBy" ColumnName="CreatedBy" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="DbLog">
<EntityTypeMapping TypeName="AuthorityDBModel.DbLog">
<MappingFragment StoreEntitySet="DbLog">
<ScalarProperty Name="Id" ColumnName="Id" />
<ScalarProperty Name="Content" ColumnName="Content" />
<ScalarProperty Name="Uid" ColumnName="Uid" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="Type" ColumnName="Type" />
<ScalarProperty Name="Ip" ColumnName="Ip" />
<ScalarProperty Name="Client" ColumnName="Client" />
<ScalarProperty Name="location" ColumnName="location" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="Hosts">
<EntityTypeMapping TypeName="AuthorityDBModel.Hosts">
<MappingFragment StoreEntitySet="Hosts">
<ScalarProperty Name="Id" ColumnName="Id" />
<ScalarProperty Name="HotelID" ColumnName="HotelID" />
<ScalarProperty Name="RoomNumber" ColumnName="RoomNumber" />
<ScalarProperty Name="Status" ColumnName="Status" />
<ScalarProperty Name="Desc" ColumnName="Desc" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="RoomStatusID" ColumnName="RoomStatusID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="HotelGroups">
<EntityTypeMapping TypeName="AuthorityDBModel.HotelGroups">
<MappingFragment StoreEntitySet="HotelGroups">
<ScalarProperty Name="Id" ColumnName="Id" />
<ScalarProperty Name="Name" ColumnName="Name" />
<ScalarProperty Name="ParentId" ColumnName="ParentId" />
<ScalarProperty Name="Desc" ColumnName="Desc" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="OrgAuthority">
<EntityTypeMapping TypeName="AuthorityDBModel.OrgAuthority">
<MappingFragment StoreEntitySet="OrgAuthority">
<ScalarProperty Name="OrgId" ColumnName="OrgId" />
<ScalarProperty Name="AuthorityId" ColumnName="AuthorityId" />
<ScalarProperty Name="HotelId" ColumnName="HotelId" />
<ScalarProperty Name="Id" ColumnName="Id" />
<ScalarProperty Name="AuthotypeId" ColumnName="AuthotypeId" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="CreatedBy" ColumnName="CreatedBy" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_Multilingual">
<EntityTypeMapping TypeName="AuthorityDBModel.TBL_Multilingual">
<MappingFragment StoreEntitySet="TBL_Multilingual">
<ScalarProperty Name="ID" ColumnName="ID" />
<ScalarProperty Name="Language" ColumnName="Language" />
<ScalarProperty Name="ApplicationID" ColumnName="ApplicationID" />
<ScalarProperty Name="Version" ColumnName="Version" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_RCU_InfraredPacket">
<EntityTypeMapping TypeName="AuthorityDBModel.TBL_RCU_InfraredPacket">
<MappingFragment StoreEntitySet="TBL_RCU_InfraredPacket">
<ScalarProperty Name="ID" ColumnName="ID" />
<ScalarProperty Name="Type" ColumnName="Type" />
<ScalarProperty Name="Brand" ColumnName="Brand" />
<ScalarProperty Name="Model" ColumnName="Model" />
<ScalarProperty Name="Version" ColumnName="Version" />
<ScalarProperty Name="CreateDate" ColumnName="CreateDate" />
<ScalarProperty Name="PacketName" ColumnName="PacketName" />
<ScalarProperty Name="PacketData" ColumnName="PacketData" />
<ScalarProperty Name="PacketMD5" ColumnName="PacketMD5" />
<ScalarProperty Name="Remark" ColumnName="Remark" />
<ScalarProperty Name="OldPacket" ColumnName="OldPacket" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="UserAuthoes">
<EntityTypeMapping TypeName="AuthorityDBModel.UserAuthoes">
<MappingFragment StoreEntitySet="UserAuthoes">
<ScalarProperty Name="UserId" ColumnName="UserId" />
<ScalarProperty Name="AuthorityId" ColumnName="AuthorityId" />
<ScalarProperty Name="HotelId" ColumnName="HotelId" />
<ScalarProperty Name="Id" ColumnName="Id" />
<ScalarProperty Name="AuthotypeId" ColumnName="AuthotypeId" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="CreatedBy" ColumnName="CreatedBy" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="UserLog">
<EntityTypeMapping TypeName="AuthorityDBModel.UserLog">
<MappingFragment StoreEntitySet="UserLog">
<ScalarProperty Name="ID" ColumnName="ID" />
<ScalarProperty Name="Name" ColumnName="Name" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_MultilingualApps">
<EntityTypeMapping TypeName="AuthorityDBModel.TBL_MultilingualApps">
<MappingFragment StoreEntitySet="TBL_MultilingualApps">
<ScalarProperty Name="ID" ColumnName="ID" />
<ScalarProperty Name="Application" ColumnName="Application" />
<ScalarProperty Name="Remark" ColumnName="Remark" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_MultilingualData">
<EntityTypeMapping TypeName="AuthorityDBModel.TBL_MultilingualData">
<MappingFragment StoreEntitySet="TBL_MultilingualData">
<ScalarProperty Name="ID" ColumnName="ID" />
<ScalarProperty Name="中文" ColumnName="中文" />
<ScalarProperty Name="English" ColumnName="English" />
<ScalarProperty Name="ApplicationID" ColumnName="ApplicationID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="Hotels">
<EntityTypeMapping TypeName="AuthorityDBModel.Hotels">
<MappingFragment StoreEntitySet="Hotels">
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="IsApprove" ColumnName="IsApprove" />
<ScalarProperty Name="Status" ColumnName="Status" />
<ScalarProperty Name="Code" ColumnName="Code" />
<ScalarProperty Name="GroupId" ColumnName="GroupId" />
<ScalarProperty Name="Desc" ColumnName="Desc" />
<ScalarProperty Name="Name" ColumnName="Name" />
<ScalarProperty Name="Id" ColumnName="Id" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="UserInfo">
<EntityTypeMapping TypeName="AuthorityDBModel.UserInfo">
<MappingFragment StoreEntitySet="UserInfo">
<ScalarProperty Name="Autho" ColumnName="Autho" />
<ScalarProperty Name="EndTime" ColumnName="EndTime" />
<ScalarProperty Name="OldId" ColumnName="OldId" />
<ScalarProperty Name="Company" ColumnName="Company" />
<ScalarProperty Name="IsImport" ColumnName="IsImport" />
<ScalarProperty Name="HotelGroupID" ColumnName="HotelGroupID" />
<ScalarProperty Name="HotelID" ColumnName="HotelID" />
<ScalarProperty Name="CreatedBy" ColumnName="CreatedBy" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="Desc" ColumnName="Desc" />
<ScalarProperty Name="IsValid" ColumnName="IsValid" />
<ScalarProperty Name="Age" ColumnName="Age" />
<ScalarProperty Name="Sex" ColumnName="Sex" />
<ScalarProperty Name="HeadImg" ColumnName="HeadImg" />
<ScalarProperty Name="PwdSee" ColumnName="PwdSee" />
<ScalarProperty Name="Pwd" ColumnName="Pwd" />
<ScalarProperty Name="Uid" ColumnName="Uid" />
<ScalarProperty Name="Id" ColumnName="Id" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
</EntityContainerMapping>
</Mapping>
</edmx:Mappings>
</edmx:Runtime>
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
<Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
<Connection>
<DesignerInfoPropertySet>
<DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
</DesignerInfoPropertySet>
</Connection>
<Options>
<DesignerInfoPropertySet>
<DesignerProperty Name="ValidateOnBuild" Value="true" />
<DesignerProperty Name="EnablePluralization" Value="false" />
<DesignerProperty Name="IncludeForeignKeysInModel" Value="true" />
<DesignerProperty Name="UseLegacyProvider" Value="false" />
<DesignerProperty Name="CodeGenerationStrategy" Value="无" />
</DesignerInfoPropertySet>
</Options>
<!-- Diagram content (shape and connector positions) -->
<Diagrams></Diagrams>
</Designer>
</edmx:Edmx>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
<edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
<!-- Diagram content (shape and connector positions) -->
<edmx:Diagrams>
<Diagram DiagramId="dc5d5efeb81f4fddb821e356e7ef394a" Name="Diagram1">
<EntityTypeShape EntityType="AuthorityDBModel.C__MigrationHistory" Width="1.5" PointX="5.75" PointY="0.875" IsExpanded="true" />
<EntityTypeShape EntityType="AuthorityDBModel.AppAutho" Width="1.5" PointX="3" PointY="5" IsExpanded="true" />
<EntityTypeShape EntityType="AuthorityDBModel.Authority" Width="1.5" PointX="0.75" PointY="4.875" IsExpanded="true" />
<EntityTypeShape EntityType="AuthorityDBModel.AuthoStatusType" Width="1.5" PointX="0.75" PointY="1.25" IsExpanded="true" />
<EntityTypeShape EntityType="AuthorityDBModel.DbLog" Width="1.5" PointX="7.75" PointY="0.875" IsExpanded="true" />
<EntityTypeShape EntityType="AuthorityDBModel.Hosts" Width="1.5" PointX="8.75" PointY="4.875" IsExpanded="true" />
<EntityTypeShape EntityType="AuthorityDBModel.HotelGroups" Width="1.5" PointX="8.75" PointY="8.875" IsExpanded="true" />
<EntityTypeShape EntityType="AuthorityDBModel.OrgAuthority" Width="1.5" PointX="6" PointY="4.75" IsExpanded="true" />
<EntityTypeShape EntityType="AuthorityDBModel.TBL_Multilingual" Width="1.5" PointX="10.75" PointY="4.875" IsExpanded="true" />
<EntityTypeShape EntityType="AuthorityDBModel.TBL_RCU_InfraredPacket" Width="1.5" PointX="10.75" PointY="7.875" IsExpanded="true" />
<EntityTypeShape EntityType="AuthorityDBModel.UserAuthoes" Width="1.5" PointX="3" PointY="0.75" IsExpanded="true" />
<EntityTypeShape EntityType="AuthorityDBModel.UserLog" Width="1.5" PointX="11.75" PointY="0.875" IsExpanded="true" />
<EntityTypeShape EntityType="AuthorityDBModel.TBL_MultilingualApps" Width="1.5" PointX="8.75" PointY="11.875" IsExpanded="true" />
<EntityTypeShape EntityType="AuthorityDBModel.TBL_MultilingualData" Width="1.5" PointX="10.75" PointY="11.875" IsExpanded="true" />
<AssociationConnector Association="AuthorityDBModel.FK_dbo_AppAutho_dbo_Authority_AuthorityId" ManuallyRouted="false" />
<AssociationConnector Association="AuthorityDBModel.FK_dbo_OrgAuthority_dbo_Authority_AuthorityId" ManuallyRouted="false" />
<AssociationConnector Association="AuthorityDBModel.FK_dbo_UserAuthoes_dbo_Authority_AuthorityId" ManuallyRouted="false" />
<AssociationConnector Association="AuthorityDBModel.FK_dbo_OrgAuthority_dbo_AuthoStatusType_AuthotypeId" ManuallyRouted="false" />
<AssociationConnector Association="AuthorityDBModel.FK_dbo_UserAuthoes_dbo_AuthoStatusType_AuthotypeId" ManuallyRouted="false" />
<EntityTypeShape EntityType="AuthorityDBModel.Hotels" Width="1.5" PointX="13.375" PointY="3.75" />
<EntityTypeShape EntityType="AuthorityDBModel.UserInfo" Width="1.5" PointX="0.75" PointY="9" />
<AssociationConnector Association="AuthorityDBModel.FK_dbo_UserAuthoes_dbo_UserInfo_UserId" />
</Diagram>
</edmx:Diagrams>
</edmx:Designer>
</edmx:Edmx>

View File

@@ -0,0 +1,733 @@
<#@ template language="C#" debug="false" hostspecific="true"#>
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
output extension=".cs"#><#
const string inputFile = @"AuthorityDBModel.edmx";
var textTransform = DynamicTextTransformation.Create(this);
var code = new CodeGenerationTools(this);
var ef = new MetadataTools(this);
var typeMapper = new TypeMapper(code, ef, textTransform.Errors);
var fileManager = EntityFrameworkTemplateFileManager.Create(this);
var itemCollection = new EdmMetadataLoader(textTransform.Host, textTransform.Errors).CreateEdmItemCollection(inputFile);
var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef);
if (!typeMapper.VerifyCaseInsensitiveTypeUniqueness(typeMapper.GetAllGlobalItems(itemCollection), inputFile))
{
return string.Empty;
}
WriteHeader(codeStringGenerator, fileManager);
foreach (var entity in typeMapper.GetItemsToGenerate<EntityType>(itemCollection))
{
fileManager.StartNewFile(entity.Name + ".cs");
BeginNamespace(code);
#>
<#=codeStringGenerator.UsingDirectives(inHeader: false)#>
<#=codeStringGenerator.EntityClassOpening(entity)#>
{
<#
var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(entity);
var collectionNavigationProperties = typeMapper.GetCollectionNavigationProperties(entity);
var complexProperties = typeMapper.GetComplexProperties(entity);
if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any())
{
#>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public <#=code.Escape(entity)#>()
{
<#
foreach (var edmProperty in propertiesWithDefaultValues)
{
#>
this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>;
<#
}
foreach (var navigationProperty in collectionNavigationProperties)
{
#>
this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType())#>>();
<#
}
foreach (var complexProperty in complexProperties)
{
#>
this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>();
<#
}
#>
}
<#
}
var simpleProperties = typeMapper.GetSimpleProperties(entity);
if (simpleProperties.Any())
{
foreach (var edmProperty in simpleProperties)
{
#>
<#=codeStringGenerator.Property(edmProperty)#>
<#
}
}
if (complexProperties.Any())
{
#>
<#
foreach(var complexProperty in complexProperties)
{
#>
<#=codeStringGenerator.Property(complexProperty)#>
<#
}
}
var navigationProperties = typeMapper.GetNavigationProperties(entity);
if (navigationProperties.Any())
{
#>
<#
foreach (var navigationProperty in navigationProperties)
{
if (navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many)
{
#>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
<#
}
#>
<#=codeStringGenerator.NavigationProperty(navigationProperty)#>
<#
}
}
#>
}
<#
EndNamespace(code);
}
foreach (var complex in typeMapper.GetItemsToGenerate<ComplexType>(itemCollection))
{
fileManager.StartNewFile(complex.Name + ".cs");
BeginNamespace(code);
#>
<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#>
<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#>
{
<#
var complexProperties = typeMapper.GetComplexProperties(complex);
var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(complex);
if (propertiesWithDefaultValues.Any() || complexProperties.Any())
{
#>
public <#=code.Escape(complex)#>()
{
<#
foreach (var edmProperty in propertiesWithDefaultValues)
{
#>
this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>;
<#
}
foreach (var complexProperty in complexProperties)
{
#>
this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>();
<#
}
#>
}
<#
}
var simpleProperties = typeMapper.GetSimpleProperties(complex);
if (simpleProperties.Any())
{
foreach(var edmProperty in simpleProperties)
{
#>
<#=codeStringGenerator.Property(edmProperty)#>
<#
}
}
if (complexProperties.Any())
{
#>
<#
foreach(var edmProperty in complexProperties)
{
#>
<#=codeStringGenerator.Property(edmProperty)#>
<#
}
}
#>
}
<#
EndNamespace(code);
}
foreach (var enumType in typeMapper.GetEnumItemsToGenerate(itemCollection))
{
fileManager.StartNewFile(enumType.Name + ".cs");
BeginNamespace(code);
#>
<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#>
<#
if (typeMapper.EnumIsFlags(enumType))
{
#>
[Flags]
<#
}
#>
<#=codeStringGenerator.EnumOpening(enumType)#>
{
<#
var foundOne = false;
foreach (MetadataItem member in typeMapper.GetEnumMembers(enumType))
{
foundOne = true;
#>
<#=code.Escape(typeMapper.GetEnumMemberName(member))#> = <#=typeMapper.GetEnumMemberValue(member)#>,
<#
}
if (foundOne)
{
this.GenerationEnvironment.Remove(this.GenerationEnvironment.Length - 3, 1);
}
#>
}
<#
EndNamespace(code);
}
fileManager.Process();
#>
<#+
public void WriteHeader(CodeStringGenerator codeStringGenerator, EntityFrameworkTemplateFileManager fileManager)
{
fileManager.StartHeader();
#>
//------------------------------------------------------------------------------
// <auto-generated>
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#>
//
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#>
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#>
// </auto-generated>
//------------------------------------------------------------------------------
<#=codeStringGenerator.UsingDirectives(inHeader: true)#>
<#+
fileManager.EndBlock();
}
public void BeginNamespace(CodeGenerationTools code)
{
var codeNamespace = code.VsNamespaceSuggestion();
if (!String.IsNullOrEmpty(codeNamespace))
{
#>
namespace <#=code.EscapeNamespace(codeNamespace)#>
{
<#+
PushIndent(" ");
}
}
public void EndNamespace(CodeGenerationTools code)
{
if (!String.IsNullOrEmpty(code.VsNamespaceSuggestion()))
{
PopIndent();
#>
}
<#+
}
}
public const string TemplateId = "CSharp_DbContext_Types_EF6";
public class CodeStringGenerator
{
private readonly CodeGenerationTools _code;
private readonly TypeMapper _typeMapper;
private readonly MetadataTools _ef;
public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef)
{
ArgumentNotNull(code, "code");
ArgumentNotNull(typeMapper, "typeMapper");
ArgumentNotNull(ef, "ef");
_code = code;
_typeMapper = typeMapper;
_ef = ef;
}
public string Property(EdmProperty edmProperty)
{
return string.Format(
CultureInfo.InvariantCulture,
"{0} {1} {2} {{ {3}get; {4}set; }}",
Accessibility.ForProperty(edmProperty),
_typeMapper.GetTypeName(edmProperty.TypeUsage),
_code.Escape(edmProperty),
_code.SpaceAfter(Accessibility.ForGetter(edmProperty)),
_code.SpaceAfter(Accessibility.ForSetter(edmProperty)));
}
public string NavigationProperty(NavigationProperty navProp)
{
var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType());
return string.Format(
CultureInfo.InvariantCulture,
"{0} {1} {2} {{ {3}get; {4}set; }}",
AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)),
navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType,
_code.Escape(navProp),
_code.SpaceAfter(Accessibility.ForGetter(navProp)),
_code.SpaceAfter(Accessibility.ForSetter(navProp)));
}
public string AccessibilityAndVirtual(string accessibility)
{
return accessibility + (accessibility != "private" ? " virtual" : "");
}
public string EntityClassOpening(EntityType entity)
{
return string.Format(
CultureInfo.InvariantCulture,
"{0} {1}partial class {2}{3}",
Accessibility.ForType(entity),
_code.SpaceAfter(_code.AbstractOption(entity)),
_code.Escape(entity),
_code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType)));
}
public string EnumOpening(SimpleType enumType)
{
return string.Format(
CultureInfo.InvariantCulture,
"{0} enum {1} : {2}",
Accessibility.ForType(enumType),
_code.Escape(enumType),
_code.Escape(_typeMapper.UnderlyingClrType(enumType)));
}
public void WriteFunctionParameters(EdmFunction edmFunction, Action<string, string, string, string> writeParameter)
{
var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable))
{
var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null";
var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")";
var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))";
writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit);
}
}
public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace)
{
var parameters = _typeMapper.GetParameters(edmFunction);
return string.Format(
CultureInfo.InvariantCulture,
"{0} IQueryable<{1}> {2}({3})",
AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
_typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
_code.Escape(edmFunction),
string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()));
}
public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace)
{
var parameters = _typeMapper.GetParameters(edmFunction);
return string.Format(
CultureInfo.InvariantCulture,
"return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});",
_typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
edmFunction.NamespaceName,
edmFunction.Name,
string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()),
_code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())));
}
public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
{
var parameters = _typeMapper.GetParameters(edmFunction);
var returnType = _typeMapper.GetReturnType(edmFunction);
var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray());
if (includeMergeOption)
{
paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption";
}
return string.Format(
CultureInfo.InvariantCulture,
"{0} {1} {2}({3})",
AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
_code.Escape(edmFunction),
paramList);
}
public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
{
var parameters = _typeMapper.GetParameters(edmFunction);
var returnType = _typeMapper.GetReturnType(edmFunction);
var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()));
if (includeMergeOption)
{
callParams = ", mergeOption" + callParams;
}
return string.Format(
CultureInfo.InvariantCulture,
"return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});",
returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
edmFunction.Name,
callParams);
}
public string DbSet(EntitySet entitySet)
{
return string.Format(
CultureInfo.InvariantCulture,
"{0} virtual DbSet<{1}> {2} {{ get; set; }}",
Accessibility.ForReadOnlyProperty(entitySet),
_typeMapper.GetTypeName(entitySet.ElementType),
_code.Escape(entitySet));
}
public string UsingDirectives(bool inHeader, bool includeCollections = true)
{
return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion())
? string.Format(
CultureInfo.InvariantCulture,
"{0}using System;{1}" +
"{2}",
inHeader ? Environment.NewLine : "",
includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "",
inHeader ? "" : Environment.NewLine)
: "";
}
}
public class TypeMapper
{
private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName";
private readonly System.Collections.IList _errors;
private readonly CodeGenerationTools _code;
private readonly MetadataTools _ef;
public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors)
{
ArgumentNotNull(code, "code");
ArgumentNotNull(ef, "ef");
ArgumentNotNull(errors, "errors");
_code = code;
_ef = ef;
_errors = errors;
}
public static string FixNamespaces(string typeName)
{
return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial.");
}
public string GetTypeName(TypeUsage typeUsage)
{
return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null);
}
public string GetTypeName(EdmType edmType)
{
return GetTypeName(edmType, isNullable: null, modelNamespace: null);
}
public string GetTypeName(TypeUsage typeUsage, string modelNamespace)
{
return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace);
}
public string GetTypeName(EdmType edmType, string modelNamespace)
{
return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace);
}
public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace)
{
if (edmType == null)
{
return null;
}
var collectionType = edmType as CollectionType;
if (collectionType != null)
{
return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace));
}
var typeName = _code.Escape(edmType.MetadataProperties
.Where(p => p.Name == ExternalTypeNameAttributeName)
.Select(p => (string)p.Value)
.FirstOrDefault())
?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ?
_code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) :
_code.Escape(edmType));
if (edmType is StructuralType)
{
return typeName;
}
if (edmType is SimpleType)
{
var clrType = UnderlyingClrType(edmType);
if (!IsEnumType(edmType))
{
typeName = _code.Escape(clrType);
}
typeName = FixNamespaces(typeName);
return clrType.IsValueType && isNullable == true ?
String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) :
typeName;
}
throw new ArgumentException("edmType");
}
public Type UnderlyingClrType(EdmType edmType)
{
ArgumentNotNull(edmType, "edmType");
var primitiveType = edmType as PrimitiveType;
if (primitiveType != null)
{
return primitiveType.ClrEquivalentType;
}
if (IsEnumType(edmType))
{
return GetEnumUnderlyingType(edmType).ClrEquivalentType;
}
return typeof(object);
}
public object GetEnumMemberValue(MetadataItem enumMember)
{
ArgumentNotNull(enumMember, "enumMember");
var valueProperty = enumMember.GetType().GetProperty("Value");
return valueProperty == null ? null : valueProperty.GetValue(enumMember, null);
}
public string GetEnumMemberName(MetadataItem enumMember)
{
ArgumentNotNull(enumMember, "enumMember");
var nameProperty = enumMember.GetType().GetProperty("Name");
return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null);
}
public System.Collections.IEnumerable GetEnumMembers(EdmType enumType)
{
ArgumentNotNull(enumType, "enumType");
var membersProperty = enumType.GetType().GetProperty("Members");
return membersProperty != null
? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null)
: Enumerable.Empty<MetadataItem>();
}
public bool EnumIsFlags(EdmType enumType)
{
ArgumentNotNull(enumType, "enumType");
var isFlagsProperty = enumType.GetType().GetProperty("IsFlags");
return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null);
}
public bool IsEnumType(GlobalItem edmType)
{
ArgumentNotNull(edmType, "edmType");
return edmType.GetType().Name == "EnumType";
}
public PrimitiveType GetEnumUnderlyingType(EdmType enumType)
{
ArgumentNotNull(enumType, "enumType");
return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null);
}
public string CreateLiteral(object value)
{
if (value == null || value.GetType() != typeof(TimeSpan))
{
return _code.CreateLiteral(value);
}
return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks);
}
public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable<string> types, string sourceFile)
{
ArgumentNotNull(types, "types");
ArgumentNotNull(sourceFile, "sourceFile");
var hash = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
if (types.Any(item => !hash.Add(item)))
{
_errors.Add(
new CompilerError(sourceFile, -1, -1, "6023",
String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict"))));
return false;
}
return true;
}
public IEnumerable<SimpleType> GetEnumItemsToGenerate(IEnumerable<GlobalItem> itemCollection)
{
return GetItemsToGenerate<SimpleType>(itemCollection)
.Where(e => IsEnumType(e));
}
public IEnumerable<T> GetItemsToGenerate<T>(IEnumerable<GlobalItem> itemCollection) where T: EdmType
{
return itemCollection
.OfType<T>()
.Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName))
.OrderBy(i => i.Name);
}
public IEnumerable<string> GetAllGlobalItems(IEnumerable<GlobalItem> itemCollection)
{
return itemCollection
.Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i))
.Select(g => GetGlobalItemName(g));
}
public string GetGlobalItemName(GlobalItem item)
{
if (item is EdmType)
{
return ((EdmType)item).Name;
}
else
{
return ((EntityContainer)item).Name;
}
}
public IEnumerable<EdmProperty> GetSimpleProperties(EntityType type)
{
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
}
public IEnumerable<EdmProperty> GetSimpleProperties(ComplexType type)
{
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
}
public IEnumerable<EdmProperty> GetComplexProperties(EntityType type)
{
return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
}
public IEnumerable<EdmProperty> GetComplexProperties(ComplexType type)
{
return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
}
public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(EntityType type)
{
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
}
public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(ComplexType type)
{
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
}
public IEnumerable<NavigationProperty> GetNavigationProperties(EntityType type)
{
return type.NavigationProperties.Where(np => np.DeclaringType == type);
}
public IEnumerable<NavigationProperty> GetCollectionNavigationProperties(EntityType type)
{
return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many);
}
public FunctionParameter GetReturnParameter(EdmFunction edmFunction)
{
ArgumentNotNull(edmFunction, "edmFunction");
var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters");
return returnParamsProperty == null
? edmFunction.ReturnParameter
: ((IEnumerable<FunctionParameter>)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault();
}
public bool IsComposable(EdmFunction edmFunction)
{
ArgumentNotNull(edmFunction, "edmFunction");
var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute");
return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null);
}
public IEnumerable<FunctionImportParameter> GetParameters(EdmFunction edmFunction)
{
return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
}
public TypeUsage GetReturnType(EdmFunction edmFunction)
{
var returnParam = GetReturnParameter(edmFunction);
return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage);
}
public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption)
{
var returnType = GetReturnType(edmFunction);
return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType;
}
}
public static void ArgumentNotNull<T>(T arg, string name) where T : class
{
if (arg == null)
{
throw new ArgumentNullException(name);
}
}
#>

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Face.Domain.Entities
{
using System;
using System.Collections.Generic;
public partial class C__MigrationHistory
{
public string MigrationId { get; set; }
public string ContextKey { get; set; }
public byte[] Model { get; set; }
public string ProductVersion { get; set; }
}
}

View File

@@ -0,0 +1,29 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Face.Domain.Entities
{
using System;
using System.Collections.Generic;
public partial class CheckInInfo
{
public int id { get; set; }
public string Name { get; set; }
public string IdNumber { get; set; }
public Nullable<System.DateTime> CreationTime { get; set; }
public int InfoSource { get; set; }
public Nullable<int> HotelCode { get; set; }
public Nullable<int> Roomid { get; set; }
public Nullable<System.DateTime> CheckTime { get; set; }
public Nullable<System.DateTime> checkOutTime { get; set; }
public string picture { get; set; }
public string identitys { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Face.Domain.Entities
{
using System;
using System.Collections.Generic;
public partial class CheckinTest
{
public int id { get; set; }
public Nullable<int> testState { get; set; }
public Nullable<System.DateTime> predictCheckIn { get; set; }
public Nullable<System.DateTime> creationTime { get; set; }
public Nullable<int> checkInduration { get; set; }
public Nullable<int> hotelid { get; set; }
public Nullable<int> Roomid { get; set; }
public Nullable<System.DateTime> CheckoutTime { get; set; }
}
}

View File

@@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Face.Domain.Entities
{
using System;
using System.Collections.Generic;
public partial class Dailyoperation
{
public int id { get; set; }
public string Uname { get; set; }
public System.DateTime Creationtime { get; set; }
public string operatetype { get; set; }
public string operatedata { get; set; }
public int hotelCode { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Face.Domain.Entities
{
using System;
using System.Collections.Generic;
public partial class DbLog
{
public int Id { get; set; }
public string Content { get; set; }
public string Uid { get; set; }
public System.DateTime CreateTime { get; set; }
public int Type { get; set; }
public string Ip { get; set; }
public string Client { get; set; }
public string location { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Face.Domain.Entities
{
using System;
using System.Collections.Generic;
public partial class DeviceManage
{
public int Facelid { get; set; }
public string SerialNo { get; set; }
public Nullable<System.DateTime> CreatedDate { get; set; }
public string HotelCode { get; set; }
public Nullable<int> RoomId { get; set; }
public string Factory { get; set; }
public bool Status { get; set; }
public Nullable<System.DateTime> bindingDate { get; set; }
public bool bindingStatus { get; set; }
public string faceIp { get; set; }
public string faceAddress { get; set; }
public Nullable<int> maintainStatus { get; set; }
public string APKVersion { get; set; }
}
}

Some files were not shown because too many files have changed in this diff Show More