初始化项目

This commit is contained in:
2025-11-20 13:11:05 +08:00
commit d5edc62c08
2412 changed files with 2201918 additions and 0 deletions

14
.gitignore vendored Normal file
View File

@@ -0,0 +1,14 @@
#Visual Studio cache files
.vs/
# Build results
[Dd]ebug/
[Rr]elease/
# log file
AUTS.Web/App_Data/UDPLog/
AUTS.Web/App_Data/TimingPlan/
AUTS.Web/App_Data/Log/
AUTS.Web/Upload/
/AUTS.Web/bin
/AUTS.Web/bin

80
AUTS-DATA.sln Normal file
View File

@@ -0,0 +1,80 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32519.379
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("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AUTS.Domain", "AUTS.Domain\AUTS.Domain.csproj", "{709AA98F-388F-44DD-B64B-AD44E695C34C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AUTS.Domain.ViewModels", "AUTS.Domain.ViewModels\AUTS.Domain.ViewModels.csproj", "{BE790400-C1EE-4D97-B3F1-604F6831E5E7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AUTS.Web", "AUTS.Web\AUTS.Web.csproj", "{831A25A4-DAEC-43D6-8D24-DEC6DDA196DD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{1AC3773A-D26E-4C04-BE74-AA99B52484B0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AUTS.Services", "AUTS.Services\AUTS.Services.csproj", "{56438F1C-BA3A-4272-964E-C6739AE0B4EC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Infrastructure", "Infrastructure", "{FB2DB0B0-8434-4E32-AA55-0CAF2E6AA0FE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AUTS.Log4Net", "AUTS.Log4Net\AUTS.Log4Net.csproj", "{5500F9DD-89D9-40F3-B62F-90C6B633D55A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AUTS.SystemTask", "AUTS.SystemTask\AUTS.SystemTask.csproj", "{5CEB682A-8023-4F08-B89D-7216B7BAAA03}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WindowsService", "WindowsService", "{3ECF681B-93F4-4059-9D38-BA9958420572}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AUTS.WindowsService", "AUTS.WindowsService\AUTS.WindowsService.csproj", "{A9F6DA6D-65AD-4DA4-8097-7FBEBC710DF3}"
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
{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
{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
{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
{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
{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
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}
{831A25A4-DAEC-43D6-8D24-DEC6DDA196DD} = {52D25030-5B02-42A5-A203-1EA154428687}
{56438F1C-BA3A-4272-964E-C6739AE0B4EC} = {1AC3773A-D26E-4C04-BE74-AA99B52484B0}
{5500F9DD-89D9-40F3-B62F-90C6B633D55A} = {FB2DB0B0-8434-4E32-AA55-0CAF2E6AA0FE}
{5CEB682A-8023-4F08-B89D-7216B7BAAA03} = {1AC3773A-D26E-4C04-BE74-AA99B52484B0}
{A9F6DA6D-65AD-4DA4-8097-7FBEBC710DF3} = {3ECF681B-93F4-4059-9D38-BA9958420572}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A76CFBB4-9623-471D-B8E7-0777C6B6DD83}
EndGlobalSection
EndGlobal

10
AUTS-DATA.vssscc Normal file
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" = "PROJECT"
}

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"
}

22
AUTS.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,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,147 @@
<?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>AUTS.Domain.ViewModels</RootNamespace>
<AssemblyName>AUTS.Domain.ViewModels</AssemblyName>
<TargetFrameworkVersion>v4.8</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="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.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="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Transactions" />
<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="Auth\AuthManage.cs" />
<Compile Include="AutsChart\Node.cs" />
<Compile Include="AutsChart\RequestOrdersPlanned.cs" />
<Compile Include="AutsChart\RequestOrdersRealTime.cs" />
<Compile Include="AutsChart\RequestOrderStats.cs" />
<Compile Include="AutsChart\RequestStatsInProduc.cs" />
<Compile Include="AutsChart\VM_DevNestable.cs" />
<Compile Include="AutsChart\VM_OrderRealTimeStats.cs" />
<Compile Include="AutsChart\VM_TBL_OrderStats.cs" />
<Compile Include="AutsChart\VM_TreeNode.cs" />
<Compile Include="BasicFunc\OrderExcel.cs" />
<Compile Include="Capacity\ResponseEveryDaySearch.cs" />
<Compile Include="Capacity\VM_TBL_CapacityIndex.cs" />
<Compile Include="Capacity\VM_TBL_CapacityEveryDay.cs" />
<Compile Include="Capacity\RequestQAAjaxSearch.cs" />
<Compile Include="Capacity\RequestQALogSearch.cs" />
<Compile Include="Capacity\RequestQASubmit.cs" />
<Compile Include="Capacity\ResponseDataQuerySearch.cs" />
<Compile Include="Capacity\RequestCapacitySearch.cs" />
<Compile Include="Capacity\RequestTestLogSearch.cs" />
<Compile Include="Capacity\ResponseQAAjaxSearch.cs" />
<Compile Include="Capacity\ResponseQALogSearch.cs" />
<Compile Include="Capacity\ResponseQASubmit.cs" />
<Compile Include="Capacity\VM_TBL_ToDayCapacity.cs" />
<Compile Include="Home\VM_TodayData.cs" />
<Compile Include="Home\VM_TodayProduction.cs" />
<Compile Include="Order\VM_OrderInfo.cs" />
<Compile Include="Order\VM_OrderInfoOnMO.cs" />
<Compile Include="Order\VM_OrderInternalDetails.cs" />
<Compile Include="Order\VM_OrderInternalList.cs" />
<Compile Include="Order\VM_OrderList.cs" />
<Compile Include="Order\VM_OrderPlannedSpeed.cs" />
<Compile Include="OutputValue\RequestOVSearch.cs" />
<Compile Include="PPlan\VM_PPlanList.cs" />
<Compile Include="PPlan\VM_SnRulesList.cs" />
<Compile Include="PPlan\VM_TBL_PPlanInternalDetails.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="QueryCondition\Condition.cs" />
<Compile Include="ReturnResult.cs" />
<Compile Include="ReturnResults.cs" />
<Compile Include="User\ResultAddUserVM.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AUTS.Domain\AUTS.Domain.csproj">
<Project>{709aa98f-388f-44dd-b64b-ad44e695c34c}</Project>
<Name>AUTS.Domain</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.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,23 @@
using AUTS.Domain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.ViewModels.Auth
{
public class AuthManage
{
//public int ID { get; set; }
//public string ModuleID { get; set; }
//public string Describe { get; set; }
//public int UserID { get; set; }
//public string User { get; set; }
public List<TBL_UTS_Manage_AuthManage> AuthManages { get; set; }
public List<TBL_UTS_Manage_User> users { 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 AUTS.Domain.ViewModels.AutsChart
{
public class Node
{
public Node() { }
public Node(int id, string str, string img, List<Node> node, string color,string backgroundcolor ="")
{
nodeId = id;
text = str;
nodes = node;
icon = img;
this.color = color;
this.backColor = backgroundcolor;
}
public Node(int id, string str, List<Node> node, string color, string backgroundcolor = "")
{
nodeId = id;
text = str;
nodes = node;
this.color = color;
this.backColor = backgroundcolor;
}
public int nodeId { get; set; } //树的节点Id区别于数据库中保存的数据Id。若要存储数据库数据的Id添加新的Id属性若想为节点设置路径类中添加Path属性
public string text { get; set; } //节点名称
public string icon { get; set; }
public string color { get; set; }
public string backColor { get; set; }
public List<Node> nodes { 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 AUTS.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 AUTS.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 AUTS.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 AUTS.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 AUTS.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 AUTS.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 AUTS.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,66 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.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 string backColor { 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; }
public string backColor { get; set; }
}
}

View File

@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.ViewModels.BasicFunc
{
public class OrderExcel
{
public int Count { get; set; }
/// <summary>
/// PO号
/// </summary>
public string OrderNo { get; set; }
/// <summary>
/// MO号
/// </summary>
public string IOrderNo { get; set; }
/// <summary>
/// 客户
/// </summary>
public int CustomerAbbr { get; set; }
/// <summary>
/// 机型
/// </summary>
public string ProjectName { get; set; }
/// <summary>
/// 订单交期
/// </summary>
public string DeliveryTime { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTime { get; set; }
/// <summary>
/// 单价
/// </summary>
public decimal Price { get; set; }
/// <summary>
/// 出售单价
/// </summary>
public decimal SellingPrice { get; set; }
/// <summary>
/// 条码
/// </summary>
public string BarCode { get; set; }
/// <summary>
/// 订单状态
/// </summary>
public int Status { 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 AUTS.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 AUTS.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 AUTS.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 AUTS.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 AUTS.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 AUTS.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 AUTS.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 AUTS.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 AUTS.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 AUTS.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 AUTS.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 AUTS.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,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.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; }
public string StationDesc { 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 AUTS.Domain.ViewModels.Home
{
public class VM_TodayData
{
public int ProductID { get; set; }
public Dictionary<string, int> StaAndNum = new Dictionary<string, int>();
public string today { get; set; }
public int C1 { get; set; }
}
}

View File

@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.ViewModels.Home
{
public class VM_TodayProduction
{
/// <summary>
/// 今日目标
/// </summary>
public int ObjectiveYield { get; set; }
/// <summary>
/// 累计目标
/// </summary>
public int ObjectiveYieldTotal { get; set; }
/// <summary>
/// 站位
/// </summary>
public string StationName { get; set; }
/// <summary>
/// 机型名称
/// </summary>
public string projectName { get; set; }
/// <summary>
/// 订单号
/// </summary>
public string OInternalID { get; set; }
/// <summary>
/// 今日产能
/// </summary>
public int testLog { get; set; }
/// <summary>
/// 累计产能
/// </summary>
public int testLogTotal { get; set; }
/// <summary>
/// 比率
/// </summary>
public double ratio { get; set; }
/// <summary>
/// 今日
/// </summary>
public string today { get; set; }
/// <summary>
/// 机型描述
/// </summary>
public string describe { get; set; }
/// <summary>
/// 交期
/// </summary>
public string deliveryTime { get; set; }
/// <summary>
/// 数量
/// </summary>
public int number { get; set; }
/// <summary>
/// 客户
/// </summary>
public string Company { get; set; }
public string OrderStatus { get; set; }
/// <summary>
/// 站位数据
/// </summary>
public int[] CapacityNum { get; set; }
/// <summary>
/// 站位名
/// </summary>
public string[] StationNames { 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 AUTS.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 AUTS.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,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.ViewModels
{
/// <summary>
/// M/O信息/工艺站
/// </summary>
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 string StationList { get; set; }
/// <summary>
/// 订单交期
/// </summary>
public string DeliveryTime { get; set; }
/// <summary>
/// 客户
/// </summary>
public string Company { get; set; }
public List<Entities.TBL_Orders> OrdersList { get; set; }
public VM_OrderInfoOnMO OrderInfoOnMO { get; set; }
}
public class VM_OrderInternalStations
{
/// <summary>
/// 站位ID
/// </summary>
public int ID { get; set; }
/// <summary>
/// 工艺名
/// </summary>
public string StationName{ get; set; }
/// <summary>
/// 工艺说明
/// </summary>
public string StationDesc { get; set; }
}
}

View File

@@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.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>
/// 机型ID
/// </summary>
public int ProjectID { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTime { get; set; }
/// <summary>
/// 订单状态
/// </summary>
public string OrderStatus { get; set; }
/// <summary>
/// 工艺站
/// </summary>
public string StationList { 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 AUTS.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 AUTS.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 AUTS.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,113 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.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 ProductName { get; set; }
/// <summary>
/// 产线名称
/// </summary>
public string PLName { get; set; }
/// <summary>
/// 站位
/// </summary>
public string Station { 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 OStatus { get; set; }
/// <summary>
/// 交期时间
/// </summary>
public string DeliveryTime { get; set; }
public string CreateTime { get; set; }
public int OrderCount { get; set; }
}
}

View File

@@ -0,0 +1,120 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.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 AssemblySn { get; set; }
/// <summary>
/// 组合时间
/// </summary>
public string AssemblyTime { get; set; }
/// <summary>
/// 分配类型
/// </summary>
public string SnType { 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,130 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.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 int OrderCount { 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_StartEnd { 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; }
/// <summary>
/// M/O订单
/// </summary>
public int OrderInternalID { get; set; }
/// <summary>
/// P/O订单
/// </summary>
public int OrderID { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("AUTS.Domain.ViewModels")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AUTS.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,121 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.ViewModels.QueryCondition
{
/// <summary>
/// 查询数据需要的条件
/// </summary>
public class Condition
{
/// <summary>
/// 内部单ID
/// </summary>
public int OInteriorID { get; set; }
/// <summary>
/// 订单号
/// </summary>
public string OrderNo { get; set; }
/// <summary>
/// 机型
/// </summary>
public int ProjectID { get; set; }
public int ProductType { get; set; }
/// <summary>
/// 站位
/// </summary>
public int StationID { get; set; }
/// <summary>
/// 订单状态
/// </summary>
public int OStatus { get; set; }
/// <summary>
/// 客户
/// </summary>
public int CustomerAbbr { get; set; }
/// <summary>
/// 页数据最大
/// </summary>
public int dataMax { get; set; }
/// <summary>
/// 页数据最小
/// </summary>
public int dataMin { get; set; }
/// <summary>
/// 页
/// </summary>
public int Pages { get; set; }
/// <summary>
/// 属性
/// </summary>
public string Property { get; set; }
/// <summary>
/// 输入搜索
/// </summary>
public string Search { get; set; }
/// <summary>
/// 起
/// </summary>
public string startTime { get; set; }
/// <summary>
/// 始
/// </summary>
public string EndTime { get; set; }
/// <summary>
/// 勾选的 站点结果状态 1 pass true 2 false
/// </summary>
public int[] ZTstatus { get; set; }
/// <summary>
/// 站点
/// </summary>
public int ZTID { get; set; } = 0;
/// <summary>
/// 不良品来源
/// </summary>
public string company { get; set; }
public string inquire { get; set; }
/// <summary>
/// SN号
/// </summary>
public string Snmark { get; set; }
/// <summary>
/// 今天,三天,7天,30天
/// </summary>
public int Day { get; set; }
/// <summary>
/// 返修类型
/// </summary>
public int repair { get; set; }
/// <summary>
/// 失败代码
/// </summary>
public string FailSteps { 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 AUTS.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,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.ViewModels
{
public class ReturnResults
{
public int Status { get; set; }
public string Message { get; set; }
public string ColorBox_BarCode { get; set; }
}
public class ReturnResults<TData> : ReturnResult
{
public TData Data { get; set; }
}
public class ColorBarPair
{
public string ColorBox;
public string BarCode;
}
public class ReturnResultsOutBox
{
public int Status { get; set; }
public string Message { get; set; }
public int ProjectID { get; set; }
public string OutBoxCode { get; set; }
public string ShippingCode { get; set; }
public List<string> ColorBoxList { get; set; }
public List<string> BarcodeList { get; set; }
public List<ColorBarPair> CorBarPairList { 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 AUTS.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,36 @@
<?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-6.9.12.0" newVersion="6.9.12.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /></startup><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,15 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Google.Protobuf" version="3.21.9" targetFramework="net48" />
<package id="K4os.Compression.LZ4" version="1.3.5" targetFramework="net48" />
<package id="K4os.Compression.LZ4.Streams" version="1.3.5" targetFramework="net48" />
<package id="K4os.Hash.xxHash" version="1.0.8" targetFramework="net48" />
<package id="MySql.Data" version="6.9.12" targetFramework="net48" />
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net461" />
<package id="System.Buffers" version="4.5.1" targetFramework="net461" />
<package id="System.IO.Pipelines" version="5.0.2" targetFramework="net48" />
<package id="System.Memory" version="4.5.5" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
</packages>

View File

@@ -0,0 +1,343 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
<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>{709AA98F-388F-44DD-B64B-AD44E695C34C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AUTS.Domain</RootNamespace>
<AssemblyName>AUTS.Domain</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<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="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.4.4\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.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.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.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.Entity.6.9.11\lib\net45\MySql.Data.Entity.EF6.dll</HintPath>
</Reference>
<Reference Include="Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
<HintPath>..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll</HintPath>
</Reference>
<Reference Include="SqlSugar, Version=5.1.2.7, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SqlSugar.5.1.2.7\lib\SqlSugar.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Design" />
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Transactions" />
<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="Application\DBCofinStrModel.cs" />
<Compile Include="Application\OInternalNumber.cs" />
<Compile Include="Application\NurseScheduleStatisticsModel.cs" />
<Compile Include="Application\OutputValue.cs" />
<Compile Include="Application\RepairReason.cs" />
<Compile Include="Application\Sys_Currency.cs" />
<Compile Include="Application\TBL_ColorBoxList.cs" />
<Compile Include="Application\TBL_ImportInfo.cs" />
<Compile Include="Application\TBL_ImportinfoLog.cs" />
<Compile Include="Application\TBL_importinfo_log.cs" />
<Compile Include="Application\TBL_Process.cs" />
<Compile Include="Application\TBL_QA_TestLog.cs" />
<Compile Include="Application\TBL_RejectsExplain.cs" />
<Compile Include="Application\TBL_RepairLog.cs" />
<Compile Include="Application\TBL_RepairReason.cs" />
<Compile Include="Application\TBL_RepairResults.cs" />
<Compile Include="Application\TBL_RepairTypes.cs" />
<Compile Include="Application\TBL_shipping.cs" />
<Compile Include="Application\TBL_TestLog.cs" />
<Compile Include="Application\TBL_UTS_UserOperation.cs" />
<Compile Include="Application\ToDayCapacity.cs" />
<Compile Include="Application\uts_bindhistoryinfo_log.cs" />
<Compile Include="Application\uts_johao_tbl_importinfo.cs" />
<Compile Include="Application\uts_johao_tbl_shipping.cs" />
<Compile Include="Application\uts_zongqing_tbl_importinfo.cs" />
<Compile Include="Application\TBL_StationList_ForZongQing.cs" />
<Compile Include="Application\uts_zongqing_tbl_shipping.cs" />
<Compile Include="Application\Uts_Importinfo_Log.cs" />
<Compile Include="Entities\InHaosEntity.Context.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>InHaosEntity.Context.tt</DependentUpon>
</Compile>
<Compile Include="Entities\InHaosEntity.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\InHaosEntity.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>InHaosEntity.edmx</DependentUpon>
</Compile>
<Compile Include="Entities\ManageEntity.Context.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>ManageEntity.Context.tt</DependentUpon>
</Compile>
<Compile Include="Entities\ManageEntity.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\ManageEntity.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>ManageEntity.edmx</DependentUpon>
</Compile>
<Compile Include="Entities\SqlSugarBase.cs" />
<Compile Include="Entities\TBL_Customer.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_FlowCtr.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_Log.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_OrderInternal.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_Orders.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_ProductionLine.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_ProductionPlan.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_ProductTypes.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_Project.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_RepairRequest.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_SnList.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_SnRules.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_StationList.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_SyncList.cs">
<DependentUpon>InHaosEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_AppList.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_AppLog.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_AuthLog.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_AuthManage.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_Company.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_DataServiceList.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_DataServiceLog.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_DBList.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_DevLog.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_ErrCode.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_LicenseList.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_Log.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_Module.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_OrderStatus.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_SearchKey.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_ServiceLog.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_SwReleaseLog.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_SwUpdate.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_SyncList.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_TestPlanTips.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_User.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_UserAuth_Operation.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Entities\TBL_UTS_Manage_UtsCmdList.cs">
<DependentUpon>ManageEntity.tt</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<EntityDeploy Include="Entities\ManageEntity.edmx">
<Generator>EntityModelCodeGenerator</Generator>
<LastGenOutput>ManageEntity.Designer.cs</LastGenOutput>
</EntityDeploy>
<EntityDeploy Include="Entities\InHaosEntity.edmx">
<Generator>EntityModelCodeGenerator</Generator>
<LastGenOutput>InHaosEntity.Designer.cs</LastGenOutput>
</EntityDeploy>
<None Include="Entities\InHaosEntity.edmx.diagram">
<DependentUpon>InHaosEntity.edmx</DependentUpon>
</None>
<None Include="Entities\ManageEntity.edmx.diagram">
<DependentUpon>ManageEntity.edmx</DependentUpon>
<SubType>Designer</SubType>
</None>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="Entities\InHaosEntity.Context.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<DependentUpon>InHaosEntity.edmx</DependentUpon>
<LastGenOutput>InHaosEntity.Context.cs</LastGenOutput>
</Content>
<Content Include="Entities\InHaosEntity.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<DependentUpon>InHaosEntity.edmx</DependentUpon>
<LastGenOutput>InHaosEntity.cs</LastGenOutput>
</Content>
<Content Include="Entities\ManageEntity.Context.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>ManageEntity.Context.cs</LastGenOutput>
<DependentUpon>ManageEntity.edmx</DependentUpon>
</Content>
<Content Include="Entities\ManageEntity.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<DependentUpon>ManageEntity.edmx</DependentUpon>
<LastGenOutput>ManageEntity.cs</LastGenOutput>
</Content>
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
</Target>
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
</Project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</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"
}

55
AUTS.Domain/App.config Normal file
View File

@@ -0,0 +1,55 @@
<?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.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider></providers>
</entityFramework>
<connectionStrings>
<add name="Uts_ManageEntities" connectionString="metadata=res://*/Entities.ManageEntity.csdl|res://*/Entities.ManageEntity.ssdl|res://*/Entities.ManageEntity.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=blv-rd.tech;user id=uts_manager;password=WoUts*#082k;persistsecurityinfo=True;port=3307;database=uts_manage&quot;" providerName="System.Data.EntityClient" />
<add name="Uts_InHaosEntities" connectionString="metadata=res://*/Entities.InHaosEntity.csdl|res://*/Entities.InHaosEntity.ssdl|res://*/Entities.InHaosEntity.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=blv-rd.tech;user id=uts_manager;password=WoUts*#082k;persistsecurityinfo=True;port=3307;database=uts_inhaos&quot;" providerName="System.Data.EntityClient" />
</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-6.9.12.0" newVersion="6.9.12.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /></startup><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,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.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,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain
{
public class Home
{
/// <summary>
/// 已确认
/// </summary>
public int Confirm { get; set; }
/// <summary>
/// 生产中
/// </summary>
public int Yield { get; set; }
/// <summary>
/// 已完成
/// </summary>
public int Accomplish { 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 AUTS.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,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain
{
public class OInternalNumber
{
/// <summary>
/// 已确认
/// </summary>
public int Confirm { get; set; }
/// <summary>
/// 分配条码
/// </summary>
public int BarCode { get; set; }
/// <summary>
/// 已排产
/// </summary>
public int Scheduling { get; set; }
/// <summary>
/// 生产中
/// </summary>
public int Yield { get; set; }
/// <summary>
/// 生产完成
/// </summary>
public int prodCompletion { get; set; }
/// <summary>
/// 已完成
/// </summary>
public int Accomplish { get; set; }
/// <summary>
/// 订单总数
/// </summary>
public int orderCount { get; set; }
}
}

View File

@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.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,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.Application
{
public class RepairReason
{
public int ID { get; set; }
public string RepairType { get; set; }
public string Name { get; set; }
public DateTime CreateTime { get; set; }
public DateTime UpdateTime { get; set; }
public string Remark { 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 AUTS.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,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.Application
{
public class TBL_ColorBoxList
{
public int ID{get;set;}
public string Mo{get;set;}
public string Barcode { get; set; }
public string ColorBox_BarCode { get; set; }
public DateTime Import_DateTime { get; set; }
public DateTime Binding_DateTime { get; set; }
public int Binding_Status { get; set; }
public string Import_User { get; set; }
public string Import_IP { get; set; }
public string DeviceName { get; set;}
public string DevicePSK { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.Application
{
public class TBL_ImportInfo
{
public int ID { get; set; }
public int ProjectID { get; set; }
public string Barcode { get; set; }
public DateTime ImportDateTime { get; set; }
public DateTime UpdateTime { get; set; }
public string ColorBox_BarCode { get; set; }
public string OutBoxCode { get; set; }
public string MacCode { get; set; }
public string UnitWeigth { 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 AUTS.Domain.Application
{
public class TBL_ImportinfoLog
{
public int ID { get; set; }
public int OType { get; set; }
public DateTime CreationTime { get; set; }
public string Calldb { 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 AUTS.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,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.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; }
/// <summary>
/// 错误码
/// </summary>
public int FailSteps { get; set; } = 0;
/// <summary>
/// 错误信息
/// </summary>
public string FailMsg { 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 AUTS.Domain.Application
{
public class TBL_RejectsExplain
{
public int id { get; set; }
public string Matlab { get; set; }
public string Introductions { get; set; }
public string Remark { get; set; }
public DateTime CreationTime { get; set; }
public DateTime UpdateTime { get; set; }
}
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.Application
{
/**
*维修日志表
*/
public class TBL_RepairLog
{
public int ID { get; set; }
public int ProductID { get; set; }
public int StationID { get; set; }
public int OrderID { get; set; }
public int TestLogID { get; set; }
public string DUT_SN { get; set; }
public string TestPlan { get; set; }
public string FailSteps { get; set; }
public string FailMsg { get; set; }
public string ErrCode { get; set; }
public DateTime RepairDate { get; set; }
public DateTime UpdateTime { get; set; }
public int RepairType { get; set; }
public int RepairReason { get; set; }
public string RepairSource { get; set; }
public string ProductImg1 { get; set; }
public string ProductImg2 { get; set; }
public string ProductImg3 { get; set; }
public string ProductImg4 { get; set; }
public string DocuNumber { get; set; }
public string RepairComment { get; set; }
public int RepairResult { get; set; }
public int Userid { 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 AUTS.Domain.Application
{
public class TBL_RepairReason
{
public int ID { get; set; }
public int RepairType { get; set; }
public string Name { get; set; }
public DateTime CreateTime { get; set; }
public DateTime UpdateTime { get; set; }
public string Remark { 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 AUTS.Domain.Application
{
public class TBL_RepairResults
{
public int ID { get; set; }
public string Name { get; set; }
public DateTime CreateTime { get; set; }
public DateTime UpdateTime { get; set; }
public string Remark { 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 AUTS.Domain.Application
{
public class TBL_RepairTypes
{
public int ID { get; set; }
public string Name { get; set; }
public DateTime CreateTime { get; set; }
public DateTime UpdateTime { get; set; }
public string Remark { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.Application
{
[SugarTable("TBL_StationList")]
public class TBL_StationList_ForZongQing
{
public int ID { get; set; }
public int ProjectID { get; set; }
public string StationName { get; set; }
public string StationType { get; set; }
public int ArtworkOrder { get; set; }
public int SnListOrder { get; set; }
public string StationDesc { get; set; }
public DateTime LastUpdateDate { get; set; }
public DateTime UpdateTime { get; set; }
public string LogTableName { get; set; }
public byte[] PreviewImage { get; set; }
public string Remark { 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 AUTS.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,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.Application
{
public class TBL_UTS_UserOperation
{
public int ID { get; set; }
public DateTime CreationTime { get; set; }
public string UserName { get; set; }
public string Ip { get; set; }
public string Browser { get; set; }
public string Operation { get; set; }
public string Database { get; set; }
public string Device { get; set; }
public string Location { 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 AUTS.Domain.Application
{
public class TBL_importinfo_log
{
public int ID { get; set; }
public int ProjectID { get; set; }
public string Dbname { get; set; }
public string Operationtpye { get; set; }
public DateTime ImportDateTime { get; set; }
public string PartData { get; set; }
public int Result { get; set; }
public string ReturnResult { get; set; }
public string Ip { get; set; }
public string Address { get; set; }
public double Runtime { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.Application
{
public class TBL_shipping
{
public int ID { get; private set; }
public string ShippingCode { get; private set; }
public string Creator { get; private set; }
public DateTime CreateDateTime { get; private set; }
public DateTime StartDateTime { get; private set; }
public DateTime EndDateTime { get; private set; }
public string Loader { get; private set; }
public int Status { get; private set; }
public string ShippingType { get; private set; }
public string Destination { get; private set; }
public string Voucher { get; private set; }
public string Remark { get; private set; }
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain
{
public class ToDayCapacity
{
/// <summary>
/// DUT序号
/// </summary>
public string DUT_SN { get; set; }
/// <summary>
/// 站位名
/// </summary>
public string StationName { 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,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.Application
{
public class Uts_Importinfo_Log
{
public int ID { get; set; }
public int ProjectID { get; set; }
public string Dbname { get; set; }
public string Operationtpye { get; set; }
public DateTime ImportDateTime { get; set; }
public string PartData { get; set; }
public int Result { get; set; }
public string ReturnResult { get; set; }
public string Ip { get; set; }
public string Address { get; set; }
public double Runtime { get; set; }
}
}

View File

@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
namespace AUTS.Domain.Application
{
public class uts_bindhistoryinfo_log
{
[SugarColumn(IsIdentity =true, IsPrimaryKey = true)]
public int ID { get; set; }
[SugarColumn(ColumnDataType = "int", IsNullable = false)]
public int importinfoID { get; set; }
[SugarColumn(ColumnDataType = "datetime(3)", IsNullable=true)]
public DateTime operateTime { get; set; }
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public int operateType { get; set; }
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public int Result { get; set; }
[SugarColumn(ColumnDataType = "int", IsNullable = true)]
public int ProjectID { get; set; }
[SugarColumn(ColumnDataType = "varchar(100)", IsNullable = true)]
public string OutBoxCode { get; set; }
[SugarColumn(ColumnDataType = "varchar(100)", IsNullable = true)]
public string Barcode { get; set; }
[SugarColumn(ColumnDataType = "varchar(100)", IsNullable = true)]
public string ColorBox_BarCode { get; set; }
[SugarColumn(ColumnDataType = "varchar(100)", IsNullable = true)]
public string ShippingCode { get; set; }
[SugarColumn(ColumnDataType = "varchar(255)", IsNullable = true)]
public string Remark { get; set; }
[SugarColumn(ColumnDataType = "varchar(255)", IsNullable = true)]
public string ShippingOperator { 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 AUTS.Domain.Application
{
public class uts_johao_tbl_importinfo
{
[SugarColumn(IsPrimaryKey = true)]//数据库是自增才配自增
public int ID { get; set; }
public int ProjectID { get; set; }
public string Barcode { get; set; }
public DateTime ImportDateTime { get; set; }
public DateTime UpdateTime { get; set; }
public string ColorBox_BarCode { get; set; }
public string OutBoxCode { get; set; }
public string MacCode { get; set; }
public string UnitWeigth { get; set; }
public string LABEL_PRINT_CNT { get; set; }
public DateTime S1 { get; set; }
public DateTime S2 { get; set; }
public DateTime S3 { get; set; }
public DateTime S4 { get; set; }
public DateTime S5 { get; set; }
public DateTime S6 { get; set; }
public DateTime S7 { get; set; }
public DateTime S8 { get; set; }
public DateTime S9 { get; set; }
public DateTime S10 { get; set; }
public DateTime S11 { get; set; }
public DateTime S12 { get; set; }
public int Result1 { get; set; }
public int Result2 { get; set; }
public int Result3 { get; set; }
public int Result4 { get; set; }
public int Result5 { get; set; }
public int Result6 { get; set; }
public int Result7 { get; set; }
public int Result8 { get; set; }
public int Result9 { get; set; }
public int Result10 { get; set; }
public int Result11 { get; set; }
public int Result12 { get; set; }
public string MO { get; set; }
public string ShippingCode { get; set; }
public Nullable<DateTime> ShippingDateTime { get; set; }
public string ShippingLoader { get; set; }
public string F305_BLE_MAC { get; set; }
public string F305_RF_ADD { get; set; }
public string F305_DeviceName { get; set; }
public string F305_DevicePSK { get; set; }
public string F305_4G_IMEI { get; set; }
public string F305_4G_SIM_ID { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.Application
{
public class uts_johao_tbl_shipping
{
[SugarColumn(IsPrimaryKey = true)]//数据库是自增才配自增
public int ID { get; set; }
public string ShippingCode { get; set; }
public string Creator { get; set; }
public DateTime CreateDateTime { get; set; }
public DateTime StartDateTime { get; set; }
public DateTime EndDateTime { get; set; }
public string Loader { get; set; }
public int Status { get; set; }
public string ShippingType { get; set; }
public string Destination { get; set; }
public string Voucher { get; set; }
public string Remark { get; set; }
public int ProjectID { get; set; }
public int QTY { get; set; }
public string MO { get; set; }
public string Customer { get; set; }
public int BindedColorBoxQTY { get; set; }
}
}

View File

@@ -0,0 +1,56 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.Application
{
public class uts_zongqing_tbl_importinfo
{
[SugarColumn(IsPrimaryKey = true)]//数据库是自增才配自增
public int ID { get; set; }
public int ProjectID { get; set; }
public string Barcode { get; set; }
public DateTime ImportDateTime { get; set; }
public DateTime UpdateTime { get; set; }
public string ColorBox_BarCode { get; set; }
public string OutBoxCode { get; set; }
public string MacCode { get; set; }
public string UnitWeigth { get; set; }
public string LABEL_PRINT_CNT { get; set; }
public DateTime S1 { get; set; }
public DateTime S2 { get; set; }
public DateTime S3 { get; set; }
public DateTime S4 { get; set; }
public DateTime S5 { get; set; }
public DateTime S6 { get; set; }
public DateTime S7 { get; set; }
public DateTime S8 { get; set; }
public DateTime S9 { get; set; }
public DateTime S10 { get; set; }
public DateTime S11 { get; set; }
public DateTime S12 { get; set; }
public int Result1 { get; set; }
public int Result2 { get; set; }
public int Result3 { get; set; }
public int Result4 { get; set; }
public int Result5 { get; set; }
public int Result6 { get; set; }
public int Result7 { get; set; }
public int Result8 { get; set; }
public int Result9 { get; set; }
public int Result10 { get; set; }
public int Result11 { get; set; }
public int Result12 { get; set; }
public string Zima_UID { get; set; }
public string Zima_BLE_MAC { get; set; }
public string ZIMA_BATT_SN { get; set; }
public string ZIMA_TUYA_MAC { get; set; }
public string MO { get; set; }
public string ShippingCode { get; set; }
public Nullable<DateTime> ShippingDateTime { get; set; }
public string ShippingLoader { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AUTS.Domain.Application
{
public class uts_zongqing_tbl_shipping
{
[SugarColumn(IsPrimaryKey = true)]//数据库是自增才配自增
public int ID { get; set; }
public string ShippingCode { get; set; }
public string Creator { get; set; }
public DateTime CreateDateTime { get; set; }
public DateTime StartDateTime { get; set; }
public DateTime EndDateTime { get; set; }
public string Loader { get; set; }
public int Status { get; set; }
public string ShippingType { get; set; }
public string Destination { get; set; }
public string Voucher { get; set; }
public string Remark { get; set; }
public int ProjectID { get; set; }
public int QTY { get; set; }
public string MO { get; set; }
public string Customer { get; set; }
public int BindedColorBoxQTY { get; set; }
}
}

View File

@@ -0,0 +1,43 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace AUTS.Domain.Entities
{
using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
public partial class Uts_InHaosEntities : DbContext
{
public Uts_InHaosEntities()
: base("name=Uts_InHaosEntities")
{
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
throw new UnintentionalCodeFirstException();
}
public virtual DbSet<TBL_FlowCtr> TBL_FlowCtr { get; set; }
public virtual DbSet<TBL_Log> TBL_Log { get; set; }
public virtual DbSet<TBL_ProductionLine> TBL_ProductionLine { get; set; }
public virtual DbSet<TBL_SyncList> TBL_SyncList { get; set; }
public virtual DbSet<TBL_ProductionPlan> TBL_ProductionPlan { get; set; }
public virtual DbSet<TBL_SnRules> TBL_SnRules { get; set; }
public virtual DbSet<TBL_SnList> TBL_SnList { get; set; }
public virtual DbSet<TBL_ProductTypes> TBL_ProductTypes { get; set; }
public virtual DbSet<TBL_Customer> TBL_Customer { get; set; }
public virtual DbSet<TBL_Project> TBL_Project { get; set; }
public virtual DbSet<TBL_StationList> TBL_StationList { get; set; }
public virtual DbSet<TBL_OrderInternal> TBL_OrderInternal { get; set; }
public virtual DbSet<TBL_Orders> TBL_Orders { get; set; }
public virtual DbSet<TBL_RepairRequest> TBL_RepairRequestSet { 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 = @"InHaosEntity.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\欧阳磊\AUTS-DATA(uts-data)\AUTS.Domain\Entities\InHaosEntity.edmx”启用了 T4 代码生成。
// 要启用旧代码生成功能,请将“代码生成策略”设计器属性的值
// 更改为“旧的 ObjectContext”。当在设计器中打开该模型时此属性会出现在
// “属性”窗口中。
// 如果没有生成任何上下文和实体类,可能是因为您创建了空模型但是
// 尚未选择要使用的实体框架版本。要为您的模型生成一个上下文类和实体
// 类,请在设计器中打开该模型,右键单击设计器图面,然后
// 选择“从数据库更新模型...”、“从模型生成数据库...”或“添加代码生成
// 项...”。

View File

View File

@@ -0,0 +1,780 @@
<?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="Uts_InHaosModel.Store" Provider="MySql.Data.MySqlClient" ProviderManifestToken="5.5" 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="TBL_Customer">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="CustomerAbbr" Type="varchar" MaxLength="64" Nullable="false" />
<Property Name="CustomerName" Type="varchar" MaxLength="64" Nullable="false" />
<Property Name="CreateTime" Type="datetime" Precision="0" Nullable="false" />
</EntityType>
<EntityType Name="TBL_FlowCtr">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="ProjectID" Type="int" />
<Property Name="SUT_SN" Type="varchar" MaxLength="254" />
<Property Name="ProcessRecord" Type="varchar" MaxLength="254" />
</EntityType>
<EntityType Name="TBL_Log">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" Nullable="false" />
<Property Name="UserID" Type="int" />
<Property Name="DateTime" Type="datetime" Precision="0" />
<Property Name="Operation" Type="varchar" MaxLength="254" />
</EntityType>
<EntityType Name="TBL_OrderInternal">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="OrderID" Type="int" Nullable="false" />
<Property Name="InternalNo" Type="varchar" MaxLength="64" Nullable="false" />
<Property Name="CompanyID" Type="int" />
<Property Name="ProductID" Type="int" />
<Property Name="ProductTypeID" Type="int" />
<Property Name="CreateTime" Type="datetime" Precision="0" Nullable="false" />
<Property Name="ObjectiveYield" Type="int" Nullable="false" />
<Property Name="ObjectiveYieldTotal" Type="int" Nullable="false" />
<Property Name="OrderStatus" Type="int" />
<Property Name="DeliveryTime" Type="datetime" Precision="0" />
<Property Name="Station" Type="varchar" MaxLength="254" />
<Property Name="BarCode" Type="varchar" MaxLength="254" />
</EntityType>
<EntityType Name="TBL_Orders">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="CompanyID" Type="int" Nullable="false" />
<Property Name="ProductID" Type="int" Nullable="false" />
<Property Name="ProductTypeID" Type="int" Nullable="false" />
<Property Name="OrderNo" Type="varchar" MaxLength="64" Nullable="false" />
<Property Name="OrderCount" Type="int" Nullable="false" />
<Property Name="DeliveryTime" Type="datetime" Precision="0" Nullable="false" />
<Property Name="CreateTime" Type="datetime" Precision="0" Nullable="false" />
<Property Name="CostPrice" Type="float" Nullable="false" />
<Property Name="TransactPrice" Type="float" Nullable="false" />
<Property Name="OrderStatus" Type="int" Nullable="false" />
</EntityType>
<EntityType Name="TBL_ProductionLine">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="Name" Type="varchar" MaxLength="64" Nullable="false" />
<Property Name="Description" Type="varchar" MaxLength="255" />
<Property Name="Remark" Type="varchar" MaxLength="255" />
</EntityType>
<EntityType Name="TBL_ProductionPlan">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="OrderID" Type="int" Nullable="false" />
<Property Name="ProductionLineID" Type="int" Nullable="false" />
<Property Name="OrderInternalID" Type="int" Nullable="false" />
<Property Name="StationID" Type="int" Nullable="false" />
<Property Name="ProductionTime" Type="datetime" Precision="0" Nullable="false" />
<Property Name="ActualOutput" Type="int" Nullable="false" />
<Property Name="ObjectiveYield" Type="int" Nullable="false" />
<Property Name="Remark" Type="varchar" MaxLength="255" />
<Property Name="Sn_Start" Type="varchar" MaxLength="255" />
<Property Name="Sn_End" Type="varchar" MaxLength="255" />
<Property Name="ObjectiveYieldTotal" Type="int" Nullable="false" />
</EntityType>
<EntityType Name="TBL_ProductTypes">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="ProductType" Type="varchar" MaxLength="255" Nullable="false" />
<Property Name="Remark" Type="varchar" MaxLength="255" />
</EntityType>
<EntityType Name="TBL_Project">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="ProductTypeID" Type="int" />
<Property Name="ProjectName" Type="varchar" MaxLength="64" Nullable="false" />
<Property Name="Description" Type="varchar" MaxLength="64" />
<Property Name="UserID" Type="int" />
<Property Name="CreateTime" Type="datetime" Precision="0" />
<Property Name="Remark" Type="varchar" MaxLength="254" />
<Property Name="PreviewImage" Type="blob" />
<Property Name="Price" Type="float" />
<Property Name="Currency" Type="varchar" MaxLength="10" />
<Property Name="IsValid" Type="tinyint" />
<Property Name="EolDate" Type="datetime" Precision="0" />
<Property Name="ImageName" Type="varchar" MaxLength="255" />
<Property Name="Type" Type="int" />
<Property Name="SnType" Type="int" />
</EntityType>
<EntityType Name="TBL_SnList">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="OrderID" Type="int" />
<Property Name="OrderInternalID" Type="int" />
<Property Name="ProductID" Type="int" Nullable="false" />
<Property Name="BarCode" Type="varchar" MaxLength="255" Nullable="false" />
<Property Name="CreateTime" Type="datetime" Precision="0" Nullable="false" />
<Property Name="UpdateTime" Type="datetime" Precision="0" />
<Property Name="SnType" Type="int" />
<Property Name="AssemblySn" Type="varchar" MaxLength="254" />
<Property Name="AssemblyTime" Type="datetime" Precision="0" />
<Property Name="S1" Type="datetime" Precision="0" />
<Property Name="S2" Type="datetime" Precision="0" />
<Property Name="S3" Type="datetime" Precision="0" />
<Property Name="S4" Type="datetime" Precision="0" />
<Property Name="S5" Type="datetime" Precision="0" />
<Property Name="S6" Type="datetime" Precision="0" />
<Property Name="S7" Type="datetime" Precision="0" />
<Property Name="S8" Type="datetime" Precision="0" />
<Property Name="S9" Type="datetime" Precision="0" />
<Property Name="S10" Type="datetime" Precision="0" />
<Property Name="S11" Type="datetime" Precision="0" />
<Property Name="S12" Type="datetime" Precision="0" />
<Property Name="Result1" Type="tinyint" />
<Property Name="Result2" Type="tinyint" />
<Property Name="Result3" Type="tinyint" />
<Property Name="Result4" Type="tinyint" />
<Property Name="Result5" Type="tinyint" />
<Property Name="Result6" Type="tinyint" />
<Property Name="Result7" Type="tinyint" />
<Property Name="Result8" Type="tinyint" />
<Property Name="Result9" Type="tinyint" />
<Property Name="Result10" Type="tinyint" />
<Property Name="Result11" Type="tinyint" />
<Property Name="Result12" Type="tinyint" />
</EntityType>
<EntityType Name="TBL_SnRules">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="OrderID" Type="int" Nullable="false" />
<Property Name="OrderInternalID" Type="int" Nullable="false" />
<Property Name="ProductID" Type="int" Nullable="false" />
<Property Name="StationIDs" Type="varchar" MaxLength="255" Nullable="false" />
<Property Name="Sn_Prefix" Type="varchar" MaxLength="255" />
<Property Name="Sn_Start" Type="varchar" MaxLength="11" Nullable="false" />
<Property Name="Sn_End" Type="varchar" MaxLength="11" Nullable="false" />
<Property Name="CreateTime" Type="datetime" Precision="0" Nullable="false" />
</EntityType>
<EntityType Name="TBL_StationList">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="ProjectID" Type="int" Nullable="false" />
<Property Name="StationName" Type="varchar" MaxLength="255" Nullable="false" />
<Property Name="StationType" Type="varchar" MaxLength="255" Nullable="false" />
<Property Name="ArtworkOrder" Type="int" Nullable="false" />
<Property Name="StationDesc" Type="varchar" MaxLength="255" />
<Property Name="LastUpdateDate" Type="datetime" Precision="0" />
<Property Name="LogTableName" Type="varchar" MaxLength="255" />
<Property Name="BinPackage" Type="blob" />
<Property Name="BinPackageMd5" Type="varchar" MaxLength="255" />
<Property Name="PreviewImage" Type="blob" />
<Property Name="Remark" Type="varchar" MaxLength="255" />
<Property Name="PacketName" Type="varchar" MaxLength="255" />
<Property Name="SnListOrder" Type="int" />
<Property Name="IsValid" Type="tinyint" />
<Property Name="SnType" Type="int" />
<Property Name="EditPwd" Type="varchar" MaxLength="32" />
<Property Name="ReleasePwd" Type="varchar" MaxLength="32" />
<Property Name="PacketMd5" Type="varchar" MaxLength="32" />
</EntityType>
<EntityType Name="TBL_SyncList">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="CurrentDate" Type="datetime" Precision="0" />
<Property Name="TableName" Type="varchar" MaxLength="254" Nullable="false" />
<Property Name="RevisionID" Type="int" Nullable="false" />
<Property Name="SyncType" Type="varchar" MaxLength="254" />
</EntityType>
<!--<EntityType Name="TBL_SyncList">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="CurrentDate" Type="datetime" Precision="0" />
<Property Name="TableName" Type="varchar" MaxLength="254" Nullable="false" />
<Property Name="RevisionID" Type="int" Nullable="false" />
<Property Name="SyncType" Type="varchar" MaxLength="254" />
</EntityType>-->
<EntityType Name="TBL_RepairRequest">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="UserID" Type="int" Nullable="false"/>
<Property Name="RepairRequestNum" Type="varchar" MaxLength="254" Nullable="false" />
<Property Name="ProductID" Type="int" Nullable="false" />
<Property Name="Barcode" Type="varchar" MaxLength="254" Nullable="false" />
<Property Name="ProductImage" Type="varchar" MaxLength="254" Nullable="true" />
<Property Name="RejectSource" Type="varchar" MaxLength="254" Nullable="true" />
<Property Name="RejectCode" Type="varchar" MaxLength="254" Nullable="true" />
<Property Name="RejectDesc" Type="varchar" MaxLength="254" Nullable="true" />
<Property Name="CreateTime" Type="datetime" Precision="0" Nullable="true"/>
<Property Name="UpdateTime" Type="datetime" Precision="0" Nullable="true"/>
<Property Name="RepairProgress" Type="varchar" MaxLength="64" Nullable="true" />
<Property Name="RepairResult" Type="int" Nullable="true" />
<Property Name="RepairLogID" Type="int" Nullable="true" />
<Property Name="Repairier" Type="int" Nullable="true" />
<Property Name="Remark" Type="varchar" MaxLength="254" Nullable="true" />
<Property Name="ProductlMarking" Type="varchar" MaxLength="254" Nullable="true" />
</EntityType>
<EntityContainer Name="Uts_InHaosModelStoreContainer">
<EntitySet Name="TBL_Customer" EntityType="Self.TBL_Customer" Schema="uts_inhaos" store:Type="Tables" />
<EntitySet Name="TBL_FlowCtr" EntityType="Self.TBL_FlowCtr" Schema="uts_inhaos" store:Type="Tables" />
<EntitySet Name="TBL_Log" EntityType="Self.TBL_Log" Schema="uts_inhaos" store:Type="Tables" />
<EntitySet Name="TBL_OrderInternal" EntityType="Self.TBL_OrderInternal" Schema="uts_inhaos" store:Type="Tables" />
<EntitySet Name="TBL_Orders" EntityType="Self.TBL_Orders" Schema="uts_inhaos" store:Type="Tables" />
<EntitySet Name="TBL_ProductionLine" EntityType="Self.TBL_ProductionLine" Schema="uts_inhaos" store:Type="Tables" />
<EntitySet Name="TBL_ProductionPlan" EntityType="Self.TBL_ProductionPlan" Schema="uts_inhaos" store:Type="Tables" />
<EntitySet Name="TBL_ProductTypes" EntityType="Self.TBL_ProductTypes" Schema="uts_inhaos" store:Type="Tables" />
<EntitySet Name="TBL_Project" EntityType="Self.TBL_Project" Schema="uts_inhaos" store:Type="Tables" />
<EntitySet Name="TBL_SnList" EntityType="Self.TBL_SnList" Schema="uts_inhaos" store:Type="Tables" />
<EntitySet Name="TBL_SnRules" EntityType="Self.TBL_SnRules" Schema="uts_inhaos" store:Type="Tables" />
<EntitySet Name="TBL_StationList" EntityType="Self.TBL_StationList" Schema="uts_inhaos" store:Type="Tables" />
<EntitySet Name="TBL_SyncList" EntityType="Self.TBL_SyncList" Schema="uts_inhaos" store:Type="Tables" />
<EntitySet Name="TBL_RepairRequest" EntityType="Self.TBL_RepairRequest" Schema="uts_inhaos" store:Type="Tables" />
</EntityContainer>
</Schema></edmx:StorageModels>
<!-- CSDL content -->
<edmx:ConceptualModels>
<Schema Namespace="Uts_InHaosModel" 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">
<EntityContainer Name="Uts_InHaosEntities" annotation:LazyLoadingEnabled="true">
<EntitySet Name="TBL_FlowCtr" EntityType="Uts_InHaosModel.TBL_FlowCtr" />
<EntitySet Name="TBL_Log" EntityType="Uts_InHaosModel.TBL_Log" />
<EntitySet Name="TBL_ProductionLine" EntityType="Uts_InHaosModel.TBL_ProductionLine" />
<EntitySet Name="TBL_SyncList" EntityType="Uts_InHaosModel.TBL_SyncList" />
<EntitySet Name="TBL_ProductionPlan" EntityType="Uts_InHaosModel.TBL_ProductionPlan" />
<EntitySet Name="TBL_SnRules" EntityType="Uts_InHaosModel.TBL_SnRules" />
<EntitySet Name="TBL_SnList" EntityType="Uts_InHaosModel.TBL_SnList" />
<EntitySet Name="TBL_ProductTypes" EntityType="Uts_InHaosModel.TBL_ProductTypes" />
<EntitySet Name="TBL_Customer" EntityType="Uts_InHaosModel.TBL_Customer" />
<EntitySet Name="TBL_Project" EntityType="Uts_InHaosModel.TBL_Project" />
<EntitySet Name="TBL_StationList" EntityType="Uts_InHaosModel.TBL_StationList" />
<EntitySet Name="TBL_OrderInternal" EntityType="Uts_InHaosModel.TBL_OrderInternal" />
<EntitySet Name="TBL_Orders" EntityType="Uts_InHaosModel.TBL_Orders" />
<EntitySet Name="TBL_RepairRequestSet" EntityType="Uts_InHaosModel.TBL_RepairRequest" />
</EntityContainer>
<EntityType Name="TBL_FlowCtr">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="ProjectID" Type="Int32" />
<Property Name="SUT_SN" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
<Property Name="ProcessRecord" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="TBL_Log">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" />
<Property Name="UserID" Type="Int32" />
<Property Name="DateTime" Type="DateTime" />
<Property Name="Operation" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="TBL_ProductionLine">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="Name" Type="String" Nullable="false" MaxLength="64" FixedLength="false" Unicode="false" />
<Property Name="Description" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="Remark" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="TBL_SyncList">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="CurrentDate" Type="DateTime" />
<Property Name="TableName" Type="String" Nullable="false" MaxLength="254" FixedLength="false" Unicode="false" />
<Property Name="RevisionID" Type="Int32" Nullable="false" />
<Property Name="SyncType" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="TBL_ProductionPlan">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="OrderID" Type="Int32" Nullable="false" />
<Property Name="ProductionLineID" Type="Int32" Nullable="false" />
<Property Name="ProductionTime" Type="DateTime" Nullable="false" />
<Property Name="ActualOutput" Type="Int32" Nullable="false" />
<Property Name="ObjectiveYield" Type="Int32" Nullable="false" />
<Property Name="Remark" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="Sn_Start" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="Sn_End" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="OrderInternalID" Type="Int32" Nullable="false" />
<Property Name="ObjectiveYieldTotal" Type="Int32" Nullable="false" />
<Property Name="StationID" Type="Int32" Nullable="false" />
</EntityType>
<EntityType Name="TBL_SnRules">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="OrderID" Type="Int32" Nullable="false" />
<Property Name="OrderInternalID" Type="Int32" Nullable="false" />
<Property Name="ProductID" Type="Int32" Nullable="false" />
<Property Name="StationIDs" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="Sn_Prefix" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="Sn_Start" Type="String" Nullable="false" MaxLength="11" FixedLength="false" Unicode="false" />
<Property Name="Sn_End" Type="String" Nullable="false" MaxLength="11" FixedLength="false" Unicode="false" />
<Property Name="CreateTime" Type="DateTime" Nullable="false" />
</EntityType>
<EntityType Name="TBL_SnList">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="OrderID" Type="Int32" Nullable="false" />
<Property Name="OrderInternalID" Type="Int32" Nullable="false" />
<Property Name="ProductID" Type="Int32" Nullable="false" />
<Property Name="BarCode" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="CreateTime" Type="DateTime" Nullable="false" />
<Property Name="S1" Type="DateTime" />
<Property Name="S2" Type="DateTime" />
<Property Name="S3" Type="DateTime" />
<Property Name="S4" Type="DateTime" />
<Property Name="S5" Type="DateTime" />
<Property Name="S6" Type="DateTime" />
<Property Name="S7" Type="DateTime" />
<Property Name="S8" Type="DateTime" />
<Property Name="S9" Type="DateTime" />
<Property Name="S10" Type="DateTime" />
<Property Name="S11" Type="DateTime" />
<Property Name="S12" Type="DateTime" />
<Property Name="UpdateTime" Type="DateTime" />
<Property Name="Result1" Type="SByte" />
<Property Name="Result2" Type="SByte" />
<Property Name="Result3" Type="SByte" />
<Property Name="Result4" Type="SByte" />
<Property Name="Result5" Type="SByte" />
<Property Name="Result6" Type="SByte" />
<Property Name="Result7" Type="SByte" />
<Property Name="Result8" Type="SByte" />
<Property Name="Result9" Type="SByte" />
<Property Name="Result10" Type="SByte" />
<Property Name="Result11" Type="SByte" />
<Property Name="Result12" Type="SByte" />
<Property Name="SnType" Type="Int32" />
<Property Name="AssemblySn" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
<Property Name="AssemblyTime" Type="DateTime" />
</EntityType>
<EntityType Name="TBL_ProductTypes">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="ProductType" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="Remark" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="TBL_Customer">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="CustomerAbbr" Type="String" Nullable="false" MaxLength="64" FixedLength="false" Unicode="false" />
<Property Name="CustomerName" Type="String" Nullable="false" MaxLength="64" FixedLength="false" Unicode="false" />
<Property Name="CreateTime" Type="DateTime" Nullable="false" />
</EntityType>
<EntityType Name="TBL_Project">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="ProductTypeID" Type="Int32" />
<Property Name="ProjectName" Type="String" Nullable="false" MaxLength="64" FixedLength="false" Unicode="false" />
<Property Name="Description" Type="String" MaxLength="64" FixedLength="false" Unicode="false" />
<Property Name="UserID" Type="Int32" />
<Property Name="CreateTime" Type="DateTime" />
<Property Name="Remark" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
<Property Name="PreviewImage" Type="Binary" MaxLength="Max" FixedLength="false" />
<Property Name="Price" Type="Single" />
<Property Name="Currency" Type="String" MaxLength="10" FixedLength="false" Unicode="false" />
<Property Name="IsValid" Type="SByte" />
<Property Name="EolDate" Type="DateTime" />
<Property Name="ImageName" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="Type" Type="Int32" />
<Property Name="SnType" Type="Int32" />
</EntityType>
<EntityType Name="TBL_StationList">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="ProjectID" Type="Int32" Nullable="false" />
<Property Name="StationName" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="StationType" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="ArtworkOrder" Type="Int32" Nullable="false" />
<Property Name="StationDesc" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="LastUpdateDate" Type="DateTime" />
<Property Name="LogTableName" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="BinPackage" Type="Binary" MaxLength="Max" FixedLength="false" />
<Property Name="BinPackageMd5" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="PreviewImage" Type="Binary" MaxLength="Max" FixedLength="false" />
<Property Name="Remark" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="PacketName" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="SnListOrder" Type="Int32" />
<Property Name="IsValid" Type="SByte" />
<Property Name="SnType" Type="Int32" />
<Property Name="EditPwd" Type="String" MaxLength="32" FixedLength="false" Unicode="false" />
<Property Name="ReleasePwd" Type="String" MaxLength="32" FixedLength="false" Unicode="false" />
<Property Name="PacketMd5" Type="String" MaxLength="32" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="TBL_OrderInternal">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="OrderID" Type="Int32" Nullable="false" />
<Property Name="InternalNo" Type="String" Nullable="false" MaxLength="64" FixedLength="false" Unicode="false" />
<Property Name="CompanyID" Type="Int32" />
<Property Name="ProductID" Type="Int32" />
<Property Name="ProductTypeID" Type="Int32" />
<Property Name="CreateTime" Type="DateTime" Nullable="false" />
<Property Name="ObjectiveYield" Type="Int32" Nullable="false" />
<Property Name="ObjectiveYieldTotal" Type="Int32" Nullable="false" />
<Property Name="OrderStatus" Type="Int32" />
<Property Name="DeliveryTime" Type="DateTime" />
<Property Name="Station" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
<Property Name="BarCode" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="TBL_Orders">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="CompanyID" Type="Int32" Nullable="false" />
<Property Name="ProductID" Type="Int32" Nullable="false" />
<Property Name="ProductTypeID" Type="Int32" Nullable="false" />
<Property Name="OrderNo" Type="String" Nullable="false" MaxLength="64" FixedLength="false" Unicode="false" />
<Property Name="OrderCount" Type="Int32" Nullable="false" />
<Property Name="DeliveryTime" Type="DateTime" Nullable="false" />
<Property Name="CreateTime" Type="DateTime" Nullable="false" />
<Property Name="CostPrice" Type="Single" Nullable="false" />
<Property Name="TransactPrice" Type="Single" Nullable="false" />
<Property Name="OrderStatus" Type="Int32" Nullable="false" />
</EntityType>
<EntityType Name="TBL_RepairRequest">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="UserID" Type="Int32" Nullable="false" />
<Property Name="RepairRequestNum" Type="String" Nullable="false" />
<Property Name="ProductID" Type="Int32" Nullable="false" />
<Property Name="Barcode" Type="String" Nullable="false" />
<Property Name="ProductImage" Type="String" Nullable="false" />
<Property Name="RejectSource" Type="String" Nullable="false" />
<Property Name="RejectCode" Type="String" Nullable="false" />
<Property Name="RejectDesc" Type="String" Nullable="false" />
<Property Name="CreateTime" Type="DateTime" Nullable="false" />
<Property Name="UpdateTime" Type="DateTime" Nullable="false" />
<Property Name="RepairProgress" Type="String" Nullable="false" />
<Property Name="RepairResult" Type="Int32" Nullable="false" />
<Property Name="RepairLogID" Type="Int32" Nullable="false" />
<Property Name="Repairier" Type="Int32" Nullable="false" />
<Property Name="Remark" Type="String" Nullable="false" />
</EntityType>
</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="Uts_InHaosModelStoreContainer" CdmEntityContainer="Uts_InHaosEntities">
<EntitySetMapping Name="TBL_FlowCtr">
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_FlowCtr">
<MappingFragment StoreEntitySet="TBL_FlowCtr">
<ScalarProperty Name="ProcessRecord" ColumnName="ProcessRecord" />
<ScalarProperty Name="SUT_SN" ColumnName="SUT_SN" />
<ScalarProperty Name="ProjectID" ColumnName="ProjectID" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_Log">
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_Log">
<MappingFragment StoreEntitySet="TBL_Log">
<ScalarProperty Name="Operation" ColumnName="Operation" />
<ScalarProperty Name="DateTime" ColumnName="DateTime" />
<ScalarProperty Name="UserID" ColumnName="UserID" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_ProductionLine">
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_ProductionLine">
<MappingFragment StoreEntitySet="TBL_ProductionLine">
<ScalarProperty Name="Remark" ColumnName="Remark" />
<ScalarProperty Name="Description" ColumnName="Description" />
<ScalarProperty Name="Name" ColumnName="Name" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_SyncList">
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_SyncList">
<MappingFragment StoreEntitySet="TBL_SyncList">
<ScalarProperty Name="SyncType" ColumnName="SyncType" />
<ScalarProperty Name="RevisionID" ColumnName="RevisionID" />
<ScalarProperty Name="TableName" ColumnName="TableName" />
<ScalarProperty Name="CurrentDate" ColumnName="CurrentDate" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_ProductionPlan">
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_ProductionPlan">
<MappingFragment StoreEntitySet="TBL_ProductionPlan">
<ScalarProperty Name="StationID" ColumnName="StationID" />
<ScalarProperty Name="ObjectiveYieldTotal" ColumnName="ObjectiveYieldTotal" />
<ScalarProperty Name="OrderInternalID" ColumnName="OrderInternalID" />
<ScalarProperty Name="Sn_End" ColumnName="Sn_End" />
<ScalarProperty Name="Sn_Start" ColumnName="Sn_Start" />
<ScalarProperty Name="Remark" ColumnName="Remark" />
<ScalarProperty Name="ObjectiveYield" ColumnName="ObjectiveYield" />
<ScalarProperty Name="ActualOutput" ColumnName="ActualOutput" />
<ScalarProperty Name="ProductionTime" ColumnName="ProductionTime" />
<ScalarProperty Name="ProductionLineID" ColumnName="ProductionLineID" />
<ScalarProperty Name="OrderID" ColumnName="OrderID" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_SnRules">
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_SnRules">
<MappingFragment StoreEntitySet="TBL_SnRules">
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="Sn_End" ColumnName="Sn_End" />
<ScalarProperty Name="Sn_Start" ColumnName="Sn_Start" />
<ScalarProperty Name="Sn_Prefix" ColumnName="Sn_Prefix" />
<ScalarProperty Name="StationIDs" ColumnName="StationIDs" />
<ScalarProperty Name="ProductID" ColumnName="ProductID" />
<ScalarProperty Name="OrderInternalID" ColumnName="OrderInternalID" />
<ScalarProperty Name="OrderID" ColumnName="OrderID" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_SnList">
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_SnList">
<MappingFragment StoreEntitySet="TBL_SnList">
<ScalarProperty Name="AssemblyTime" ColumnName="AssemblyTime" />
<ScalarProperty Name="AssemblySn" ColumnName="AssemblySn" />
<ScalarProperty Name="SnType" ColumnName="SnType" />
<ScalarProperty Name="Result12" ColumnName="Result12" />
<ScalarProperty Name="Result11" ColumnName="Result11" />
<ScalarProperty Name="Result10" ColumnName="Result10" />
<ScalarProperty Name="Result9" ColumnName="Result9" />
<ScalarProperty Name="Result8" ColumnName="Result8" />
<ScalarProperty Name="Result7" ColumnName="Result7" />
<ScalarProperty Name="Result6" ColumnName="Result6" />
<ScalarProperty Name="Result5" ColumnName="Result5" />
<ScalarProperty Name="Result4" ColumnName="Result4" />
<ScalarProperty Name="Result3" ColumnName="Result3" />
<ScalarProperty Name="Result2" ColumnName="Result2" />
<ScalarProperty Name="Result1" ColumnName="Result1" />
<ScalarProperty Name="UpdateTime" ColumnName="UpdateTime" />
<ScalarProperty Name="S12" ColumnName="S12" />
<ScalarProperty Name="S11" ColumnName="S11" />
<ScalarProperty Name="S10" ColumnName="S10" />
<ScalarProperty Name="S9" ColumnName="S9" />
<ScalarProperty Name="S8" ColumnName="S8" />
<ScalarProperty Name="S7" ColumnName="S7" />
<ScalarProperty Name="S6" ColumnName="S6" />
<ScalarProperty Name="S5" ColumnName="S5" />
<ScalarProperty Name="S4" ColumnName="S4" />
<ScalarProperty Name="S3" ColumnName="S3" />
<ScalarProperty Name="S2" ColumnName="S2" />
<ScalarProperty Name="S1" ColumnName="S1" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="BarCode" ColumnName="BarCode" />
<ScalarProperty Name="ProductID" ColumnName="ProductID" />
<ScalarProperty Name="OrderInternalID" ColumnName="OrderInternalID" />
<ScalarProperty Name="OrderID" ColumnName="OrderID" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_ProductTypes">
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_ProductTypes">
<MappingFragment StoreEntitySet="TBL_ProductTypes">
<ScalarProperty Name="Remark" ColumnName="Remark" />
<ScalarProperty Name="ProductType" ColumnName="ProductType" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_Customer">
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_Customer">
<MappingFragment StoreEntitySet="TBL_Customer">
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="CustomerName" ColumnName="CustomerName" />
<ScalarProperty Name="CustomerAbbr" ColumnName="CustomerAbbr" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_Project">
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_Project">
<MappingFragment StoreEntitySet="TBL_Project">
<ScalarProperty Name="SnType" ColumnName="SnType" />
<ScalarProperty Name="Type" ColumnName="Type" />
<ScalarProperty Name="ImageName" ColumnName="ImageName" />
<ScalarProperty Name="EolDate" ColumnName="EolDate" />
<ScalarProperty Name="IsValid" ColumnName="IsValid" />
<ScalarProperty Name="Currency" ColumnName="Currency" />
<ScalarProperty Name="Price" ColumnName="Price" />
<ScalarProperty Name="PreviewImage" ColumnName="PreviewImage" />
<ScalarProperty Name="Remark" ColumnName="Remark" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="UserID" ColumnName="UserID" />
<ScalarProperty Name="Description" ColumnName="Description" />
<ScalarProperty Name="ProjectName" ColumnName="ProjectName" />
<ScalarProperty Name="ProductTypeID" ColumnName="ProductTypeID" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_StationList">
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_StationList">
<MappingFragment StoreEntitySet="TBL_StationList">
<ScalarProperty Name="PacketMd5" ColumnName="PacketMd5" />
<ScalarProperty Name="ReleasePwd" ColumnName="ReleasePwd" />
<ScalarProperty Name="EditPwd" ColumnName="EditPwd" />
<ScalarProperty Name="SnType" ColumnName="SnType" />
<ScalarProperty Name="IsValid" ColumnName="IsValid" />
<ScalarProperty Name="SnListOrder" ColumnName="SnListOrder" />
<ScalarProperty Name="PacketName" ColumnName="PacketName" />
<ScalarProperty Name="Remark" ColumnName="Remark" />
<ScalarProperty Name="PreviewImage" ColumnName="PreviewImage" />
<ScalarProperty Name="BinPackageMd5" ColumnName="BinPackageMd5" />
<ScalarProperty Name="BinPackage" ColumnName="BinPackage" />
<ScalarProperty Name="LogTableName" ColumnName="LogTableName" />
<ScalarProperty Name="LastUpdateDate" ColumnName="LastUpdateDate" />
<ScalarProperty Name="StationDesc" ColumnName="StationDesc" />
<ScalarProperty Name="ArtworkOrder" ColumnName="ArtworkOrder" />
<ScalarProperty Name="StationType" ColumnName="StationType" />
<ScalarProperty Name="StationName" ColumnName="StationName" />
<ScalarProperty Name="ProjectID" ColumnName="ProjectID" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_OrderInternal">
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_OrderInternal">
<MappingFragment StoreEntitySet="TBL_OrderInternal">
<ScalarProperty Name="BarCode" ColumnName="BarCode" />
<ScalarProperty Name="Station" ColumnName="Station" />
<ScalarProperty Name="DeliveryTime" ColumnName="DeliveryTime" />
<ScalarProperty Name="OrderStatus" ColumnName="OrderStatus" />
<ScalarProperty Name="ObjectiveYieldTotal" ColumnName="ObjectiveYieldTotal" />
<ScalarProperty Name="ObjectiveYield" ColumnName="ObjectiveYield" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="ProductTypeID" ColumnName="ProductTypeID" />
<ScalarProperty Name="ProductID" ColumnName="ProductID" />
<ScalarProperty Name="CompanyID" ColumnName="CompanyID" />
<ScalarProperty Name="InternalNo" ColumnName="InternalNo" />
<ScalarProperty Name="OrderID" ColumnName="OrderID" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_Orders">
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_Orders">
<MappingFragment StoreEntitySet="TBL_Orders">
<ScalarProperty Name="OrderStatus" ColumnName="OrderStatus" />
<ScalarProperty Name="TransactPrice" ColumnName="TransactPrice" />
<ScalarProperty Name="CostPrice" ColumnName="CostPrice" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="DeliveryTime" ColumnName="DeliveryTime" />
<ScalarProperty Name="OrderCount" ColumnName="OrderCount" />
<ScalarProperty Name="OrderNo" ColumnName="OrderNo" />
<ScalarProperty Name="ProductTypeID" ColumnName="ProductTypeID" />
<ScalarProperty Name="ProductID" ColumnName="ProductID" />
<ScalarProperty Name="CompanyID" ColumnName="CompanyID" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="TBL_RepairRequestSet">
<EntityTypeMapping TypeName="IsTypeOf(Uts_InHaosModel.TBL_RepairRequest)">
<MappingFragment StoreEntitySet="TBL_RepairRequest">
<!--<ScalarProperty Name="ProductlMarking" ColumnName="ProductlMarking" />-->
<ScalarProperty Name="Remark" ColumnName="Remark" />
<ScalarProperty Name="Repairier" ColumnName="Repairier" />
<ScalarProperty Name="RepairLogID" ColumnName="RepairLogID" />
<ScalarProperty Name="RepairResult" ColumnName="RepairResult" />
<ScalarProperty Name="RepairProgress" ColumnName="RepairProgress" />
<ScalarProperty Name="UpdateTime" ColumnName="UpdateTime" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="RejectDesc" ColumnName="RejectDesc" />
<ScalarProperty Name="RejectCode" ColumnName="RejectCode" />
<ScalarProperty Name="RejectSource" ColumnName="RejectSource" />
<ScalarProperty Name="ProductImage" ColumnName="ProductImage" />
<ScalarProperty Name="Barcode" ColumnName="Barcode" />
<ScalarProperty Name="ProductID" ColumnName="ProductID" />
<ScalarProperty Name="RepairRequestNum" ColumnName="RepairRequestNum" />
<ScalarProperty Name="UserID" ColumnName="UserID" />
<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,25 @@
<?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="151a8c58f52a4202a3c014c3e9d5354a" Name="Diagram1">
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_FlowCtr" Width="1.5" PointX="2.75" PointY="0.75" />
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_Log" Width="1.5" PointX="0.75" PointY="3.75" />
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_ProductionLine" Width="1.5" PointX="4.75" PointY="0.75" />
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_SyncList" Width="1.5" PointX="0.875" PointY="6.25" />
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_ProductionPlan" Width="1.5" PointX="9.375" PointY="0.75" />
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_SnRules" Width="1.5" PointX="11" PointY="5.25" />
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_SnList" PointX="13" PointY="0.5" Width="1.5" />
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_ProductTypes" Width="1.5" PointX="9.375" PointY="4.75" />
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_Customer" Width="1.5" PointX="7.75" PointY="7.75" />
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_Project" Width="1.5" PointX="2.75" PointY="9.75" />
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_StationList" Width="1.5" PointX="4.75" PointY="9.75" />
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_OrderInternal" Width="1.5" PointX="3.375" PointY="3.75" />
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_Orders" Width="1.5" PointX="5.375" PointY="3.75" />
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_RepairRequest" Width="1.5" PointX="7.25" PointY="2.625" />
</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 = @"InHaosEntity.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,52 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace AUTS.Domain.Entities
{
using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
public partial class Uts_ManageEntities : DbContext
{
public Uts_ManageEntities()
: base("name=Uts_ManageEntities")
{
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
throw new UnintentionalCodeFirstException();
}
public virtual DbSet<TBL_UTS_Manage_TestPlanTips> TBL_UTS_Manage_TestPlanTips { get; set; }
public virtual DbSet<TBL_UTS_Manage_ServiceLog> TBL_UTS_Manage_ServiceLog { get; set; }
public virtual DbSet<TBL_UTS_Manage_ErrCode> TBL_UTS_Manage_ErrCode { get; set; }
public virtual DbSet<TBL_UTS_Manage_AuthManage> TBL_UTS_Manage_AuthManage { get; set; }
public virtual DbSet<TBL_UTS_Manage_Module> TBL_UTS_Manage_Module { get; set; }
public virtual DbSet<TBL_UTS_Manage_AppList> TBL_UTS_Manage_AppList { get; set; }
public virtual DbSet<TBL_UTS_Manage_AppLog> TBL_UTS_Manage_AppLog { get; set; }
public virtual DbSet<TBL_UTS_Manage_DataServiceList> TBL_UTS_Manage_DataServiceList { get; set; }
public virtual DbSet<TBL_UTS_Manage_DataServiceLog> TBL_UTS_Manage_DataServiceLog { get; set; }
public virtual DbSet<TBL_UTS_Manage_DevLog> TBL_UTS_Manage_DevLog { get; set; }
public virtual DbSet<TBL_UTS_Manage_LicenseList> TBL_UTS_Manage_LicenseList { get; set; }
public virtual DbSet<TBL_UTS_Manage_Log> TBL_UTS_Manage_Log { get; set; }
public virtual DbSet<TBL_UTS_Manage_SearchKey> TBL_UTS_Manage_SearchKey { get; set; }
public virtual DbSet<TBL_UTS_Manage_SwReleaseLog> TBL_UTS_Manage_SwReleaseLog { get; set; }
public virtual DbSet<TBL_UTS_Manage_SwUpdate> TBL_UTS_Manage_SwUpdate { get; set; }
public virtual DbSet<TBL_UTS_Manage_SyncList> TBL_UTS_Manage_SyncList { get; set; }
public virtual DbSet<TBL_UTS_Manage_User> TBL_UTS_Manage_User { get; set; }
public virtual DbSet<TBL_UTS_Manage_UserAuth_Operation> TBL_UTS_Manage_UserAuth_Operation { get; set; }
public virtual DbSet<TBL_UTS_Manage_UtsCmdList> TBL_UTS_Manage_UtsCmdList { get; set; }
public virtual DbSet<TBL_UTS_Manage_AuthLog> TBL_UTS_Manage_AuthLog { get; set; }
public virtual DbSet<TBL_UTS_Manage_OrderStatus> TBL_UTS_Manage_OrderStatus { get; set; }
public virtual DbSet<TBL_UTS_Manage_DBList> TBL_UTS_Manage_DBList { get; set; }
public virtual DbSet<TBL_UTS_Manage_Company> TBL_UTS_Manage_Company { get; set; }
}
}

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