添加项目文件。
This commit is contained in:
1 parent
3a3d7f954e
commit
82f6238ba4
108 files changed
+12940
No files matched your search
@@ -0,0 +1,29 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class Alarms
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Category { get; set; }
|
||||||
|
public string Variable { get; set; }
|
||||||
|
public System.DateTime StartTime { get; set; }
|
||||||
|
public System.DateTime EndTime { get; set; }
|
||||||
|
public double Duration { get; set; }
|
||||||
|
public string Shift { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
<?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>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||||
|
</startup>
|
||||||
|
<entityFramework>
|
||||||
|
<providers>
|
||||||
|
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||||
|
</providers>
|
||||||
|
</entityFramework>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="CommonServiceLocator" publicKeyToken="489b6accfaf20ef0" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-2.0.6.0" newVersion="2.0.6.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
<connectionStrings>
|
||||||
|
<add name="BatchDyeingCentralEntities" connectionString="metadata=res://*/BatchDyeingCentral.csdl|res://*/BatchDyeingCentral.ssdl|res://*/BatchDyeingCentral.msl;provider=System.Data.SqlClient;provider connection string="data source=scddns.f3322.net\EXPRESS,21344;initial catalog=BatchDyeingCentral;user id=sa;password=SC971216@server;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
|
||||||
|
<add name="TicketEntities" connectionString="metadata=res://*/Ticket.csdl|res://*/Ticket.ssdl|res://*/Ticket.msl;provider=System.Data.SqlClient;provider connection string="data source=scddns.f3322.net\EXPRESS,21344;initial catalog=Ticket;user id=sa;password=SC971216@server;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
|
||||||
|
</connectionStrings>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<Application x:Class="Audit.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Audit" StartupUri="MainWindow.xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" d1p1:Ignorable="d" xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006">
|
||||||
|
<Application.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" xmlns:vm="clr-namespace:Audit.ViewModel" />
|
||||||
|
</ResourceDictionary>
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// App.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class App : Application
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
+445
@@ -0,0 +1,445 @@
|
|||||||
|
<?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>{43516CC3-DB11-401F-AC40-94676C508BB9}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>Audit</RootNamespace>
|
||||||
|
<AssemblyName>Audit</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<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' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="CommonServiceLocator, Version=2.0.6.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
|
||||||
|
<HintPath>packages\CommonServiceLocator.2.0.6\lib\net48\CommonServiceLocator.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="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
|
||||||
|
<HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
|
||||||
|
<HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
|
||||||
|
<HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Runtime.Serialization" />
|
||||||
|
<Reference Include="System.Security" />
|
||||||
|
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xaml">
|
||||||
|
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="WindowsBase" />
|
||||||
|
<Reference Include="PresentationCore" />
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ApplicationDefinition Include="App.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</ApplicationDefinition>
|
||||||
|
<Compile Include="Alarms.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="AuxDslvQueue.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="AuxDslvQueueHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="BatchDyeingCentral.Context.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>BatchDyeingCentral.Context.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="BatchDyeingCentral.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="BatchDyeingCentral.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>BatchDyeingCentral.edmx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="BucketInfo.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="BucketShelf.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="BucketShelfHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="BucketShelfQueue.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="BucketShelfQueueHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="CHEMICAL_QUEUE.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="CleanDevice.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Customize.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Delays.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DispenserEvent.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DispenserLifeStatus.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Dispensers.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DispenserUtilization.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotBuckets.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotBucketsHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotBucketSummary.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotDetail.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotDslvQueue.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotDslvQueueHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotHead.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotHistories.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Dyelots.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotsBatch.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotsBulkedRecipe.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotsBulkedRecipeHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotsByShift.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotsHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotsInAuto.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DyelotsInAutoHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DYESTUFF_QUEUE.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="EventList.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="JOBTKT.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="LA571Tanks.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="LabDyeDslvQueue.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="LabDyeDslvQueueHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Machines.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="MachinesHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="MachineState.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="MachineStateHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="ManualWeightQueue.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="ManualWeightQueueHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="PartsStatus.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="PartsStatusHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="PipeFill.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="PipeHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Pipes.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="POWDER_QUEUE.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Product.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="ProductInventory.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="ProductUsed.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="ProgramGroups.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Programs.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="ProgramsUsed.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="RecipeDeduct.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="RecipeDeductHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="record.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="REMOTETERMINAL.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="RFIDRecordQueue.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="RFIDRecordQueueHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="SampleDyeDslvQueue.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="SampleDyeDslvQueueHistory.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="SchedulingLog.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Shelf.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Steps.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="StepVisits.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Stoppages.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="TagShelf.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="TEMPCHEMICALTKT.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="TEMPDYESTUFFTKT.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="TEMPPOWDER.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Ticket.Context.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Ticket.Context.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Ticket.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Ticket.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Ticket.edmx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="TicketSerial.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="TICKET_DETAIL.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="UserAccount.cs">
|
||||||
|
<DependentUpon>Ticket.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="UserGroup.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Users.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="ViewModel\MainViewModel.cs" />
|
||||||
|
<Compile Include="ViewModel\ViewModelLocator.cs" />
|
||||||
|
<Compile Include="WaitChemical.cs">
|
||||||
|
<DependentUpon>BatchDyeingCentral.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Page Include="MainWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Compile Include="App.xaml.cs">
|
||||||
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="MainWindow.xaml.cs">
|
||||||
|
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EntityDeploy Include="BatchDyeingCentral.edmx">
|
||||||
|
<Generator>EntityModelCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>BatchDyeingCentral.Designer.cs</LastGenOutput>
|
||||||
|
</EntityDeploy>
|
||||||
|
<None Include="BatchDyeingCentral.edmx.diagram">
|
||||||
|
<DependentUpon>BatchDyeingCentral.edmx</DependentUpon>
|
||||||
|
</None>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<EntityDeploy Include="Ticket.edmx">
|
||||||
|
<Generator>EntityModelCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Ticket.Designer.cs</LastGenOutput>
|
||||||
|
</EntityDeploy>
|
||||||
|
<None Include="Ticket.edmx.diagram">
|
||||||
|
<DependentUpon>Ticket.edmx</DependentUpon>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="BatchDyeingCentral.Context.tt">
|
||||||
|
<Generator>TextTemplatingFileGenerator</Generator>
|
||||||
|
<LastGenOutput>BatchDyeingCentral.Context.cs</LastGenOutput>
|
||||||
|
<DependentUpon>BatchDyeingCentral.edmx</DependentUpon>
|
||||||
|
</Content>
|
||||||
|
<Content Include="BatchDyeingCentral.tt">
|
||||||
|
<Generator>TextTemplatingFileGenerator</Generator>
|
||||||
|
<DependentUpon>BatchDyeingCentral.edmx</DependentUpon>
|
||||||
|
<LastGenOutput>BatchDyeingCentral.cs</LastGenOutput>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Ticket.Context.tt">
|
||||||
|
<Generator>TextTemplatingFileGenerator</Generator>
|
||||||
|
<DependentUpon>Ticket.edmx</DependentUpon>
|
||||||
|
<LastGenOutput>Ticket.Context.cs</LastGenOutput>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Ticket.tt">
|
||||||
|
<Generator>TextTemplatingFileGenerator</Generator>
|
||||||
|
<DependentUpon>Ticket.edmx</DependentUpon>
|
||||||
|
<LastGenOutput>Ticket.cs</LastGenOutput>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<WCFMetadata Include="Connected Services\" />
|
||||||
|
</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>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.0.32014.148
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Audit", "Audit.csproj", "{43516CC3-DB11-401F-AC40-94676C508BB9}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{43516CC3-DB11-401F-AC40-94676C508BB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{43516CC3-DB11-401F-AC40-94676C508BB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{43516CC3-DB11-401F-AC40-94676C508BB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{43516CC3-DB11-401F-AC40-94676C508BB9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {82049DD6-BD0B-41E6-B77E-51EB8BC3C9C7}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class AuxDslvQueue
|
||||||
|
{
|
||||||
|
public Nullable<int> TankNo { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string Station { get; set; }
|
||||||
|
public Nullable<int> Industry { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public string Volume { get; set; }
|
||||||
|
public Nullable<int> ShelfID { get; set; }
|
||||||
|
public Nullable<System.DateTime> Updated { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class AuxDslvQueueHistory
|
||||||
|
{
|
||||||
|
public Nullable<int> TankNo { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string Station { get; set; }
|
||||||
|
public Nullable<int> Industry { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public string Volume { get; set; }
|
||||||
|
public Nullable<int> ShelfID { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity;
|
||||||
|
using System.Data.Entity.Infrastructure;
|
||||||
|
|
||||||
|
public partial class BatchDyeingCentralEntities : DbContext
|
||||||
|
{
|
||||||
|
public BatchDyeingCentralEntities()
|
||||||
|
: base("name=BatchDyeingCentralEntities")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
throw new UnintentionalCodeFirstException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual DbSet<Alarms> Alarms { get; set; }
|
||||||
|
public virtual DbSet<Customize> Customize { get; set; }
|
||||||
|
public virtual DbSet<Delays> Delays { get; set; }
|
||||||
|
public virtual DbSet<DyelotHead> DyelotHead { get; set; }
|
||||||
|
public virtual DbSet<DyelotHistories> DyelotHistories { get; set; }
|
||||||
|
public virtual DbSet<Dyelots> Dyelots { get; set; }
|
||||||
|
public virtual DbSet<DyelotsByShift> DyelotsByShift { get; set; }
|
||||||
|
public virtual DbSet<Machines> Machines { get; set; }
|
||||||
|
public virtual DbSet<MachineState> MachineState { get; set; }
|
||||||
|
public virtual DbSet<ProgramGroups> ProgramGroups { get; set; }
|
||||||
|
public virtual DbSet<Programs> Programs { get; set; }
|
||||||
|
public virtual DbSet<ProgramsUsed> ProgramsUsed { get; set; }
|
||||||
|
public virtual DbSet<record> record { get; set; }
|
||||||
|
public virtual DbSet<SchedulingLog> SchedulingLog { get; set; }
|
||||||
|
public virtual DbSet<Steps> Steps { get; set; }
|
||||||
|
public virtual DbSet<StepVisits> StepVisits { get; set; }
|
||||||
|
public virtual DbSet<Stoppages> Stoppages { get; set; }
|
||||||
|
public virtual DbSet<Users> Users { get; set; }
|
||||||
|
public virtual DbSet<AuxDslvQueue> AuxDslvQueue { get; set; }
|
||||||
|
public virtual DbSet<AuxDslvQueueHistory> AuxDslvQueueHistory { get; set; }
|
||||||
|
public virtual DbSet<BucketInfo> BucketInfo { get; set; }
|
||||||
|
public virtual DbSet<BucketShelf> BucketShelf { get; set; }
|
||||||
|
public virtual DbSet<BucketShelfHistory> BucketShelfHistory { get; set; }
|
||||||
|
public virtual DbSet<BucketShelfQueue> BucketShelfQueue { get; set; }
|
||||||
|
public virtual DbSet<BucketShelfQueueHistory> BucketShelfQueueHistory { get; set; }
|
||||||
|
public virtual DbSet<CleanDevice> CleanDevice { get; set; }
|
||||||
|
public virtual DbSet<DispenserEvent> DispenserEvent { get; set; }
|
||||||
|
public virtual DbSet<DispenserLifeStatus> DispenserLifeStatus { get; set; }
|
||||||
|
public virtual DbSet<Dispensers> Dispensers { get; set; }
|
||||||
|
public virtual DbSet<DispenserUtilization> DispenserUtilization { get; set; }
|
||||||
|
public virtual DbSet<DyelotBuckets> DyelotBuckets { get; set; }
|
||||||
|
public virtual DbSet<DyelotBucketsHistory> DyelotBucketsHistory { get; set; }
|
||||||
|
public virtual DbSet<DyelotBucketSummary> DyelotBucketSummary { get; set; }
|
||||||
|
public virtual DbSet<DyelotDetail> DyelotDetail { get; set; }
|
||||||
|
public virtual DbSet<DyelotDslvQueue> DyelotDslvQueue { get; set; }
|
||||||
|
public virtual DbSet<DyelotDslvQueueHistory> DyelotDslvQueueHistory { get; set; }
|
||||||
|
public virtual DbSet<DyelotsBatch> DyelotsBatch { get; set; }
|
||||||
|
public virtual DbSet<DyelotsBulkedRecipe> DyelotsBulkedRecipe { get; set; }
|
||||||
|
public virtual DbSet<DyelotsBulkedRecipeHistory> DyelotsBulkedRecipeHistory { get; set; }
|
||||||
|
public virtual DbSet<DyelotsHistory> DyelotsHistory { get; set; }
|
||||||
|
public virtual DbSet<DyelotsInAuto> DyelotsInAuto { get; set; }
|
||||||
|
public virtual DbSet<DyelotsInAutoHistory> DyelotsInAutoHistory { get; set; }
|
||||||
|
public virtual DbSet<EventList> EventList { get; set; }
|
||||||
|
public virtual DbSet<LA571Tanks> LA571Tanks { get; set; }
|
||||||
|
public virtual DbSet<LabDyeDslvQueue> LabDyeDslvQueue { get; set; }
|
||||||
|
public virtual DbSet<LabDyeDslvQueueHistory> LabDyeDslvQueueHistory { get; set; }
|
||||||
|
public virtual DbSet<MachinesHistory> MachinesHistory { get; set; }
|
||||||
|
public virtual DbSet<MachineStateHistory> MachineStateHistory { get; set; }
|
||||||
|
public virtual DbSet<ManualWeightQueue> ManualWeightQueue { get; set; }
|
||||||
|
public virtual DbSet<ManualWeightQueueHistory> ManualWeightQueueHistory { get; set; }
|
||||||
|
public virtual DbSet<PartsStatus> PartsStatus { get; set; }
|
||||||
|
public virtual DbSet<PartsStatusHistory> PartsStatusHistory { get; set; }
|
||||||
|
public virtual DbSet<PipeFill> PipeFill { get; set; }
|
||||||
|
public virtual DbSet<PipeHistory> PipeHistory { get; set; }
|
||||||
|
public virtual DbSet<Pipes> Pipes { get; set; }
|
||||||
|
public virtual DbSet<RecipeDeduct> RecipeDeduct { get; set; }
|
||||||
|
public virtual DbSet<RecipeDeductHistory> RecipeDeductHistory { get; set; }
|
||||||
|
public virtual DbSet<RFIDRecordQueue> RFIDRecordQueue { get; set; }
|
||||||
|
public virtual DbSet<RFIDRecordQueueHistory> RFIDRecordQueueHistory { get; set; }
|
||||||
|
public virtual DbSet<SampleDyeDslvQueue> SampleDyeDslvQueue { get; set; }
|
||||||
|
public virtual DbSet<SampleDyeDslvQueueHistory> SampleDyeDslvQueueHistory { get; set; }
|
||||||
|
public virtual DbSet<Shelf> Shelf { get; set; }
|
||||||
|
public virtual DbSet<TagShelf> TagShelf { get; set; }
|
||||||
|
public virtual DbSet<UserGroup> UserGroup { get; set; }
|
||||||
|
public virtual DbSet<WaitChemical> WaitChemical { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,636 @@
|
|||||||
|
<#@ template language="C#" debug="false" hostspecific="true"#>
|
||||||
|
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
|
||||||
|
output extension=".cs"#><#
|
||||||
|
|
||||||
|
const string inputFile = @"BatchDyeingCentral.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#>
|
||||||
Generated
+10
@@ -0,0 +1,10 @@
|
|||||||
|
// 为模型“D:\Visual Studio\Audit\BatchDyeingCentral.edmx”启用了 T4 代码生成。
|
||||||
|
// 要启用旧代码生成功能,请将“代码生成策略”设计器属性的值
|
||||||
|
// 更改为“旧的 ObjectContext”。当在设计器中打开该模型时,此属性会出现在
|
||||||
|
// “属性”窗口中。
|
||||||
|
|
||||||
|
// 如果没有生成任何上下文和实体类,可能是因为您创建了空模型但是
|
||||||
|
// 尚未选择要使用的实体框架版本。要为您的模型生成一个上下文类和实体
|
||||||
|
// 类,请在设计器中打开该模型,右键单击设计器图面,然后
|
||||||
|
// 选择“从数据库更新模型...”、“从模型生成数据库...”或“添加代码生成
|
||||||
|
// 项...”。
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,77 @@
|
|||||||
|
<?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="cd7636d8f5c6496f8e5d2e73a26cc9f5" Name="Diagram1">
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.Alarms" Width="1.5" PointX="5.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.Customize" Width="1.5" PointX="0.75" PointY="5.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.Delays" Width="1.5" PointX="2.75" PointY="5.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotHead" Width="1.5" PointX="5.75" PointY="4.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotHistories" Width="1.5" PointX="7.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.Dyelots" Width="1.5" PointX="7.75" PointY="3.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotsByShift" Width="1.5" PointX="9.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.Machines" Width="1.5" PointX="0.75" PointY="9.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.MachineState" Width="1.5" PointX="2.75" PointY="9.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.ProgramGroups" Width="1.5" PointX="0.75" PointY="1" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.Programs" Width="1.5" PointX="3" PointY="1.5" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.ProgramsUsed" Width="1.5" PointX="9.75" PointY="4.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.record" Width="1.5" PointX="9.75" PointY="8.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.SchedulingLog" Width="1.5" PointX="11.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.Steps" Width="1.5" PointX="11.75" PointY="4.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.StepVisits" Width="1.5" PointX="11.75" PointY="9.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.Stoppages" Width="1.5" PointX="13.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.Users" Width="1.5" PointX="13.75" PointY="4.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.AuxDslvQueue" Width="1.5" PointX="13.75" PointY="7.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.AuxDslvQueueHistory" Width="1.5" PointX="13.75" PointY="11.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.BucketInfo" Width="1.5" PointX="15.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.BucketShelf" Width="1.5" PointX="2.75" PointY="15.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.BucketShelfHistory" Width="1.5" PointX="15.75" PointY="3.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.BucketShelfQueue" Width="1.5" PointX="4.75" PointY="15.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.BucketShelfQueueHistory" Width="1.5" PointX="15.75" PointY="8.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.CleanDevice" Width="1.5" PointX="15.75" PointY="12.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DispenserEvent" Width="1.5" PointX="13.75" PointY="15.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DispenserLifeStatus" Width="1.5" PointX="15.75" PointY="15.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.Dispensers" Width="1.5" PointX="9.75" PointY="16.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DispenserUtilization" Width="1.5" PointX="17.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotBuckets" Width="1.5" PointX="17.75" PointY="3.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotBucketsHistory" Width="1.5" PointX="6.75" PointY="17.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotBucketSummary" Width="1.5" PointX="17.75" PointY="7.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotDetail" Width="1.5" PointX="17.75" PointY="10.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotDslvQueue" Width="1.5" PointX="17.75" PointY="16.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotDslvQueueHistory" Width="1.5" PointX="19.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotsBatch" Width="1.5" PointX="19.75" PointY="4.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotsBulkedRecipe" Width="1.5" PointX="19.75" PointY="10.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotsBulkedRecipeHistory" Width="1.5" PointX="2.75" PointY="20.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotsHistory" Width="1.5" PointX="11.75" PointY="20.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotsInAuto" Width="1.5" PointX="13.75" PointY="20.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.DyelotsInAutoHistory" Width="1.5" PointX="15.75" PointY="20.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.EventList" Width="1.5" PointX="21.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.LA571Tanks" Width="1.5" PointX="21.75" PointY="3.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.LabDyeDslvQueue" Width="1.5" PointX="4.75" PointY="21.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.LabDyeDslvQueueHistory" Width="1.5" PointX="21.75" PointY="6.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.MachinesHistory" Width="1.5" PointX="6.75" PointY="21.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.MachineStateHistory" Width="1.5" PointX="8.75" PointY="21.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.ManualWeightQueue" Width="1.5" PointX="21.75" PointY="10.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.ManualWeightQueueHistory" Width="1.5" PointX="21.75" PointY="14.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.PartsStatus" Width="1.5" PointX="21.75" PointY="18.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.PartsStatusHistory" Width="1.5" PointX="23.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.PipeFill" Width="1.5" PointX="23.75" PointY="5.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.PipeHistory" Width="1.5" PointX="23.75" PointY="9.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.Pipes" Width="1.5" PointX="23.75" PointY="13.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.RecipeDeduct" Width="1.5" PointX="23.75" PointY="18.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.RecipeDeductHistory" Width="1.5" PointX="21.75" PointY="23.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.RFIDRecordQueue" Width="1.5" PointX="23.75" PointY="22.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.RFIDRecordQueueHistory" Width="1.5" PointX="13.75" PointY="24.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.SampleDyeDslvQueue" Width="1.5" PointX="15.75" PointY="24.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.SampleDyeDslvQueueHistory" Width="1.5" PointX="17.75" PointY="24.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.Shelf" Width="1.5" PointX="25.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.TagShelf" Width="1.5" PointX="25.75" PointY="3.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.UserGroup" Width="1.5" PointX="25.75" PointY="7.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="BatchDyeingCentralModel.WaitChemical" Width="1.5" PointX="25.75" PointY="10.75" IsExpanded="true" />
|
||||||
|
<AssociationConnector Association="BatchDyeingCentralModel.FKProgramGroups" ManuallyRouted="false" />
|
||||||
|
</Diagram>
|
||||||
|
</edmx:Diagrams>
|
||||||
|
</edmx:Designer>
|
||||||
|
</edmx:Edmx>
|
||||||
@@ -0,0 +1,733 @@
|
|||||||
|
<#@ template language="C#" debug="false" hostspecific="true"#>
|
||||||
|
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
|
||||||
|
output extension=".cs"#><#
|
||||||
|
|
||||||
|
const string inputFile = @"BatchDyeingCentral.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class BucketInfo
|
||||||
|
{
|
||||||
|
public int BucketNo { get; set; }
|
||||||
|
public string DID { get; set; }
|
||||||
|
public Nullable<System.DateTime> StartTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> EndTime { get; set; }
|
||||||
|
public Nullable<int> Used { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class BucketShelf
|
||||||
|
{
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public Nullable<int> ShelfID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string Station { get; set; }
|
||||||
|
public string DID { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> DevideNo { get; set; }
|
||||||
|
public Nullable<int> XPos { get; set; }
|
||||||
|
public Nullable<int> YPos { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<System.DateTime> OnShelfTime { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class BucketShelfHistory
|
||||||
|
{
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public Nullable<int> ShelfID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string Station { get; set; }
|
||||||
|
public string DID { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> DevideNo { get; set; }
|
||||||
|
public Nullable<int> XPos { get; set; }
|
||||||
|
public Nullable<int> YPos { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<System.DateTime> OnShelfTime { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class BucketShelfQueue
|
||||||
|
{
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public Nullable<int> ShelfID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> DevideNo { get; set; }
|
||||||
|
public Nullable<int> XPos { get; set; }
|
||||||
|
public Nullable<int> YPos { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<System.DateTime> Updated { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class BucketShelfQueueHistory
|
||||||
|
{
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public Nullable<int> ShelfID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> DevideNo { get; set; }
|
||||||
|
public Nullable<int> XPos { get; set; }
|
||||||
|
public Nullable<int> YPos { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class CHEMICAL_QUEUE
|
||||||
|
{
|
||||||
|
public string tmp_field { get; set; }
|
||||||
|
public string ID_NO { get; set; }
|
||||||
|
public Nullable<int> STEP_NO { get; set; }
|
||||||
|
public string CREATE_DATE { get; set; }
|
||||||
|
public string CREATE_TIME { get; set; }
|
||||||
|
public string FIRST_KEY { get; set; }
|
||||||
|
public string SECOND_KEY { get; set; }
|
||||||
|
public Nullable<int> PRIORITY { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class CleanDevice
|
||||||
|
{
|
||||||
|
public string ID { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<int> Enabled { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class Customize
|
||||||
|
{
|
||||||
|
public int AutoKey { get; set; }
|
||||||
|
public string StoppageReasons { get; set; }
|
||||||
|
public string Inefficiencies { get; set; }
|
||||||
|
public string Company { get; set; }
|
||||||
|
public string Shifts { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DYESTUFF_QUEUE
|
||||||
|
{
|
||||||
|
public string tmp_field { get; set; }
|
||||||
|
public string ID_NO { get; set; }
|
||||||
|
public Nullable<int> STEP_NO { get; set; }
|
||||||
|
public string CREATE_DATE { get; set; }
|
||||||
|
public string CREATE_TIME { get; set; }
|
||||||
|
public string FIRST_KEY { get; set; }
|
||||||
|
public string SECOND_KEY { get; set; }
|
||||||
|
public Nullable<int> PRIORITY { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class Delays
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public int Number { get; set; }
|
||||||
|
public System.DateTime StartTime { get; set; }
|
||||||
|
public System.DateTime EndTime { get; set; }
|
||||||
|
public double Duration { get; set; }
|
||||||
|
public string Shift { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DispenserEvent
|
||||||
|
{
|
||||||
|
public int EventID { get; set; }
|
||||||
|
public Nullable<int> EventType { get; set; }
|
||||||
|
public string Dispenser { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public Nullable<int> ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> Code { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public string Description_BIG { get; set; }
|
||||||
|
public string Description_GB { get; set; }
|
||||||
|
public Nullable<System.DateTime> CreateDate { get; set; }
|
||||||
|
public Nullable<System.DateTime> ConfirmDate { get; set; }
|
||||||
|
public Nullable<System.DateTime> FinishDate { get; set; }
|
||||||
|
public string Shift { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DispenserLifeStatus
|
||||||
|
{
|
||||||
|
public string Dispenser { get; set; }
|
||||||
|
public Nullable<int> HeartBeat { get; set; }
|
||||||
|
public Nullable<System.DateTime> UpdateDate { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DispenserUtilization
|
||||||
|
{
|
||||||
|
public string Dispenser { get; set; }
|
||||||
|
public Nullable<System.DateTime> UtilDate { get; set; }
|
||||||
|
public Nullable<int> UtilTimes { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class Dispensers
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public string Device { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public Nullable<int> ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string Station { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public string Status { get; set; }
|
||||||
|
public Nullable<int> Automatic { get; set; }
|
||||||
|
public Nullable<int> Enabled { get; set; }
|
||||||
|
public Nullable<int> HeartBeat { get; set; }
|
||||||
|
public Nullable<int> CheckPeriod { get; set; }
|
||||||
|
public Nullable<System.DateTime> UpdateDate { get; set; }
|
||||||
|
public Nullable<System.DateTime> CreateDate { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotBucketSummary
|
||||||
|
{
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> Final { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotBuckets
|
||||||
|
{
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> DevideNo { get; set; }
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public string DID { get; set; }
|
||||||
|
public Nullable<int> Final { get; set; }
|
||||||
|
public Nullable<int> Dissolved { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotBucketsHistory
|
||||||
|
{
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> DevideNo { get; set; }
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public string DID { get; set; }
|
||||||
|
public Nullable<int> Final { get; set; }
|
||||||
|
public Nullable<int> Dissolved { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotDetail
|
||||||
|
{
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string Station { get; set; }
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public string ProductName { get; set; }
|
||||||
|
public int ProductType { get; set; }
|
||||||
|
public Nullable<double> Grams { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
public Nullable<int> SN { get; set; }
|
||||||
|
public Nullable<System.DateTime> DispenseTime { get; set; }
|
||||||
|
public Nullable<double> DispenseGrams { get; set; }
|
||||||
|
public Nullable<double> CurrDispGrams { get; set; }
|
||||||
|
public Nullable<int> LADispenseResult { get; set; }
|
||||||
|
public Nullable<int> Error { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
public string Volume { get; set; }
|
||||||
|
public Nullable<int> CurrDispTime { get; set; }
|
||||||
|
public string CurrVolume { get; set; }
|
||||||
|
public string RemainVolume { get; set; }
|
||||||
|
public Nullable<double> FinalPickup { get; set; }
|
||||||
|
public Nullable<int> LFManual { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotDslvQueue
|
||||||
|
{
|
||||||
|
public Nullable<int> TankNo { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> DivideNo { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<int> ShelfID { get; set; }
|
||||||
|
public Nullable<System.DateTime> SchDispenseTime { get; set; }
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public Nullable<System.DateTime> Updated { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotDslvQueueHistory
|
||||||
|
{
|
||||||
|
public Nullable<int> TankNo { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> DivideNo { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<int> ShelfID { get; set; }
|
||||||
|
public Nullable<System.DateTime> SchDispenseTime { get; set; }
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotHead
|
||||||
|
{
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<System.DateTime> StartTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> EndTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> CreationTime { get; set; }
|
||||||
|
public string TotalVolume { get; set; }
|
||||||
|
public Nullable<int> DispenseTimes { get; set; }
|
||||||
|
public Nullable<int> CurrDispTime { get; set; }
|
||||||
|
public string CurrTotalVolume { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<short> Sequence { get; set; }
|
||||||
|
public Nullable<int> Color { get; set; }
|
||||||
|
public Nullable<double> PickUp { get; set; }
|
||||||
|
public Nullable<double> GramsYard { get; set; }
|
||||||
|
public Nullable<double> TotalLength { get; set; }
|
||||||
|
public Nullable<double> FabricWidth { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
public string RefTotalVolume { get; set; }
|
||||||
|
public string RestVolume { get; set; }
|
||||||
|
public string LFDefine { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public Nullable<int> Blocked { get; set; }
|
||||||
|
public Nullable<int> Industry { get; set; }
|
||||||
|
public string Volume { get; set; }
|
||||||
|
public Nullable<double> StandardTime { get; set; }
|
||||||
|
public Nullable<int> LFArt { get; set; }
|
||||||
|
public string RemainVolume { get; set; }
|
||||||
|
public Nullable<double> FinalPickUp { get; set; }
|
||||||
|
public Nullable<int> LFWasher { get; set; }
|
||||||
|
public string ActualTotalVolume { get; set; }
|
||||||
|
public Nullable<double> ActualTotalLength { get; set; }
|
||||||
|
public Nullable<double> UsedPickup { get; set; }
|
||||||
|
public string RemainPadderVol { get; set; }
|
||||||
|
public Nullable<System.DateTime> ExecuteTime { get; set; }
|
||||||
|
public string RealAdd1 { get; set; }
|
||||||
|
public string RealAdd2 { get; set; }
|
||||||
|
public string RealAdd3 { get; set; }
|
||||||
|
public string RealAdd4 { get; set; }
|
||||||
|
public string RealAdd5 { get; set; }
|
||||||
|
public string PromptAdd1 { get; set; }
|
||||||
|
public string PromptAdd2 { get; set; }
|
||||||
|
public string PromptAdd3 { get; set; }
|
||||||
|
public string PromptAdd4 { get; set; }
|
||||||
|
public string PromptAdd5 { get; set; }
|
||||||
|
public Nullable<int> StartButton { get; set; }
|
||||||
|
public Nullable<int> EndButton { get; set; }
|
||||||
|
public string MergerVol { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotHistories
|
||||||
|
{
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public byte[] History { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
+83
@@ -0,0 +1,83 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class Dyelots
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> Industry { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public string DispenseMachine { get; set; }
|
||||||
|
public Nullable<System.DateTime> StartTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> EndTime { get; set; }
|
||||||
|
public Nullable<double> StandardTime { get; set; }
|
||||||
|
public Nullable<int> TotalShot { get; set; }
|
||||||
|
public Nullable<short> State { get; set; }
|
||||||
|
public Nullable<short> Blocked { get; set; }
|
||||||
|
public string Program { get; set; }
|
||||||
|
public Nullable<int> Color { get; set; }
|
||||||
|
public Nullable<System.DateTime> CreationTime { get; set; }
|
||||||
|
public string Batch { get; set; }
|
||||||
|
public string OrderNo { get; set; }
|
||||||
|
public Nullable<double> TotalWeight { get; set; }
|
||||||
|
public string LiquidRatio { get; set; }
|
||||||
|
public string TotalVolume { get; set; }
|
||||||
|
public Nullable<int> AcidQty { get; set; }
|
||||||
|
public Nullable<int> ActualAcidQty { get; set; }
|
||||||
|
public Nullable<int> Sequence { get; set; }
|
||||||
|
public Nullable<int> DispenseMode { get; set; }
|
||||||
|
public Nullable<int> DyeDissolve { get; set; }
|
||||||
|
public Nullable<int> CheDissolve { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> SpcTotalBuckets { get; set; }
|
||||||
|
public Nullable<int> DissolveMethod { get; set; }
|
||||||
|
public string ReferenceDyelot { get; set; }
|
||||||
|
public Nullable<int> Final { get; set; }
|
||||||
|
public Nullable<int> Shade { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
public string FabricName { get; set; }
|
||||||
|
public string ColorName { get; set; }
|
||||||
|
public string CustomerName { get; set; }
|
||||||
|
public string CUSTOMER_CODE { get; set; }
|
||||||
|
public string FABRIC_CODE { get; set; }
|
||||||
|
public Nullable<double> GRAMS_YARD { get; set; }
|
||||||
|
public Nullable<int> NeedDissolving { get; set; }
|
||||||
|
public Nullable<System.DateTime> EarliestStartTime { get; set; }
|
||||||
|
public Nullable<short> Committed { get; set; }
|
||||||
|
public string Parameters { get; set; }
|
||||||
|
public string Notes { get; set; }
|
||||||
|
public Nullable<short> SummarizeResult { get; set; }
|
||||||
|
public string ProgramsUsed { get; set; }
|
||||||
|
public string ColorNo { get; set; }
|
||||||
|
public Nullable<System.DateTime> ModifyDT { get; set; }
|
||||||
|
public Nullable<System.DateTime> CreateDT { get; set; }
|
||||||
|
public Nullable<int> Yard { get; set; }
|
||||||
|
public string SheetNo { get; set; }
|
||||||
|
public Nullable<double> AlarmTime { get; set; }
|
||||||
|
public string ExRead { get; set; }
|
||||||
|
public string FactoryTicketNo { get; set; }
|
||||||
|
public string DyeingBatch { get; set; }
|
||||||
|
public string EOCAlarms { get; set; }
|
||||||
|
public Nullable<double> RunTime { get; set; }
|
||||||
|
public Nullable<double> ProcessTime { get; set; }
|
||||||
|
public Nullable<double> NormalTime { get; set; }
|
||||||
|
public Nullable<double> SleepTime { get; set; }
|
||||||
|
public Nullable<double> DelayTime { get; set; }
|
||||||
|
public string EOCDelays { get; set; }
|
||||||
|
public Nullable<short> DyelotStartShift { get; set; }
|
||||||
|
public Nullable<short> DyelotEndShift { get; set; }
|
||||||
|
public short DyeDissolving { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotsBatch
|
||||||
|
{
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string Station { get; set; }
|
||||||
|
public Nullable<int> ShotNo { get; set; }
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public Nullable<int> SN { get; set; }
|
||||||
|
public Nullable<double> Grams { get; set; }
|
||||||
|
public Nullable<System.DateTime> DispenseStartTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> DispenseEndTime { get; set; }
|
||||||
|
public Nullable<double> DispenseGrams { get; set; }
|
||||||
|
public Nullable<int> LADispenseResult { get; set; }
|
||||||
|
public Nullable<System.DateTime> DyeWeightTime { get; set; }
|
||||||
|
public string Process { get; set; }
|
||||||
|
public string FinalProcess { get; set; }
|
||||||
|
public Nullable<int> DispenseWater { get; set; }
|
||||||
|
public Nullable<int> DrainWater { get; set; }
|
||||||
|
public Nullable<int> DissolveTemperature { get; set; }
|
||||||
|
public Nullable<System.DateTime> SchDispenseTime { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotsBulkedRecipe
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string Station { get; set; }
|
||||||
|
public Nullable<int> DevideNo { get; set; }
|
||||||
|
public Nullable<int> ShotNo { get; set; }
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public string ProductName { get; set; }
|
||||||
|
public Nullable<int> ProductType { get; set; }
|
||||||
|
public string ProductLot { get; set; }
|
||||||
|
public Nullable<int> ProductClass { get; set; }
|
||||||
|
public Nullable<int> SN { get; set; }
|
||||||
|
public string Amount { get; set; }
|
||||||
|
public Nullable<double> Grams { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
public Nullable<System.DateTime> DispenseStartTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> DispenseEndTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> DispenseTime { get; set; }
|
||||||
|
public Nullable<double> DispenseGrams { get; set; }
|
||||||
|
public Nullable<int> DispenseResult { get; set; }
|
||||||
|
public Nullable<int> LADispenseResult { get; set; }
|
||||||
|
public string Volume { get; set; }
|
||||||
|
public Nullable<int> HostRead { get; set; }
|
||||||
|
public string State { get; set; }
|
||||||
|
public Nullable<int> NeedDispense { get; set; }
|
||||||
|
public Nullable<int> MixTankNo { get; set; }
|
||||||
|
public Nullable<System.DateTime> DyeWeightTime { get; set; }
|
||||||
|
public string Process { get; set; }
|
||||||
|
public string FinalProcess { get; set; }
|
||||||
|
public string Dispenser { get; set; }
|
||||||
|
public Nullable<int> TankNo { get; set; }
|
||||||
|
public Nullable<int> Error { get; set; }
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public string DID { get; set; }
|
||||||
|
public Nullable<int> StepDevideNo { get; set; }
|
||||||
|
public Nullable<int> StepTotalBuckets { get; set; }
|
||||||
|
public string ReferenceDyelot { get; set; }
|
||||||
|
public Nullable<int> DispenseWater { get; set; }
|
||||||
|
public Nullable<int> DrainWater { get; set; }
|
||||||
|
public Nullable<int> DissolveTemperature { get; set; }
|
||||||
|
public Nullable<System.DateTime> SchDispenseTime { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
public Nullable<int> TargetGrams { get; set; }
|
||||||
|
public Nullable<int> ActualGrams { get; set; }
|
||||||
|
public Nullable<System.DateTime> FinishTime { get; set; }
|
||||||
|
public string Tagged { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> Final { get; set; }
|
||||||
|
public Nullable<int> DissolveManual { get; set; }
|
||||||
|
public Nullable<double> Concentration { get; set; }
|
||||||
|
public Nullable<int> DeductTotalBuckets { get; set; }
|
||||||
|
public Nullable<int> DeductBuckets { get; set; }
|
||||||
|
public Nullable<double> Kilograms { get; set; }
|
||||||
|
public Nullable<double> DKilograms { get; set; }
|
||||||
|
public Nullable<int> DyelotID { get; set; }
|
||||||
|
public Nullable<int> MixTemperature { get; set; }
|
||||||
|
public Nullable<int> MixVolume { get; set; }
|
||||||
|
public Nullable<int> MixTime { get; set; }
|
||||||
|
public Nullable<int> MixWater { get; set; }
|
||||||
|
public Nullable<int> RoWater { get; set; }
|
||||||
|
public string Notes { get; set; }
|
||||||
|
public Nullable<int> ProductIndex { get; set; }
|
||||||
|
public double GRAVITY { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotsBulkedRecipeHistory
|
||||||
|
{
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string Station { get; set; }
|
||||||
|
public Nullable<int> DevideNo { get; set; }
|
||||||
|
public Nullable<int> ShotNo { get; set; }
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public string ProductName { get; set; }
|
||||||
|
public Nullable<int> ProductType { get; set; }
|
||||||
|
public string ProductLot { get; set; }
|
||||||
|
public Nullable<int> ProductClass { get; set; }
|
||||||
|
public Nullable<int> SN { get; set; }
|
||||||
|
public string Amount { get; set; }
|
||||||
|
public Nullable<double> Grams { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
public Nullable<System.DateTime> DispenseStartTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> DispenseEndTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> DispenseTime { get; set; }
|
||||||
|
public Nullable<double> DispenseGrams { get; set; }
|
||||||
|
public Nullable<int> DispenseResult { get; set; }
|
||||||
|
public Nullable<int> LADispenseResult { get; set; }
|
||||||
|
public string Volume { get; set; }
|
||||||
|
public Nullable<int> HostRead { get; set; }
|
||||||
|
public string State { get; set; }
|
||||||
|
public Nullable<int> NeedDispense { get; set; }
|
||||||
|
public Nullable<int> MixTankNo { get; set; }
|
||||||
|
public Nullable<System.DateTime> DyeWeightTime { get; set; }
|
||||||
|
public string Process { get; set; }
|
||||||
|
public string FinalProcess { get; set; }
|
||||||
|
public string Dispenser { get; set; }
|
||||||
|
public Nullable<int> TankNo { get; set; }
|
||||||
|
public Nullable<int> Error { get; set; }
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public string DID { get; set; }
|
||||||
|
public Nullable<int> StepDevideNo { get; set; }
|
||||||
|
public Nullable<int> StepTotalBuckets { get; set; }
|
||||||
|
public string ReferenceDyelot { get; set; }
|
||||||
|
public Nullable<int> DispenseWater { get; set; }
|
||||||
|
public Nullable<int> DrainWater { get; set; }
|
||||||
|
public Nullable<int> DissolveTemperature { get; set; }
|
||||||
|
public Nullable<System.DateTime> SchDispenseTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> FinishTime { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
public Nullable<System.DateTime> Updated { get; set; }
|
||||||
|
public string Tagged { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> Final { get; set; }
|
||||||
|
public Nullable<int> DissolveManual { get; set; }
|
||||||
|
public Nullable<int> DeductTotalBuckets { get; set; }
|
||||||
|
public Nullable<int> DeductBuckets { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotsByShift
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public System.DateTime StartTime { get; set; }
|
||||||
|
public System.DateTime EndTime { get; set; }
|
||||||
|
public double Duration { get; set; }
|
||||||
|
public string Shift { get; set; }
|
||||||
|
public string SingleShift { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotsHistory
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> Industry { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public string DispenseMachine { get; set; }
|
||||||
|
public Nullable<System.DateTime> StartTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> EndTime { get; set; }
|
||||||
|
public Nullable<double> StandardTime { get; set; }
|
||||||
|
public Nullable<int> TotalShot { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<int> Blocked { get; set; }
|
||||||
|
public string Program { get; set; }
|
||||||
|
public Nullable<int> Color { get; set; }
|
||||||
|
public Nullable<System.DateTime> CreationTime { get; set; }
|
||||||
|
public string Batch { get; set; }
|
||||||
|
public string OrderNo { get; set; }
|
||||||
|
public Nullable<double> TotalWeight { get; set; }
|
||||||
|
public string LiquidRatio { get; set; }
|
||||||
|
public string TotalVolume { get; set; }
|
||||||
|
public Nullable<int> AcidQty { get; set; }
|
||||||
|
public Nullable<int> ActualAcidQty { get; set; }
|
||||||
|
public Nullable<int> Sequence { get; set; }
|
||||||
|
public Nullable<int> DispenseMode { get; set; }
|
||||||
|
public Nullable<int> DyeDissolve { get; set; }
|
||||||
|
public Nullable<int> CheDissolve { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> SpcTotalBuckets { get; set; }
|
||||||
|
public Nullable<int> DissolveMethod { get; set; }
|
||||||
|
public string ReferenceDyelot { get; set; }
|
||||||
|
public Nullable<int> Final { get; set; }
|
||||||
|
public Nullable<int> Shade { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
public Nullable<System.DateTime> Updated { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotsInAuto
|
||||||
|
{
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public Nullable<int> ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> DyeState { get; set; }
|
||||||
|
public Nullable<System.DateTime> SchDispenseTime { get; set; }
|
||||||
|
public Nullable<int> IsCheck { get; set; }
|
||||||
|
public Nullable<int> Shade { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class DyelotsInAutoHistory
|
||||||
|
{
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public Nullable<int> ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> DyeState { get; set; }
|
||||||
|
public Nullable<System.DateTime> SchDispenseTime { get; set; }
|
||||||
|
public Nullable<int> IsCheck { get; set; }
|
||||||
|
public Nullable<int> Shade { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class EventList
|
||||||
|
{
|
||||||
|
public Nullable<int> Code { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public string Description_BIG { get; set; }
|
||||||
|
public string Description_GB { get; set; }
|
||||||
|
public Nullable<System.DateTime> CreateDate { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class JOBTKT
|
||||||
|
{
|
||||||
|
public string tmp_field { get; set; }
|
||||||
|
public string IDNO { get; set; }
|
||||||
|
public Nullable<double> FNDATE { get; set; }
|
||||||
|
public string FIRST_KEY { get; set; }
|
||||||
|
public string SECOND_KEY { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class LA571Tanks
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Station { get; set; }
|
||||||
|
public Nullable<int> Tank { get; set; }
|
||||||
|
public Nullable<double> Volume { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class LabDyeDslvQueue
|
||||||
|
{
|
||||||
|
public Nullable<int> TankNo { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<int> ShelfID { get; set; }
|
||||||
|
public Nullable<int> DistID { get; set; }
|
||||||
|
public Nullable<System.DateTime> SchDispenseTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> Updated { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class LabDyeDslvQueueHistory
|
||||||
|
{
|
||||||
|
public Nullable<int> TankNo { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<int> ShelfID { get; set; }
|
||||||
|
public Nullable<int> DistID { get; set; }
|
||||||
|
public Nullable<System.DateTime> SchDispenseTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class MachineState
|
||||||
|
{
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public string DispenseDyelot { get; set; }
|
||||||
|
public Nullable<int> DispenseReDye { get; set; }
|
||||||
|
public Nullable<int> ChemicalCallOff { get; set; }
|
||||||
|
public Nullable<int> ChemicalState { get; set; }
|
||||||
|
public Nullable<int> ChemicalTank { get; set; }
|
||||||
|
public Nullable<int> ChemicalTankSize { get; set; }
|
||||||
|
public string ChemicalDispenser { get; set; }
|
||||||
|
public Nullable<int> ChemicalError { get; set; }
|
||||||
|
public Nullable<int> ChemicalTargetSelect { get; set; }
|
||||||
|
public Nullable<int> DyeCallOff { get; set; }
|
||||||
|
public Nullable<int> DyeState { get; set; }
|
||||||
|
public Nullable<int> DyeTank { get; set; }
|
||||||
|
public Nullable<int> DyeTankSize { get; set; }
|
||||||
|
public string DyeDispenser { get; set; }
|
||||||
|
public Nullable<int> DyeError { get; set; }
|
||||||
|
public Nullable<int> PowderCallOff { get; set; }
|
||||||
|
public Nullable<int> PowderState { get; set; }
|
||||||
|
public Nullable<int> PowderTank { get; set; }
|
||||||
|
public Nullable<int> PowderTankSize { get; set; }
|
||||||
|
public string PowderDispenser { get; set; }
|
||||||
|
public Nullable<int> PowderError { get; set; }
|
||||||
|
public Nullable<int> HostRead { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class MachineStateHistory
|
||||||
|
{
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public string DispenseDyelot { get; set; }
|
||||||
|
public Nullable<int> DispenseReDye { get; set; }
|
||||||
|
public Nullable<int> ChemicalCallOff { get; set; }
|
||||||
|
public Nullable<int> ChemicalState { get; set; }
|
||||||
|
public Nullable<int> ChemicalTank { get; set; }
|
||||||
|
public Nullable<int> ChemicalTankSize { get; set; }
|
||||||
|
public string ChemicalDispenser { get; set; }
|
||||||
|
public Nullable<int> ChemicalError { get; set; }
|
||||||
|
public Nullable<int> ChemicalTargetSelect { get; set; }
|
||||||
|
public Nullable<int> DyeCallOff { get; set; }
|
||||||
|
public Nullable<int> DyeState { get; set; }
|
||||||
|
public Nullable<int> DyeTank { get; set; }
|
||||||
|
public Nullable<int> DyeTankSize { get; set; }
|
||||||
|
public string DyeDispenser { get; set; }
|
||||||
|
public Nullable<int> DyeError { get; set; }
|
||||||
|
public Nullable<int> PowderCallOff { get; set; }
|
||||||
|
public Nullable<int> PowderState { get; set; }
|
||||||
|
public Nullable<int> PowderTank { get; set; }
|
||||||
|
public Nullable<int> PowderTankSize { get; set; }
|
||||||
|
public string PowderDispenser { get; set; }
|
||||||
|
public Nullable<int> PowderError { get; set; }
|
||||||
|
public Nullable<int> HostRead { get; set; }
|
||||||
|
public Nullable<System.DateTime> Updated { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
+115
@@ -0,0 +1,115 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class Machines
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string DispenseDyelot { get; set; }
|
||||||
|
public Nullable<int> DispenseReDye { get; set; }
|
||||||
|
public string RescheduleGroup { get; set; }
|
||||||
|
public string Connect { get; set; }
|
||||||
|
public Nullable<int> ChemicalCallOff { get; set; }
|
||||||
|
public Nullable<int> ChemicalState { get; set; }
|
||||||
|
public Nullable<int> ChemicalTank { get; set; }
|
||||||
|
public Nullable<int> ChemicalTankSize { get; set; }
|
||||||
|
public Nullable<int> ChemicalEnabled { get; set; }
|
||||||
|
public string ChemicalStatus { get; set; }
|
||||||
|
public string ChemicalDispenser { get; set; }
|
||||||
|
public Nullable<int> ChemicalError { get; set; }
|
||||||
|
public Nullable<int> ChemicalDistribute { get; set; }
|
||||||
|
public string ChemicalStation { get; set; }
|
||||||
|
public Nullable<int> ChemicalDevideNo { get; set; }
|
||||||
|
public Nullable<System.DateTime> ChemicalDispensedTime { get; set; }
|
||||||
|
public Nullable<int> ChemicalDefaultTank { get; set; }
|
||||||
|
public Nullable<int> ChemicalDissolving { get; set; }
|
||||||
|
public Nullable<int> ChemicalResp { get; set; }
|
||||||
|
public Nullable<int> ChemicalCallOff2 { get; set; }
|
||||||
|
public Nullable<int> ChemicalState2 { get; set; }
|
||||||
|
public Nullable<int> ChemicalTank2 { get; set; }
|
||||||
|
public string ChemicalStatus2 { get; set; }
|
||||||
|
public Nullable<int> ChemicalResp2 { get; set; }
|
||||||
|
public Nullable<int> ChemicalTargetSelect { get; set; }
|
||||||
|
public string ChemicalTargetMachine { get; set; }
|
||||||
|
public Nullable<int> DyeCallOff { get; set; }
|
||||||
|
public Nullable<int> DyeState { get; set; }
|
||||||
|
public Nullable<int> DyeTank { get; set; }
|
||||||
|
public Nullable<int> DyeTankSize { get; set; }
|
||||||
|
public Nullable<int> DyeEnabled { get; set; }
|
||||||
|
public string DyeStatus { get; set; }
|
||||||
|
public string DyeDispenser { get; set; }
|
||||||
|
public Nullable<int> DyeError { get; set; }
|
||||||
|
public Nullable<int> DyeDistribute { get; set; }
|
||||||
|
public string DyeStation { get; set; }
|
||||||
|
public Nullable<int> DyeDevideNo { get; set; }
|
||||||
|
public Nullable<System.DateTime> DyeDispensedTime { get; set; }
|
||||||
|
public Nullable<int> DyeDefaultTank { get; set; }
|
||||||
|
public Nullable<int> DyeResp { get; set; }
|
||||||
|
public string DyeDispenseDyelot { get; set; }
|
||||||
|
public Nullable<int> DyeDispenseReDye { get; set; }
|
||||||
|
public Nullable<int> DyeDissolving { get; set; }
|
||||||
|
public Nullable<int> PowderCallOff { get; set; }
|
||||||
|
public Nullable<int> PowderState { get; set; }
|
||||||
|
public Nullable<int> PowderTank { get; set; }
|
||||||
|
public Nullable<int> PowderTankSize { get; set; }
|
||||||
|
public Nullable<int> PowderEnabled { get; set; }
|
||||||
|
public string PowderStatus { get; set; }
|
||||||
|
public string PowderDispenser { get; set; }
|
||||||
|
public Nullable<int> PowderError { get; set; }
|
||||||
|
public string PowderStation { get; set; }
|
||||||
|
public Nullable<int> PowderDevideNo { get; set; }
|
||||||
|
public Nullable<System.DateTime> PowderDispensedTime { get; set; }
|
||||||
|
public Nullable<int> PowderDefaultTank { get; set; }
|
||||||
|
public Nullable<int> PowderResp { get; set; }
|
||||||
|
public Nullable<int> HostRead { get; set; }
|
||||||
|
public string OnSystem { get; set; }
|
||||||
|
public string SystemID { get; set; }
|
||||||
|
public Nullable<System.DateTime> SchDispenseTime { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
public Nullable<int> AutoMode { get; set; }
|
||||||
|
public Nullable<int> UseOnScheduling { get; set; }
|
||||||
|
public string CheDispenseDyelot { get; set; }
|
||||||
|
public Nullable<int> CheDispenseReDye { get; set; }
|
||||||
|
public Nullable<int> SampleDye { get; set; }
|
||||||
|
public string name1 { get; set; }
|
||||||
|
public string Parameters { get; set; }
|
||||||
|
public string ProgramGroup { get; set; }
|
||||||
|
public string ReportGroup { get; set; }
|
||||||
|
public string PortAddress { get; set; }
|
||||||
|
public Nullable<short> Interrupt { get; set; }
|
||||||
|
public Nullable<short> NetworkNumber { get; set; }
|
||||||
|
public string SpecificMachineMimic { get; set; }
|
||||||
|
public Nullable<short> OutOfService { get; set; }
|
||||||
|
public Nullable<short> IsGhost { get; set; }
|
||||||
|
public Nullable<short> ManualDownloadOnly { get; set; }
|
||||||
|
public string LogicArtPort { get; set; }
|
||||||
|
public Nullable<short> GastonLoggedOn { get; set; }
|
||||||
|
public Nullable<short> DEnabled { get; set; }
|
||||||
|
public Nullable<short> DLookAhead { get; set; }
|
||||||
|
public Nullable<short> LogicArtUnlocked { get; set; }
|
||||||
|
public Nullable<short> MaximumGradient { get; set; }
|
||||||
|
public string LoggedOffReason { get; set; }
|
||||||
|
public string LoggedOffNotes { get; set; }
|
||||||
|
public Nullable<short> AutoDispense { get; set; }
|
||||||
|
public Nullable<short> AllowRemoteReschedule { get; set; }
|
||||||
|
public Nullable<short> CorrectionsAbove { get; set; }
|
||||||
|
public Nullable<short> Is161 { get; set; }
|
||||||
|
public Nullable<short> Locked { get; set; }
|
||||||
|
public Nullable<short> AutoDownloadParams { get; set; }
|
||||||
|
public Nullable<short> NoAutoDownloadMessages { get; set; }
|
||||||
|
public string TonelloIP { get; set; }
|
||||||
|
public string Test { get; set; }
|
||||||
|
public string MainTemperature { get; set; }
|
||||||
|
public Nullable<int> CallType { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class MachinesHistory
|
||||||
|
{
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public string DispenseDyelot { get; set; }
|
||||||
|
public Nullable<int> DispenseReDye { get; set; }
|
||||||
|
public Nullable<int> ChemicalCallOff { get; set; }
|
||||||
|
public Nullable<int> ChemicalState { get; set; }
|
||||||
|
public Nullable<int> ChemicalTank { get; set; }
|
||||||
|
public Nullable<int> ChemicalTankSize { get; set; }
|
||||||
|
public string ChemicalDispenser { get; set; }
|
||||||
|
public Nullable<int> ChemicalError { get; set; }
|
||||||
|
public Nullable<int> ChemicalCallOff2 { get; set; }
|
||||||
|
public Nullable<int> ChemicalState2 { get; set; }
|
||||||
|
public Nullable<int> ChemicalTank2 { get; set; }
|
||||||
|
public Nullable<int> DyeCallOff { get; set; }
|
||||||
|
public Nullable<int> DyeState { get; set; }
|
||||||
|
public Nullable<int> DyeTank { get; set; }
|
||||||
|
public Nullable<int> DyeTankSize { get; set; }
|
||||||
|
public string DyeDispenser { get; set; }
|
||||||
|
public Nullable<int> DyeError { get; set; }
|
||||||
|
public Nullable<int> PowderCallOff { get; set; }
|
||||||
|
public Nullable<int> PowderState { get; set; }
|
||||||
|
public Nullable<int> PowderTank { get; set; }
|
||||||
|
public Nullable<int> PowderTankSize { get; set; }
|
||||||
|
public string PowderDispenser { get; set; }
|
||||||
|
public Nullable<int> PowderError { get; set; }
|
||||||
|
public Nullable<int> HostRead { get; set; }
|
||||||
|
public string DyeDispenseDyelot { get; set; }
|
||||||
|
public Nullable<int> DyeDispenseReDye { get; set; }
|
||||||
|
public Nullable<System.DateTime> Updated { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<Window x:Class="Audit.MainWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:Audit"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="MainWindow" Height="450" Width="800">
|
||||||
|
<Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// MainWindow.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class MainWindow : Window
|
||||||
|
{
|
||||||
|
public MainWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class ManualWeightQueue
|
||||||
|
{
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<System.DateTime> CallTime { get; set; }
|
||||||
|
public Nullable<int> Module { get; set; }
|
||||||
|
public string ModuleName { get; set; }
|
||||||
|
public string Area { get; set; }
|
||||||
|
public Nullable<System.DateTime> EndTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> Updated { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class ManualWeightQueueHistory
|
||||||
|
{
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<System.DateTime> CallTime { get; set; }
|
||||||
|
public Nullable<int> Module { get; set; }
|
||||||
|
public string ModuleName { get; set; }
|
||||||
|
public string Area { get; set; }
|
||||||
|
public Nullable<System.DateTime> EndTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class POWDER_QUEUE
|
||||||
|
{
|
||||||
|
public string tmp_field { get; set; }
|
||||||
|
public string ID_NO { get; set; }
|
||||||
|
public Nullable<int> STEP_NO { get; set; }
|
||||||
|
public string CREATE_DATE { get; set; }
|
||||||
|
public string CREATE_TIME { get; set; }
|
||||||
|
public string FIRST_KEY { get; set; }
|
||||||
|
public string SECOND_KEY { get; set; }
|
||||||
|
public Nullable<int> PRIORITY { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class PartsStatus
|
||||||
|
{
|
||||||
|
public string CUST_CODE { get; set; }
|
||||||
|
public string Dispenser { get; set; }
|
||||||
|
public string PartsCode { get; set; }
|
||||||
|
public string PartsName { get; set; }
|
||||||
|
public Nullable<int> PartsType { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public Nullable<int> FactoryValue { get; set; }
|
||||||
|
public Nullable<int> UsedCount { get; set; }
|
||||||
|
public Nullable<int> RunningTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> ResetDate { get; set; }
|
||||||
|
public Nullable<System.DateTime> WarnDate { get; set; }
|
||||||
|
public Nullable<System.DateTime> UpdateDate { get; set; }
|
||||||
|
public Nullable<System.DateTime> CreateDate { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class PartsStatusHistory
|
||||||
|
{
|
||||||
|
public string CUST_CODE { get; set; }
|
||||||
|
public string Dispenser { get; set; }
|
||||||
|
public string PartsCode { get; set; }
|
||||||
|
public string PartsName { get; set; }
|
||||||
|
public Nullable<int> PartsType { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public Nullable<int> FactoryValue { get; set; }
|
||||||
|
public Nullable<int> UsedCount { get; set; }
|
||||||
|
public Nullable<int> RunningTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> ResetDate { get; set; }
|
||||||
|
public Nullable<System.DateTime> WarnDate { get; set; }
|
||||||
|
public Nullable<System.DateTime> UpdateDate { get; set; }
|
||||||
|
public Nullable<System.DateTime> CreateDate { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class PipeFill
|
||||||
|
{
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public string ProductName { get; set; }
|
||||||
|
public string Dispenser { get; set; }
|
||||||
|
public Nullable<int> No { get; set; }
|
||||||
|
public Nullable<double> Qty { get; set; }
|
||||||
|
public Nullable<System.DateTime> StartTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> EndTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> AlarmTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> Updated { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class PipeHistory
|
||||||
|
{
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public string ProductName { get; set; }
|
||||||
|
public Nullable<int> ProductType { get; set; }
|
||||||
|
public string Dispenser { get; set; }
|
||||||
|
public Nullable<int> No { get; set; }
|
||||||
|
public Nullable<double> Qty { get; set; }
|
||||||
|
public Nullable<System.DateTime> StartTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> EndTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> AlarmTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class Pipes
|
||||||
|
{
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public string ProductName { get; set; }
|
||||||
|
public Nullable<int> ProductType { get; set; }
|
||||||
|
public string Dispenser { get; set; }
|
||||||
|
public Nullable<int> Enabled { get; set; }
|
||||||
|
public Nullable<int> No { get; set; }
|
||||||
|
public Nullable<double> MinLimit { get; set; }
|
||||||
|
public Nullable<double> MaxLimit { get; set; }
|
||||||
|
public Nullable<int> MinAction { get; set; }
|
||||||
|
public Nullable<int> MaxAction { get; set; }
|
||||||
|
public Nullable<int> Conc { get; set; }
|
||||||
|
public double Gravity { get; set; }
|
||||||
|
public string Alarm { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
+78
@@ -0,0 +1,78 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class Product
|
||||||
|
{
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public string ProductName { get; set; }
|
||||||
|
public Nullable<double> Price { get; set; }
|
||||||
|
public Nullable<double> Deduct { get; set; }
|
||||||
|
public Nullable<double> FullWeight { get; set; }
|
||||||
|
public Nullable<int> LampPosition { get; set; }
|
||||||
|
public string TablePosition { get; set; }
|
||||||
|
public string AREA { get; set; }
|
||||||
|
public Nullable<double> SafetyStock { get; set; }
|
||||||
|
public Nullable<int> ProductUnit { get; set; }
|
||||||
|
public Nullable<int> ProductType { get; set; }
|
||||||
|
public Nullable<int> ProductClass { get; set; }
|
||||||
|
public Nullable<double> CurrentStock { get; set; }
|
||||||
|
public string ProductLot { get; set; }
|
||||||
|
public Nullable<System.DateTime> RplDate { get; set; }
|
||||||
|
public Nullable<System.DateTime> UsedDate { get; set; }
|
||||||
|
public string CuMonth { get; set; }
|
||||||
|
public Nullable<double> LaStock { get; set; }
|
||||||
|
public Nullable<double> ThStock { get; set; }
|
||||||
|
public Nullable<double> ThUsed { get; set; }
|
||||||
|
public Nullable<int> Color { get; set; }
|
||||||
|
public Nullable<double> LastTime { get; set; }
|
||||||
|
public Nullable<double> CalTime { get; set; }
|
||||||
|
public Nullable<int> BackflowTime { get; set; }
|
||||||
|
public Nullable<int> Tol_G { get; set; }
|
||||||
|
public Nullable<int> Tol_P { get; set; }
|
||||||
|
public Nullable<int> Alarm { get; set; }
|
||||||
|
public Nullable<int> Change_Bucket { get; set; }
|
||||||
|
public Nullable<int> Small_Volume_by_manual { get; set; }
|
||||||
|
public Nullable<int> Target_Weight { get; set; }
|
||||||
|
public Nullable<int> Pre_Weight { get; set; }
|
||||||
|
public Nullable<int> One_Sec { get; set; }
|
||||||
|
public Nullable<int> GetscalTime { get; set; }
|
||||||
|
public Nullable<int> DelayOpenValve { get; set; }
|
||||||
|
public string ValveMap { get; set; }
|
||||||
|
public string PumpMap { get; set; }
|
||||||
|
public Nullable<int> Includepump { get; set; }
|
||||||
|
public Nullable<int> Once_minimum_weight { get; set; }
|
||||||
|
public Nullable<int> Once_minimum_max_weight { get; set; }
|
||||||
|
public Nullable<int> Once_minimum_time { get; set; }
|
||||||
|
public string Res_S1 { get; set; }
|
||||||
|
public string Res_S2 { get; set; }
|
||||||
|
public string Res_S3 { get; set; }
|
||||||
|
public string Res_S4 { get; set; }
|
||||||
|
public Nullable<int> Res_I1 { get; set; }
|
||||||
|
public Nullable<int> Res_I2 { get; set; }
|
||||||
|
public Nullable<int> Res_I3 { get; set; }
|
||||||
|
public Nullable<int> Res_I4 { get; set; }
|
||||||
|
public Nullable<double> Res_F1 { get; set; }
|
||||||
|
public Nullable<double> Res_F2 { get; set; }
|
||||||
|
public Nullable<double> Res_F3 { get; set; }
|
||||||
|
public Nullable<double> Res_F4 { get; set; }
|
||||||
|
public string Batch_NO { get; set; }
|
||||||
|
public Nullable<double> Concentration { get; set; }
|
||||||
|
public Nullable<int> Pump { get; set; }
|
||||||
|
public Nullable<int> PRODUCT_KIND { get; set; }
|
||||||
|
public string SUPPLIER { get; set; }
|
||||||
|
public Nullable<System.DateTime> PRODUCT_MODIFY_DATE { get; set; }
|
||||||
|
public double GRAVITY { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class ProductInventory
|
||||||
|
{
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public Nullable<double> Quantity { get; set; }
|
||||||
|
public Nullable<double> Price { get; set; }
|
||||||
|
public Nullable<System.DateTime> CreateDate { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class ProductUsed
|
||||||
|
{
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public Nullable<double> UsedQty { get; set; }
|
||||||
|
public Nullable<System.DateTime> CreateDate { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class ProgramGroups
|
||||||
|
{
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
|
||||||
|
public ProgramGroups()
|
||||||
|
{
|
||||||
|
this.Programs = new HashSet<Programs>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string UserPrompts { get; set; }
|
||||||
|
public byte[] TypeLibrary { get; set; }
|
||||||
|
public string Sections { get; set; }
|
||||||
|
public Nullable<int> MaximumPrograms { get; set; }
|
||||||
|
public Nullable<short> OutOfService { get; set; }
|
||||||
|
public string DyelotParameterCommands { get; set; }
|
||||||
|
public string CommandHelp { get; set; }
|
||||||
|
public string UsesProgramsFromGroup { get; set; }
|
||||||
|
public Nullable<short> MaximumGradient { get; set; }
|
||||||
|
public Nullable<short> QQMinutes { get; set; }
|
||||||
|
public Nullable<short> MessageMinutes { get; set; }
|
||||||
|
public string Inefficiencies { get; set; }
|
||||||
|
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||||
|
public virtual ICollection<Programs> Programs { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class Programs
|
||||||
|
{
|
||||||
|
public string ProgramGroup { get; set; }
|
||||||
|
public int ProgramNumber { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Steps { get; set; }
|
||||||
|
public string Notes { get; set; }
|
||||||
|
public Nullable<System.DateTime> ModifiedTime { get; set; }
|
||||||
|
public Nullable<double> StandardTime { get; set; }
|
||||||
|
|
||||||
|
public virtual ProgramGroups ProgramGroups { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class ProgramsUsed
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public string Program { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Steps { get; set; }
|
||||||
|
public Nullable<int> StepsNoBpCrc { get; set; }
|
||||||
|
public Nullable<double> ComputedTime { get; set; }
|
||||||
|
public Nullable<int> MaxTemperature { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public System.DateTime StartTime { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Resources;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
// 有关程序集的一般信息由以下
|
||||||
|
// 控制。更改这些特性值可修改
|
||||||
|
// 与程序集关联的信息。
|
||||||
|
[assembly: AssemblyTitle("Audit")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("Audit")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||||
|
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||||
|
//请将此类型的 ComVisible 特性设置为 true。
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
//若要开始生成可本地化的应用程序,请设置
|
||||||
|
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
|
||||||
|
//例如,如果您在源文件中使用的是美国英语,
|
||||||
|
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
|
||||||
|
//对以下 NeutralResourceLanguage 特性的注释。 更新
|
||||||
|
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
|
||||||
|
|
||||||
|
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||||
|
|
||||||
|
|
||||||
|
[assembly: ThemeInfo(
|
||||||
|
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
|
||||||
|
//(未在页面中找到资源时使用,
|
||||||
|
//或应用程序资源字典中找到时使用)
|
||||||
|
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
|
||||||
|
//(未在页面中找到资源时使用,
|
||||||
|
//、应用程序或任何主题专用资源字典中找到时使用)
|
||||||
|
)]
|
||||||
|
|
||||||
|
|
||||||
|
// 程序集的版本信息由下列四个值组成:
|
||||||
|
//
|
||||||
|
// 主版本
|
||||||
|
// 次版本
|
||||||
|
// 生成号
|
||||||
|
// 修订号
|
||||||
|
//
|
||||||
|
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||||
|
//通过使用 "*",如下所示:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
Generated
+71
@@ -0,0 +1,71 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码由工具生成。
|
||||||
|
// 运行时版本: 4.0.30319.42000
|
||||||
|
//
|
||||||
|
// 对此文件的更改可能导致不正确的行为,如果
|
||||||
|
// 重新生成代码,则所做更改将丢失。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 强类型资源类,用于查找本地化字符串等。
|
||||||
|
/// </summary>
|
||||||
|
// 此类是由 StronglyTypedResourceBuilder
|
||||||
|
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||||
|
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||||
|
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources
|
||||||
|
{
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 返回此类使用的缓存 ResourceManager 实例。
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if ((resourceMan == null))
|
||||||
|
{
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Audit.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||||
|
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
Generated
+30
@@ -0,0 +1,30 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class REMOTETERMINAL
|
||||||
|
{
|
||||||
|
public string tmp_field { get; set; }
|
||||||
|
public string IDNO { get; set; }
|
||||||
|
public Nullable<double> FNDATE { get; set; }
|
||||||
|
public string IDTYPE { get; set; }
|
||||||
|
public string FIRST_KEY { get; set; }
|
||||||
|
public string SECOND_KEY { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class RFIDRecordQueue
|
||||||
|
{
|
||||||
|
public Nullable<int> Station { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public Nullable<int> DevideNo { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public string DID { get; set; }
|
||||||
|
public Nullable<System.DateTime> Updated { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class RFIDRecordQueueHistory
|
||||||
|
{
|
||||||
|
public Nullable<int> Station { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public Nullable<int> DevideNo { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public string DID { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class RecipeDeduct
|
||||||
|
{
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string Station { get; set; }
|
||||||
|
public Nullable<int> ShotNo { get; set; }
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public Nullable<System.DateTime> DeductTime { get; set; }
|
||||||
|
public Nullable<double> DeductGrams { get; set; }
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public string DID { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class RecipeDeductHistory
|
||||||
|
{
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string Station { get; set; }
|
||||||
|
public Nullable<int> ShotNo { get; set; }
|
||||||
|
public string ProductCode { get; set; }
|
||||||
|
public Nullable<System.DateTime> DeductTime { get; set; }
|
||||||
|
public Nullable<double> DeductGrams { get; set; }
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public string DID { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
public Nullable<System.DateTime> Updated { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class SampleDyeDslvQueue
|
||||||
|
{
|
||||||
|
public Nullable<int> TankNo { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<int> PassAuto { get; set; }
|
||||||
|
public Nullable<int> ShelfID { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public Nullable<System.DateTime> SchDispenseTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> Updated { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class SampleDyeDslvQueueHistory
|
||||||
|
{
|
||||||
|
public Nullable<int> TankNo { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public Nullable<int> PassAuto { get; set; }
|
||||||
|
public Nullable<int> ShelfID { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public Nullable<System.DateTime> SchDispenseTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> Created { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class SchedulingLog
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int Redye { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public System.DateTime CallTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> EndTime { get; set; }
|
||||||
|
public Nullable<int> State { get; set; }
|
||||||
|
public string Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class Shelf
|
||||||
|
{
|
||||||
|
public int ShelfID { get; set; }
|
||||||
|
public Nullable<int> MaxLayer { get; set; }
|
||||||
|
public Nullable<int> MaxPosition { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class StepVisits
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public Nullable<int> OverallStepNumber { get; set; }
|
||||||
|
public string XX { get; set; }
|
||||||
|
public string Parameter1 { get; set; }
|
||||||
|
public string Parameter2 { get; set; }
|
||||||
|
public string Parameter3 { get; set; }
|
||||||
|
public string Parameter4 { get; set; }
|
||||||
|
public string Parameter5 { get; set; }
|
||||||
|
public string Command { get; set; }
|
||||||
|
public string Parameters { get; set; }
|
||||||
|
public string Notes { get; set; }
|
||||||
|
public System.DateTime StartTime { get; set; }
|
||||||
|
public System.DateTime EndTime { get; set; }
|
||||||
|
public double Duration { get; set; }
|
||||||
|
public Nullable<double> PlannedDuration { get; set; }
|
||||||
|
public Nullable<double> OverRun { get; set; }
|
||||||
|
public Nullable<int> TemperatureAfter { get; set; }
|
||||||
|
public string ProgramNumber { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public Nullable<int> StartTemperature { get; set; }
|
||||||
|
public Nullable<int> EndTemperature { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class Steps
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public Nullable<int> OverallStepNumber { get; set; }
|
||||||
|
public string XX { get; set; }
|
||||||
|
public string ParameterValues { get; set; }
|
||||||
|
public string Command { get; set; }
|
||||||
|
public string Parameters { get; set; }
|
||||||
|
public string Notes { get; set; }
|
||||||
|
public Nullable<double> PlannedDuration { get; set; }
|
||||||
|
public Nullable<double> ActualDuration { get; set; }
|
||||||
|
public Nullable<double> OverRun { get; set; }
|
||||||
|
public Nullable<int> TemperatureAfter { get; set; }
|
||||||
|
public string ProgramNumber { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class Stoppages
|
||||||
|
{
|
||||||
|
public int AutoKey { get; set; }
|
||||||
|
public string Machine { get; set; }
|
||||||
|
public string Reason { get; set; }
|
||||||
|
public System.DateTime StartTime { get; set; }
|
||||||
|
public Nullable<System.DateTime> EndTime { get; set; }
|
||||||
|
public string Notes { get; set; }
|
||||||
|
public Nullable<double> Duration { get; set; }
|
||||||
|
public string Shift { get; set; }
|
||||||
|
public string SingleShift { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class TEMPCHEMICALTKT
|
||||||
|
{
|
||||||
|
public string tmp_field { get; set; }
|
||||||
|
public string IDNO { get; set; }
|
||||||
|
public Nullable<double> FNDATE { get; set; }
|
||||||
|
public string IDTYPE { get; set; }
|
||||||
|
public string FIRST_KEY { get; set; }
|
||||||
|
public string SECOND_KEY { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class TEMPDYESTUFFTKT
|
||||||
|
{
|
||||||
|
public string tmp_field { get; set; }
|
||||||
|
public string IDNO { get; set; }
|
||||||
|
public Nullable<double> FNDATE { get; set; }
|
||||||
|
public string IDTYPE { get; set; }
|
||||||
|
public string FIRST_KEY { get; set; }
|
||||||
|
public string SECOND_KEY { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class TEMPPOWDER
|
||||||
|
{
|
||||||
|
public string tmp_field { get; set; }
|
||||||
|
public string IDNO { get; set; }
|
||||||
|
public Nullable<double> FNDATE { get; set; }
|
||||||
|
public string IDTYPE { get; set; }
|
||||||
|
public string FIRST_KEY { get; set; }
|
||||||
|
public string SECOND_KEY { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class TICKET_DETAIL
|
||||||
|
{
|
||||||
|
public string ID_NO { get; set; }
|
||||||
|
public Nullable<int> STEP_NO { get; set; }
|
||||||
|
public string PRODUCT_CODE { get; set; }
|
||||||
|
public string PRODUCT_TYPE { get; set; }
|
||||||
|
public Nullable<double> TARGET_WT { get; set; }
|
||||||
|
public Nullable<double> ACTUAL_WT { get; set; }
|
||||||
|
public string UNIT { get; set; }
|
||||||
|
public string COMP_DATE { get; set; }
|
||||||
|
public string COMP_TIME { get; set; }
|
||||||
|
public Nullable<int> TRANSFER_STATE { get; set; }
|
||||||
|
public string ERROR_CODE { get; set; }
|
||||||
|
public string MACHINE { get; set; }
|
||||||
|
public string TANK_NO { get; set; }
|
||||||
|
public string ID_TYPE { get; set; }
|
||||||
|
public string PRODUCT_LOT { get; set; }
|
||||||
|
public string RECIPE_CODE { get; set; }
|
||||||
|
public Nullable<double> LR { get; set; }
|
||||||
|
public string RECIPE_TYPE { get; set; }
|
||||||
|
public string CONC { get; set; }
|
||||||
|
public string CONCUNIT { get; set; }
|
||||||
|
public string REMARK { get; set; }
|
||||||
|
public string ADJUST { get; set; }
|
||||||
|
public Nullable<double> PRICE { get; set; }
|
||||||
|
public Nullable<double> RES_DOUBLE1 { get; set; }
|
||||||
|
public Nullable<double> RES_DOUBLE2 { get; set; }
|
||||||
|
public Nullable<double> RES_DOUBLE3 { get; set; }
|
||||||
|
public Nullable<double> RES_DOUBLE4 { get; set; }
|
||||||
|
public string RES_STRING1 { get; set; }
|
||||||
|
public string RES_STRING2 { get; set; }
|
||||||
|
public string RES_STRING3 { get; set; }
|
||||||
|
public string RES_STRING4 { get; set; }
|
||||||
|
public string REWEIGHT { get; set; }
|
||||||
|
public Nullable<int> Redye { get; set; }
|
||||||
|
public Nullable<System.DateTime> DyeWeightTime { get; set; }
|
||||||
|
public string UserAccount { get; set; }
|
||||||
|
public string Batch_NO { get; set; }
|
||||||
|
public Nullable<int> lldmxid { get; set; }
|
||||||
|
public string Station { get; set; }
|
||||||
|
public string UserCode { get; set; }
|
||||||
|
public Nullable<double> FABRIC_WEIGHT { get; set; }
|
||||||
|
public Nullable<double> VOLUME { get; set; }
|
||||||
|
public Nullable<short> RECORD_ORDER { get; set; }
|
||||||
|
public string Process { get; set; }
|
||||||
|
public double GRAVITY { get; set; }
|
||||||
|
public Nullable<double> CurrentStock { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class TagShelf
|
||||||
|
{
|
||||||
|
public Nullable<int> BucketNo { get; set; }
|
||||||
|
public string Dyelot { get; set; }
|
||||||
|
public string Machines { get; set; }
|
||||||
|
public Nullable<int> TagManagerNo { get; set; }
|
||||||
|
public int ReDye { get; set; }
|
||||||
|
public Nullable<int> StepNumber { get; set; }
|
||||||
|
public string DID { get; set; }
|
||||||
|
public Nullable<int> TotalBuckets { get; set; }
|
||||||
|
public Nullable<int> DevideNo { get; set; }
|
||||||
|
public Nullable<System.DateTime> OnShelfTime { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity;
|
||||||
|
using System.Data.Entity.Infrastructure;
|
||||||
|
|
||||||
|
public partial class TicketEntities : DbContext
|
||||||
|
{
|
||||||
|
public TicketEntities()
|
||||||
|
: base("name=TicketEntities")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
throw new UnintentionalCodeFirstException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual DbSet<Product> Product { get; set; }
|
||||||
|
public virtual DbSet<ProductInventory> ProductInventory { get; set; }
|
||||||
|
public virtual DbSet<ProductUsed> ProductUsed { get; set; }
|
||||||
|
public virtual DbSet<CHEMICAL_QUEUE> CHEMICAL_QUEUE { get; set; }
|
||||||
|
public virtual DbSet<DYESTUFF_QUEUE> DYESTUFF_QUEUE { get; set; }
|
||||||
|
public virtual DbSet<JOBTKT> JOBTKT { get; set; }
|
||||||
|
public virtual DbSet<POWDER_QUEUE> POWDER_QUEUE { get; set; }
|
||||||
|
public virtual DbSet<REMOTETERMINAL> REMOTETERMINAL { get; set; }
|
||||||
|
public virtual DbSet<TEMPCHEMICALTKT> TEMPCHEMICALTKT { get; set; }
|
||||||
|
public virtual DbSet<TEMPDYESTUFFTKT> TEMPDYESTUFFTKT { get; set; }
|
||||||
|
public virtual DbSet<TEMPPOWDER> TEMPPOWDER { get; set; }
|
||||||
|
public virtual DbSet<TICKET_DETAIL> TICKET_DETAIL { get; set; }
|
||||||
|
public virtual DbSet<TicketSerial> TicketSerial { get; set; }
|
||||||
|
public virtual DbSet<UserAccount> UserAccount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,636 @@
|
|||||||
|
<#@ template language="C#" debug="false" hostspecific="true"#>
|
||||||
|
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
|
||||||
|
output extension=".cs"#><#
|
||||||
|
|
||||||
|
const string inputFile = @"Ticket.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#>
|
||||||
Generated
+10
@@ -0,0 +1,10 @@
|
|||||||
|
// 为模型“D:\Visual Studio\Audit\Ticket.edmx”启用了 T4 代码生成。
|
||||||
|
// 要启用旧代码生成功能,请将“代码生成策略”设计器属性的值
|
||||||
|
// 更改为“旧的 ObjectContext”。当在设计器中打开该模型时,此属性会出现在
|
||||||
|
// “属性”窗口中。
|
||||||
|
|
||||||
|
// 如果没有生成任何上下文和实体类,可能是因为您创建了空模型但是
|
||||||
|
// 尚未选择要使用的实体框架版本。要为您的模型生成一个上下文类和实体
|
||||||
|
// 类,请在设计器中打开该模型,右键单击设计器图面,然后
|
||||||
|
// 选择“从数据库更新模型...”、“从模型生成数据库...”或“添加代码生成
|
||||||
|
// 项...”。
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
+1103
File diff suppressed because it is too large.
Load diff
@@ -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="7cd82184ed7342ffb1bfb750eb579477" Name="Diagram1">
|
||||||
|
<EntityTypeShape EntityType="TicketModel.Product" Width="1.5" PointX="0.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="TicketModel.ProductInventory" Width="1.5" PointX="2.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="TicketModel.ProductUsed" Width="1.5" PointX="2.75" PointY="3.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="TicketModel.CHEMICAL_QUEUE" Width="1.5" PointX="4.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="TicketModel.DYESTUFF_QUEUE" Width="1.5" PointX="4.75" PointY="4.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="TicketModel.JOBTKT" Width="1.5" PointX="6.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="TicketModel.POWDER_QUEUE" Width="1.5" PointX="6.75" PointY="3.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="TicketModel.REMOTETERMINAL" Width="1.5" PointX="6.75" PointY="7.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="TicketModel.TEMPCHEMICALTKT" Width="1.5" PointX="8.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="TicketModel.TEMPDYESTUFFTKT" Width="1.5" PointX="2.75" PointY="8.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="TicketModel.TEMPPOWDER" Width="1.5" PointX="8.75" PointY="4.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="TicketModel.TICKET_DETAIL" Width="1.5" PointX="8.75" PointY="8.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="TicketModel.TicketSerial" Width="1.5" PointX="10.75" PointY="0.75" IsExpanded="true" />
|
||||||
|
<EntityTypeShape EntityType="TicketModel.UserAccount" Width="1.5" PointX="10.75" PointY="3.75" IsExpanded="true" />
|
||||||
|
</Diagram>
|
||||||
|
</edmx:Diagrams>
|
||||||
|
</edmx:Designer>
|
||||||
|
</edmx:Edmx>
|
||||||
@@ -0,0 +1,733 @@
|
|||||||
|
<#@ template language="C#" debug="false" hostspecific="true"#>
|
||||||
|
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
|
||||||
|
output extension=".cs"#><#
|
||||||
|
|
||||||
|
const string inputFile = @"Ticket.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码已从模板生成。
|
||||||
|
//
|
||||||
|
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||||
|
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Audit
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class TicketSerial
|
||||||
|
{
|
||||||
|
public string tmp_field { get; set; }
|
||||||
|
public string ID_NO { get; set; }
|
||||||
|
public int REDYE_NOW { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Loaded 100 of 108 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user