From ce56a715f02464d0c8d8a02e5dbbf32e5c610459 Mon Sep 17 00:00:00 2001 From: chi Date: Mon, 9 Nov 2020 08:20:03 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=81=EC=A0=95=EC=9D=B8=EC=9B=90=EB=B3=B4?= =?UTF-8?q?=EA=B3=A0=EC=84=9C=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project/AdoNetEFMain.Context.cs | 33 + Project/AdoNetEFMain.Context.tt | 636 ++++++++ Project/AdoNetEFMain.Designer.cs | 10 + Project/AdoNetEFMain.cs | 9 + Project/AdoNetEFMain.edmx | 294 ++++ Project/AdoNetEFMain.edmx.diagram | 15 + Project/AdoNetEFMain.tt | 733 +++++++++ Project/DataClasses1.dbml | 70 - Project/DataClasses1.dbml.layout | 30 - Project/DataClasses1.designer.cs | 1346 ----------------- Project/EETGW.csproj | 64 +- Project/EETGW_GroupUser.cs | 25 + Project/Properties/AssemblyInfo.cs | 4 +- Project/Properties/Settings.Designer.cs | 14 - Project/Properties/Settings.settings | 13 - Project/UserGroup.cs | 23 + Project/Users.cs | 39 + Project/_Common/fAddNewUser.cs | 15 +- Project/_Common/fUserList.cs | 4 +- Project/app.config | 65 +- Project/packages.config | 5 + Project/vGroupUser.cs | 36 + ReportForUser.xlsx | Bin 0 -> 12592 bytes SubProject/FPJ0000/Common.cs | 28 + SubProject/FPJ0000/FPJ0000.csproj | 82 + SubProject/FPJ0000/HolidayLIst.cs | 24 + .../FPJ0000/JobReport/fJobReport.Designer.cs | 146 +- SubProject/FPJ0000/JobReport/fJobReport.cs | 33 +- SubProject/FPJ0000/JobReport/fJobReport.resx | 11 + SubProject/FPJ0000/JobReport/rJobChart.rdlc | 11 +- .../JobReport/rJobReportUser.Designer.cs | 220 +++ .../FPJ0000/JobReport/rJobReportUser.cs | 457 ++++++ .../FPJ0000/JobReport/rJobReportUser.resx | 135 ++ SubProject/FPJ0000/Model1.Context.cs | 37 + SubProject/FPJ0000/Model1.Context.tt | 636 ++++++++ SubProject/FPJ0000/Model1.Designer.cs | 10 + SubProject/FPJ0000/Model1.cs | 9 + SubProject/FPJ0000/Model1.edmx | 525 +++++++ SubProject/FPJ0000/Model1.edmx.diagram | 19 + SubProject/FPJ0000/Model1.tt | 733 +++++++++ SubProject/FPJ0000/Project/fPartList.cs | 6 +- SubProject/FPJ0000/Project/fPartList.resx | 28 +- .../FPJ0000/Project/fSPMaster.Designer.cs | 245 +-- SubProject/FPJ0000/Project/fSPMaster.cs | 8 + SubProject/FPJ0000/Project/fSPMaster.resx | 9 +- .../FPJ0000/Properties/Settings.Designer.cs | 11 + .../FPJ0000/Properties/Settings.settings | 8 + SubProject/FPJ0000/ReportForUser.xlsx | Bin 0 -> 20274 bytes SubProject/FPJ0000/UserGroup.cs | 23 + SubProject/FPJ0000/Users.cs | 39 + SubProject/FPJ0000/app.config | 36 +- SubProject/FPJ0000/packages.config | 2 + SubProject/FPJ0000/vGroupUser.cs | 36 + SubProject/FPJ0000/vHoliday_uselist.cs | 27 + SubProject/FPJ0000/vJobReportForUser.cs | 29 + SubProject/FPJ0000/vUserWorkTimeList.cs | 25 + 56 files changed, 5371 insertions(+), 1760 deletions(-) create mode 100644 Project/AdoNetEFMain.Context.cs create mode 100644 Project/AdoNetEFMain.Context.tt create mode 100644 Project/AdoNetEFMain.Designer.cs create mode 100644 Project/AdoNetEFMain.cs create mode 100644 Project/AdoNetEFMain.edmx create mode 100644 Project/AdoNetEFMain.edmx.diagram create mode 100644 Project/AdoNetEFMain.tt delete mode 100644 Project/DataClasses1.dbml delete mode 100644 Project/DataClasses1.dbml.layout delete mode 100644 Project/DataClasses1.designer.cs create mode 100644 Project/EETGW_GroupUser.cs create mode 100644 Project/UserGroup.cs create mode 100644 Project/Users.cs create mode 100644 Project/packages.config create mode 100644 Project/vGroupUser.cs create mode 100644 ReportForUser.xlsx create mode 100644 SubProject/FPJ0000/Common.cs create mode 100644 SubProject/FPJ0000/HolidayLIst.cs create mode 100644 SubProject/FPJ0000/JobReport/rJobReportUser.Designer.cs create mode 100644 SubProject/FPJ0000/JobReport/rJobReportUser.cs create mode 100644 SubProject/FPJ0000/JobReport/rJobReportUser.resx create mode 100644 SubProject/FPJ0000/Model1.Context.cs create mode 100644 SubProject/FPJ0000/Model1.Context.tt create mode 100644 SubProject/FPJ0000/Model1.Designer.cs create mode 100644 SubProject/FPJ0000/Model1.cs create mode 100644 SubProject/FPJ0000/Model1.edmx create mode 100644 SubProject/FPJ0000/Model1.edmx.diagram create mode 100644 SubProject/FPJ0000/Model1.tt create mode 100644 SubProject/FPJ0000/ReportForUser.xlsx create mode 100644 SubProject/FPJ0000/UserGroup.cs create mode 100644 SubProject/FPJ0000/Users.cs create mode 100644 SubProject/FPJ0000/vGroupUser.cs create mode 100644 SubProject/FPJ0000/vHoliday_uselist.cs create mode 100644 SubProject/FPJ0000/vJobReportForUser.cs create mode 100644 SubProject/FPJ0000/vUserWorkTimeList.cs diff --git a/Project/AdoNetEFMain.Context.cs b/Project/AdoNetEFMain.Context.cs new file mode 100644 index 0000000..acce4f9 --- /dev/null +++ b/Project/AdoNetEFMain.Context.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace Project +{ + using System; + using System.Data.Entity; + using System.Data.Entity.Infrastructure; + + public partial class EEEntitiesMain : DbContext + { + public EEEntitiesMain() + : base("name=EEEntitiesMain") + { + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + + public virtual DbSet EETGW_GroupUser { get; set; } + public virtual DbSet UserGroup { get; set; } + public virtual DbSet Users { get; set; } + public virtual DbSet vGroupUser { get; set; } + } +} diff --git a/Project/AdoNetEFMain.Context.tt b/Project/AdoNetEFMain.Context.tt new file mode 100644 index 0000000..95915a5 --- /dev/null +++ b/Project/AdoNetEFMain.Context.tt @@ -0,0 +1,636 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF6.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +const string inputFile = @"AdoNetEFMain.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().FirstOrDefault(); +if (container == null) +{ + return string.Empty; +} +#> +//------------------------------------------------------------------------------ +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ + +<# + +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()) +{ + // 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()) + { +#> + <#=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 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(); + } + + 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 types, string sourceFile) + { + ArgumentNotNull(types, "types"); + ArgumentNotNull(sourceFile, "sourceFile"); + + var hash = new HashSet(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 GetEnumItemsToGenerate(IEnumerable itemCollection) + { + return GetItemsToGenerate(itemCollection) + .Where(e => IsEnumType(e)); + } + + public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType + { + return itemCollection + .OfType() + .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) + .OrderBy(i => i.Name); + } + + public IEnumerable GetAllGlobalItems(IEnumerable 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 GetSimpleProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetSimpleProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetPropertiesWithDefaultValues(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type); + } + + public IEnumerable 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)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 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 arg, string name) where T : class +{ + if (arg == null) + { + throw new ArgumentNullException(name); + } +} +#> \ No newline at end of file diff --git a/Project/AdoNetEFMain.Designer.cs b/Project/AdoNetEFMain.Designer.cs new file mode 100644 index 0000000..fa76703 --- /dev/null +++ b/Project/AdoNetEFMain.Designer.cs @@ -0,0 +1,10 @@ +// 모델 'D:\Source\##### 완료아이템\(014) GroupWare\Source\Project\AdoNetEFMain.edmx'에 대해 T4 코드 생성이 사용됩니다. +// 레거시 코드 생성을 사용하려면 '코드 생성 전략' 디자이너 속성의 값을 +// 'Legacy ObjectContext'로 변경하십시오. 이 속성은 모델이 디자이너에서 열릴 때 +// 속성 창에서 사용할 수 있습니다. + +// 컨텍스트 및 엔터티 클래스가 생성되지 않은 경우 빈 모델을 만들었기 때문일 수도 있지만 +// 사용할 Entity Framework 버전을 선택하지 않았기 때문일 수도 있습니다. 모델에 맞는 컨텍스트 클래스 및 +// 엔터티 클래스를 생성하려면 디자이너에서 모델을 열고 디자이너 화면에서 마우스 오른쪽 단추를 클릭한 +// 다음 '데이터베이스에서 모델 업데이트...', '모델에서 데이터베이스 생성...' 또는 '코드 생성 항목 추가...'를 +// 선택하십시오. \ No newline at end of file diff --git a/Project/AdoNetEFMain.cs b/Project/AdoNetEFMain.cs new file mode 100644 index 0000000..7a9ab12 --- /dev/null +++ b/Project/AdoNetEFMain.cs @@ -0,0 +1,9 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + diff --git a/Project/AdoNetEFMain.edmx b/Project/AdoNetEFMain.edmx new file mode 100644 index 0000000..b984f31 --- /dev/null +++ b/Project/AdoNetEFMain.edmx @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SELECT + [vGroupUser].[gcode] AS [gcode], + [vGroupUser].[dept] AS [dept], + [vGroupUser].[level] AS [level], + [vGroupUser].[name] AS [name], + [vGroupUser].[nameE] AS [nameE], + [vGroupUser].[grade] AS [grade], + [vGroupUser].[email] AS [email], + [vGroupUser].[tel] AS [tel], + [vGroupUser].[indate] AS [indate], + [vGroupUser].[outdate] AS [outdate], + [vGroupUser].[hp] AS [hp], + [vGroupUser].[place] AS [place], + [vGroupUser].[ads_employNo] AS [ads_employNo], + [vGroupUser].[ads_title] AS [ads_title], + [vGroupUser].[ads_created] AS [ads_created], + [vGroupUser].[memo] AS [memo], + [vGroupUser].[processs] AS [processs], + [vGroupUser].[id] AS [id] + FROM [dbo].[vGroupUser] AS [vGroupUser] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Project/AdoNetEFMain.edmx.diagram b/Project/AdoNetEFMain.edmx.diagram new file mode 100644 index 0000000..a829ade --- /dev/null +++ b/Project/AdoNetEFMain.edmx.diagram @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Project/AdoNetEFMain.tt b/Project/AdoNetEFMain.tt new file mode 100644 index 0000000..00d1872 --- /dev/null +++ b/Project/AdoNetEFMain.tt @@ -0,0 +1,733 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF6.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +const string inputFile = @"AdoNetEFMain.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(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(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(); +#> +//------------------------------------------------------------------------------ +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ +<#=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 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(); + } + + 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 types, string sourceFile) + { + ArgumentNotNull(types, "types"); + ArgumentNotNull(sourceFile, "sourceFile"); + + var hash = new HashSet(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 GetEnumItemsToGenerate(IEnumerable itemCollection) + { + return GetItemsToGenerate(itemCollection) + .Where(e => IsEnumType(e)); + } + + public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType + { + return itemCollection + .OfType() + .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) + .OrderBy(i => i.Name); + } + + public IEnumerable GetAllGlobalItems(IEnumerable 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 GetSimpleProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetSimpleProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetPropertiesWithDefaultValues(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type); + } + + public IEnumerable 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)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 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 arg, string name) where T : class +{ + if (arg == null) + { + throw new ArgumentNullException(name); + } +} +#> \ No newline at end of file diff --git a/Project/DataClasses1.dbml b/Project/DataClasses1.dbml deleted file mode 100644 index 4483b3e..0000000 --- a/Project/DataClasses1.dbml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
-
\ No newline at end of file diff --git a/Project/DataClasses1.dbml.layout b/Project/DataClasses1.dbml.layout deleted file mode 100644 index 7785523..0000000 --- a/Project/DataClasses1.dbml.layout +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Project/DataClasses1.designer.cs b/Project/DataClasses1.designer.cs deleted file mode 100644 index a749871..0000000 --- a/Project/DataClasses1.designer.cs +++ /dev/null @@ -1,1346 +0,0 @@ -#pragma warning disable 1591 -//------------------------------------------------------------------------------ -// -// 이 코드는 도구를 사용하여 생성되었습니다. -// 런타임 버전:4.0.30319.42000 -// -// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 -// 이러한 변경 내용이 손실됩니다. -// -//------------------------------------------------------------------------------ - -namespace Project -{ - using System.Data.Linq; - using System.Data.Linq.Mapping; - using System.Data; - using System.Collections.Generic; - using System.Reflection; - using System.Linq; - using System.Linq.Expressions; - using System.ComponentModel; - using System; - - - [global::System.Data.Linq.Mapping.DatabaseAttribute(Name="EE")] - public partial class DataClasses1DataContext : System.Data.Linq.DataContext - { - - private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource(); - - #region 확장성 메서드 정의 - partial void OnCreated(); - partial void InsertUserGroup(UserGroup instance); - partial void UpdateUserGroup(UserGroup instance); - partial void DeleteUserGroup(UserGroup instance); - partial void InsertUsers(Users instance); - partial void UpdateUsers(Users instance); - partial void DeleteUsers(Users instance); - partial void InsertEETGW_GroupUser(EETGW_GroupUser instance); - partial void UpdateEETGW_GroupUser(EETGW_GroupUser instance); - partial void DeleteEETGW_GroupUser(EETGW_GroupUser instance); - #endregion - - public DataClasses1DataContext() : - base(global::Project.Properties.Settings.Default.gwcs, mappingSource) - { - OnCreated(); - } - - public DataClasses1DataContext(string connection) : - base(connection, mappingSource) - { - OnCreated(); - } - - public DataClasses1DataContext(System.Data.IDbConnection connection) : - base(connection, mappingSource) - { - OnCreated(); - } - - public DataClasses1DataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : - base(connection, mappingSource) - { - OnCreated(); - } - - public DataClasses1DataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : - base(connection, mappingSource) - { - OnCreated(); - } - - public System.Data.Linq.Table UserGroup - { - get - { - return this.GetTable(); - } - } - - public System.Data.Linq.Table vGroupUser - { - get - { - return this.GetTable(); - } - } - - public System.Data.Linq.Table Users - { - get - { - return this.GetTable(); - } - } - - public System.Data.Linq.Table EETGW_GroupUser - { - get - { - return this.GetTable(); - } - } - } - - [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.UserGroup")] - public partial class UserGroup : INotifyPropertyChanging, INotifyPropertyChanged - { - - private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); - - private string _dept; - - private string _gcode; - - private string _path_kj; - - private System.Nullable _advpurchase; - - private System.Nullable _permission; - - #region 확장성 메서드 정의 - partial void OnLoaded(); - partial void OnValidate(System.Data.Linq.ChangeAction action); - partial void OnCreated(); - partial void OndeptChanging(string value); - partial void OndeptChanged(); - partial void OngcodeChanging(string value); - partial void OngcodeChanged(); - partial void Onpath_kjChanging(string value); - partial void Onpath_kjChanged(); - partial void OnadvpurchaseChanging(System.Nullable value); - partial void OnadvpurchaseChanged(); - partial void OnpermissionChanging(System.Nullable value); - partial void OnpermissionChanged(); - #endregion - - public UserGroup() - { - OnCreated(); - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_dept", DbType="VarChar(100) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] - public string dept - { - get - { - return this._dept; - } - set - { - if ((this._dept != value)) - { - this.OndeptChanging(value); - this.SendPropertyChanging(); - this._dept = value; - this.SendPropertyChanged("dept"); - this.OndeptChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_gcode", DbType="VarChar(10)")] - public string gcode - { - get - { - return this._gcode; - } - set - { - if ((this._gcode != value)) - { - this.OngcodeChanging(value); - this.SendPropertyChanging(); - this._gcode = value; - this.SendPropertyChanged("gcode"); - this.OngcodeChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_path_kj", DbType="NVarChar(100)")] - public string path_kj - { - get - { - return this._path_kj; - } - set - { - if ((this._path_kj != value)) - { - this.Onpath_kjChanging(value); - this.SendPropertyChanging(); - this._path_kj = value; - this.SendPropertyChanged("path_kj"); - this.Onpath_kjChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_advpurchase", DbType="Bit")] - public System.Nullable advpurchase - { - get - { - return this._advpurchase; - } - set - { - if ((this._advpurchase != value)) - { - this.OnadvpurchaseChanging(value); - this.SendPropertyChanging(); - this._advpurchase = value; - this.SendPropertyChanged("advpurchase"); - this.OnadvpurchaseChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_permission", DbType="Int")] - public System.Nullable permission - { - get - { - return this._permission; - } - set - { - if ((this._permission != value)) - { - this.OnpermissionChanging(value); - this.SendPropertyChanging(); - this._permission = value; - this.SendPropertyChanged("permission"); - this.OnpermissionChanged(); - } - } - } - - public event PropertyChangingEventHandler PropertyChanging; - - public event PropertyChangedEventHandler PropertyChanged; - - protected virtual void SendPropertyChanging() - { - if ((this.PropertyChanging != null)) - { - this.PropertyChanging(this, emptyChangingEventArgs); - } - } - - protected virtual void SendPropertyChanged(String propertyName) - { - if ((this.PropertyChanged != null)) - { - this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - } - - [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.vGroupUser")] - public partial class vGroupUser - { - - private string _gcode; - - private System.Nullable _level; - - private string _name; - - private string _nameE; - - private string _dept; - - private string _grade; - - private string _email; - - private string _tel; - - private string _indate; - - private string _outdate; - - private string _hp; - - private string _place; - - private string _ads_employNo; - - private string _ads_title; - - private string _ads_created; - - private string _memo; - - private string _processs; - - private string _id; - - public vGroupUser() - { - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_gcode", DbType="VarChar(10) NOT NULL", CanBeNull=false)] - public string gcode - { - get - { - return this._gcode; - } - set - { - if ((this._gcode != value)) - { - this._gcode = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Name="[level]", Storage="_level", DbType="SmallInt")] - public System.Nullable level - { - get - { - return this._level; - } - set - { - if ((this._level != value)) - { - this._level = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_name", DbType="NVarChar(100)")] - public string name - { - get - { - return this._name; - } - set - { - if ((this._name != value)) - { - this._name = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_nameE", DbType="NVarChar(100)")] - public string nameE - { - get - { - return this._nameE; - } - set - { - if ((this._nameE != value)) - { - this._nameE = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_dept", DbType="VarChar(100)")] - public string dept - { - get - { - return this._dept; - } - set - { - if ((this._dept != value)) - { - this._dept = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_grade", DbType="VarChar(10)")] - public string grade - { - get - { - return this._grade; - } - set - { - if ((this._grade != value)) - { - this._grade = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_email", DbType="VarChar(100)")] - public string email - { - get - { - return this._email; - } - set - { - if ((this._email != value)) - { - this._email = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_tel", DbType="VarChar(20)")] - public string tel - { - get - { - return this._tel; - } - set - { - if ((this._tel != value)) - { - this._tel = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_indate", DbType="VarChar(20)")] - public string indate - { - get - { - return this._indate; - } - set - { - if ((this._indate != value)) - { - this._indate = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_outdate", DbType="VarChar(20)")] - public string outdate - { - get - { - return this._outdate; - } - set - { - if ((this._outdate != value)) - { - this._outdate = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_hp", DbType="VarChar(20)")] - public string hp - { - get - { - return this._hp; - } - set - { - if ((this._hp != value)) - { - this._hp = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_place", DbType="VarChar(100)")] - public string place - { - get - { - return this._place; - } - set - { - if ((this._place != value)) - { - this._place = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ads_employNo", DbType="VarChar(50)")] - public string ads_employNo - { - get - { - return this._ads_employNo; - } - set - { - if ((this._ads_employNo != value)) - { - this._ads_employNo = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ads_title", DbType="NVarChar(100)")] - public string ads_title - { - get - { - return this._ads_title; - } - set - { - if ((this._ads_title != value)) - { - this._ads_title = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ads_created", DbType="VarChar(50)")] - public string ads_created - { - get - { - return this._ads_created; - } - set - { - if ((this._ads_created != value)) - { - this._ads_created = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_memo", DbType="NVarChar(255)")] - public string memo - { - get - { - return this._memo; - } - set - { - if ((this._memo != value)) - { - this._memo = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_processs", DbType="NVarChar(100)")] - public string processs - { - get - { - return this._processs; - } - set - { - if ((this._processs != value)) - { - this._processs = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_id", DbType="VarChar(20)")] - public string id - { - get - { - return this._id; - } - set - { - if ((this._id != value)) - { - this._id = value; - } - } - } - } - - [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Users")] - public partial class Users : INotifyPropertyChanging, INotifyPropertyChanged - { - - private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); - - private string _id; - - private string _gcode; - - private string _password; - - private string _nameE; - - private string _name; - - private string _dept; - - private string _grade; - - private string _email; - - private System.Nullable _level; - - private string _indate; - - private string _outdate; - - private string _tel; - - private string _hp; - - private string _place; - - private string _ads_employNo; - - private string _ads_title; - - private string _ads_created; - - private string _memo; - - private string _wuid; - - private System.DateTime _wdate; - - private string _processs; - - #region 확장성 메서드 정의 - partial void OnLoaded(); - partial void OnValidate(System.Data.Linq.ChangeAction action); - partial void OnCreated(); - partial void OnidChanging(string value); - partial void OnidChanged(); - partial void OngcodeChanging(string value); - partial void OngcodeChanged(); - partial void OnpasswordChanging(string value); - partial void OnpasswordChanged(); - partial void OnnameEChanging(string value); - partial void OnnameEChanged(); - partial void OnnameChanging(string value); - partial void OnnameChanged(); - partial void OndeptChanging(string value); - partial void OndeptChanged(); - partial void OngradeChanging(string value); - partial void OngradeChanged(); - partial void OnemailChanging(string value); - partial void OnemailChanged(); - partial void OnlevelChanging(System.Nullable value); - partial void OnlevelChanged(); - partial void OnindateChanging(string value); - partial void OnindateChanged(); - partial void OnoutdateChanging(string value); - partial void OnoutdateChanged(); - partial void OntelChanging(string value); - partial void OntelChanged(); - partial void OnhpChanging(string value); - partial void OnhpChanged(); - partial void OnplaceChanging(string value); - partial void OnplaceChanged(); - partial void Onads_employNoChanging(string value); - partial void Onads_employNoChanged(); - partial void Onads_titleChanging(string value); - partial void Onads_titleChanged(); - partial void Onads_createdChanging(string value); - partial void Onads_createdChanged(); - partial void OnmemoChanging(string value); - partial void OnmemoChanged(); - partial void OnwuidChanging(string value); - partial void OnwuidChanged(); - partial void OnwdateChanging(System.DateTime value); - partial void OnwdateChanged(); - partial void OnprocesssChanging(string value); - partial void OnprocesssChanged(); - #endregion - - public Users() - { - OnCreated(); - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_id", DbType="VarChar(20) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] - public string id - { - get - { - return this._id; - } - set - { - if ((this._id != value)) - { - this.OnidChanging(value); - this.SendPropertyChanging(); - this._id = value; - this.SendPropertyChanged("id"); - this.OnidChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_gcode", DbType="VarChar(10)")] - public string gcode - { - get - { - return this._gcode; - } - set - { - if ((this._gcode != value)) - { - this.OngcodeChanging(value); - this.SendPropertyChanging(); - this._gcode = value; - this.SendPropertyChanged("gcode"); - this.OngcodeChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_password", DbType="VarChar(50)")] - public string password - { - get - { - return this._password; - } - set - { - if ((this._password != value)) - { - this.OnpasswordChanging(value); - this.SendPropertyChanging(); - this._password = value; - this.SendPropertyChanged("password"); - this.OnpasswordChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_nameE", DbType="NVarChar(100)")] - public string nameE - { - get - { - return this._nameE; - } - set - { - if ((this._nameE != value)) - { - this.OnnameEChanging(value); - this.SendPropertyChanging(); - this._nameE = value; - this.SendPropertyChanged("nameE"); - this.OnnameEChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_name", DbType="NVarChar(100)")] - public string name - { - get - { - return this._name; - } - set - { - if ((this._name != value)) - { - this.OnnameChanging(value); - this.SendPropertyChanging(); - this._name = value; - this.SendPropertyChanged("name"); - this.OnnameChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_dept", DbType="VarChar(100)")] - public string dept - { - get - { - return this._dept; - } - set - { - if ((this._dept != value)) - { - this.OndeptChanging(value); - this.SendPropertyChanging(); - this._dept = value; - this.SendPropertyChanged("dept"); - this.OndeptChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_grade", DbType="VarChar(10)")] - public string grade - { - get - { - return this._grade; - } - set - { - if ((this._grade != value)) - { - this.OngradeChanging(value); - this.SendPropertyChanging(); - this._grade = value; - this.SendPropertyChanged("grade"); - this.OngradeChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_email", DbType="VarChar(100)")] - public string email - { - get - { - return this._email; - } - set - { - if ((this._email != value)) - { - this.OnemailChanging(value); - this.SendPropertyChanging(); - this._email = value; - this.SendPropertyChanged("email"); - this.OnemailChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Name="[level]", Storage="_level", DbType="SmallInt")] - public System.Nullable level - { - get - { - return this._level; - } - set - { - if ((this._level != value)) - { - this.OnlevelChanging(value); - this.SendPropertyChanging(); - this._level = value; - this.SendPropertyChanged("level"); - this.OnlevelChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_indate", DbType="VarChar(20)")] - public string indate - { - get - { - return this._indate; - } - set - { - if ((this._indate != value)) - { - this.OnindateChanging(value); - this.SendPropertyChanging(); - this._indate = value; - this.SendPropertyChanged("indate"); - this.OnindateChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_outdate", DbType="VarChar(20)")] - public string outdate - { - get - { - return this._outdate; - } - set - { - if ((this._outdate != value)) - { - this.OnoutdateChanging(value); - this.SendPropertyChanging(); - this._outdate = value; - this.SendPropertyChanged("outdate"); - this.OnoutdateChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_tel", DbType="VarChar(20)")] - public string tel - { - get - { - return this._tel; - } - set - { - if ((this._tel != value)) - { - this.OntelChanging(value); - this.SendPropertyChanging(); - this._tel = value; - this.SendPropertyChanged("tel"); - this.OntelChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_hp", DbType="VarChar(20)")] - public string hp - { - get - { - return this._hp; - } - set - { - if ((this._hp != value)) - { - this.OnhpChanging(value); - this.SendPropertyChanging(); - this._hp = value; - this.SendPropertyChanged("hp"); - this.OnhpChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_place", DbType="VarChar(100)")] - public string place - { - get - { - return this._place; - } - set - { - if ((this._place != value)) - { - this.OnplaceChanging(value); - this.SendPropertyChanging(); - this._place = value; - this.SendPropertyChanged("place"); - this.OnplaceChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ads_employNo", DbType="VarChar(50)")] - public string ads_employNo - { - get - { - return this._ads_employNo; - } - set - { - if ((this._ads_employNo != value)) - { - this.Onads_employNoChanging(value); - this.SendPropertyChanging(); - this._ads_employNo = value; - this.SendPropertyChanged("ads_employNo"); - this.Onads_employNoChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ads_title", DbType="NVarChar(100)")] - public string ads_title - { - get - { - return this._ads_title; - } - set - { - if ((this._ads_title != value)) - { - this.Onads_titleChanging(value); - this.SendPropertyChanging(); - this._ads_title = value; - this.SendPropertyChanged("ads_title"); - this.Onads_titleChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ads_created", DbType="VarChar(50)")] - public string ads_created - { - get - { - return this._ads_created; - } - set - { - if ((this._ads_created != value)) - { - this.Onads_createdChanging(value); - this.SendPropertyChanging(); - this._ads_created = value; - this.SendPropertyChanged("ads_created"); - this.Onads_createdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_memo", DbType="NVarChar(255)")] - public string memo - { - get - { - return this._memo; - } - set - { - if ((this._memo != value)) - { - this.OnmemoChanging(value); - this.SendPropertyChanging(); - this._memo = value; - this.SendPropertyChanged("memo"); - this.OnmemoChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_wuid", DbType="VarChar(20) NOT NULL", CanBeNull=false)] - public string wuid - { - get - { - return this._wuid; - } - set - { - if ((this._wuid != value)) - { - this.OnwuidChanging(value); - this.SendPropertyChanging(); - this._wuid = value; - this.SendPropertyChanged("wuid"); - this.OnwuidChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_wdate", DbType="SmallDateTime NOT NULL")] - public System.DateTime wdate - { - get - { - return this._wdate; - } - set - { - if ((this._wdate != value)) - { - this.OnwdateChanging(value); - this.SendPropertyChanging(); - this._wdate = value; - this.SendPropertyChanged("wdate"); - this.OnwdateChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_processs", DbType="NVarChar(100)")] - public string processs - { - get - { - return this._processs; - } - set - { - if ((this._processs != value)) - { - this.OnprocesssChanging(value); - this.SendPropertyChanging(); - this._processs = value; - this.SendPropertyChanged("processs"); - this.OnprocesssChanged(); - } - } - } - - public event PropertyChangingEventHandler PropertyChanging; - - public event PropertyChangedEventHandler PropertyChanged; - - protected virtual void SendPropertyChanging() - { - if ((this.PropertyChanging != null)) - { - this.PropertyChanging(this, emptyChangingEventArgs); - } - } - - protected virtual void SendPropertyChanged(String propertyName) - { - if ((this.PropertyChanged != null)) - { - this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - } - - [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.EETGW_GroupUser")] - public partial class EETGW_GroupUser : INotifyPropertyChanging, INotifyPropertyChanged - { - - private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); - - private int _idx; - - private string _gcode; - - private string _uid; - - private System.Nullable _level; - - private string _Process; - - private string _wuid; - - private System.DateTime _wdate; - - #region 확장성 메서드 정의 - partial void OnLoaded(); - partial void OnValidate(System.Data.Linq.ChangeAction action); - partial void OnCreated(); - partial void OnidxChanging(int value); - partial void OnidxChanged(); - partial void OngcodeChanging(string value); - partial void OngcodeChanged(); - partial void OnuidChanging(string value); - partial void OnuidChanged(); - partial void OnlevelChanging(System.Nullable value); - partial void OnlevelChanged(); - partial void OnProcessChanging(string value); - partial void OnProcessChanged(); - partial void OnwuidChanging(string value); - partial void OnwuidChanged(); - partial void OnwdateChanging(System.DateTime value); - partial void OnwdateChanged(); - #endregion - - public EETGW_GroupUser() - { - OnCreated(); - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_idx", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] - public int idx - { - get - { - return this._idx; - } - set - { - if ((this._idx != value)) - { - this.OnidxChanging(value); - this.SendPropertyChanging(); - this._idx = value; - this.SendPropertyChanged("idx"); - this.OnidxChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_gcode", DbType="VarChar(10) NOT NULL", CanBeNull=false)] - public string gcode - { - get - { - return this._gcode; - } - set - { - if ((this._gcode != value)) - { - this.OngcodeChanging(value); - this.SendPropertyChanging(); - this._gcode = value; - this.SendPropertyChanged("gcode"); - this.OngcodeChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_uid", DbType="VarChar(20) NOT NULL", CanBeNull=false)] - public string uid - { - get - { - return this._uid; - } - set - { - if ((this._uid != value)) - { - this.OnuidChanging(value); - this.SendPropertyChanging(); - this._uid = value; - this.SendPropertyChanged("uid"); - this.OnuidChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Name="[level]", Storage="_level", DbType="SmallInt")] - public System.Nullable level - { - get - { - return this._level; - } - set - { - if ((this._level != value)) - { - this.OnlevelChanging(value); - this.SendPropertyChanging(); - this._level = value; - this.SendPropertyChanged("level"); - this.OnlevelChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Process", DbType="VarChar(50)")] - public string Process - { - get - { - return this._Process; - } - set - { - if ((this._Process != value)) - { - this.OnProcessChanging(value); - this.SendPropertyChanging(); - this._Process = value; - this.SendPropertyChanged("Process"); - this.OnProcessChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_wuid", DbType="VarChar(20) NOT NULL", CanBeNull=false)] - public string wuid - { - get - { - return this._wuid; - } - set - { - if ((this._wuid != value)) - { - this.OnwuidChanging(value); - this.SendPropertyChanging(); - this._wuid = value; - this.SendPropertyChanged("wuid"); - this.OnwuidChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_wdate", DbType="SmallDateTime NOT NULL")] - public System.DateTime wdate - { - get - { - return this._wdate; - } - set - { - if ((this._wdate != value)) - { - this.OnwdateChanging(value); - this.SendPropertyChanging(); - this._wdate = value; - this.SendPropertyChanged("wdate"); - this.OnwdateChanged(); - } - } - } - - public event PropertyChangingEventHandler PropertyChanging; - - public event PropertyChangedEventHandler PropertyChanged; - - protected virtual void SendPropertyChanging() - { - if ((this.PropertyChanging != null)) - { - this.PropertyChanging(this, emptyChangingEventArgs); - } - } - - protected virtual void SendPropertyChanged(String propertyName) - { - if ((this.PropertyChanged != null)) - { - this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - } -} -#pragma warning restore 1591 diff --git a/Project/EETGW.csproj b/Project/EETGW.csproj index 6c8948f..ce091f3 100644 --- a/Project/EETGW.csproj +++ b/Project/EETGW.csproj @@ -124,6 +124,12 @@ False ..\DLL\ArSetting.Net4.dll + + ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + @@ -134,12 +140,15 @@ + + + @@ -157,12 +166,22 @@ - - + True True - DataClasses1.dbml + AdoNetEFMain.Context.tt + + True + True + AdoNetEFMain.tt + + + True + True + AdoNetEFMain.edmx + + True True @@ -227,6 +246,9 @@ True DsPMPDatabase.xsd + + AdoNetEFMain.tt + Form @@ -252,6 +274,15 @@ + + AdoNetEFMain.tt + + + AdoNetEFMain.tt + + + AdoNetEFMain.tt + Form @@ -378,15 +409,14 @@ Resources.resx True + + EntityModelCodeGenerator + AdoNetEFMain.Designer.cs + + + AdoNetEFMain.edmx + - - MSLinqToSQLGenerator - DataClasses1.designer.cs - Designer - - - DataClasses1.dbml - DataSet1.xsd @@ -420,6 +450,7 @@ DsPMPDatabase.xsd + SettingsSingleFileGenerator @@ -435,6 +466,16 @@ + + TextTemplatingFileGenerator + AdoNetEFMain.edmx + AdoNetEFMain.Context.cs + + + TextTemplatingFileGenerator + AdoNetEFMain.edmx + AdoNetEFMain.cs + @@ -509,6 +550,7 @@ + \ No newline at end of file diff --git a/Project/EETGW_GroupUser.cs b/Project/EETGW_GroupUser.cs new file mode 100644 index 0000000..0b91489 --- /dev/null +++ b/Project/EETGW_GroupUser.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace Project +{ + using System; + using System.Collections.Generic; + + public partial class EETGW_GroupUser + { + public int idx { get; set; } + public string gcode { get; set; } + public string uid { get; set; } + public Nullable level { get; set; } + public string Process { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + } +} diff --git a/Project/Properties/AssemblyInfo.cs b/Project/Properties/AssemblyInfo.cs index a5bd9e5..e3baec9 100644 --- a/Project/Properties/AssemblyInfo.cs +++ b/Project/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로 // 지정되도록 할 수 있습니다. // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("20.10.27.1200")] -[assembly: AssemblyFileVersion("20.10.27.1200")] +[assembly: AssemblyVersion("20.10.29.1100")] +[assembly: AssemblyFileVersion("20.10.29.1100")] diff --git a/Project/Properties/Settings.Designer.cs b/Project/Properties/Settings.Designer.cs index 39a6c6a..8abd7e3 100644 --- a/Project/Properties/Settings.Designer.cs +++ b/Project/Properties/Settings.Designer.cs @@ -34,20 +34,6 @@ namespace Project.Properties { } } - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("using System; \r\nnamespace HelloWorld \r\n{ \r\n public static class HelloWorldCla" + - "ss \r\n { \r\n public static string test() \r\n { \r\n " + - " return {0};\r\n } \r\n } \r\n};")] - public string nilliila { - get { - return ((string)(this["nilliila"])); - } - set { - this["nilliila"] = value; - } - } - [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)] diff --git a/Project/Properties/Settings.settings b/Project/Properties/Settings.settings index 72eea44..980e2e6 100644 --- a/Project/Properties/Settings.settings +++ b/Project/Properties/Settings.settings @@ -10,19 +10,6 @@ </SerializableConnectionString> Data Source=10.131.15.18;Initial Catalog=EE;Persist Security Info=True;User ID=eeuser;Password=Amkor123! - - using System; -namespace HelloWorld -{ - public static class HelloWorldClass - { - public static string test() - { - return {0}; - } - } -}; - <?xml version="1.0" encoding="utf-16"?> <SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> diff --git a/Project/UserGroup.cs b/Project/UserGroup.cs new file mode 100644 index 0000000..5edb34f --- /dev/null +++ b/Project/UserGroup.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace Project +{ + using System; + using System.Collections.Generic; + + public partial class UserGroup + { + public string dept { get; set; } + public string gcode { get; set; } + public string path_kj { get; set; } + public Nullable advpurchase { get; set; } + public Nullable permission { get; set; } + } +} diff --git a/Project/Users.cs b/Project/Users.cs new file mode 100644 index 0000000..a0a7544 --- /dev/null +++ b/Project/Users.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace Project +{ + using System; + using System.Collections.Generic; + + public partial class Users + { + public string id { get; set; } + public string gcode { get; set; } + public string password { get; set; } + public string nameE { get; set; } + public string name { get; set; } + public string dept { get; set; } + public string grade { get; set; } + public string email { get; set; } + public Nullable level { get; set; } + public string indate { get; set; } + public string outdate { get; set; } + public string tel { get; set; } + public string hp { get; set; } + public string place { get; set; } + public string ads_employNo { get; set; } + public string ads_title { get; set; } + public string ads_created { get; set; } + public string memo { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + public string processs { get; set; } + } +} diff --git a/Project/_Common/fAddNewUser.cs b/Project/_Common/fAddNewUser.cs index 59edaa7..0218ee6 100644 --- a/Project/_Common/fAddNewUser.cs +++ b/Project/_Common/fAddNewUser.cs @@ -34,7 +34,7 @@ namespace Project._Common return; } - var db = new DataClasses1DataContext(); + var db = new EEEntitiesMain(); var dr_user = db.Users.Where(t => t.id == id).FirstOrDefault(); if (dr_user == null) { @@ -71,7 +71,7 @@ namespace Project._Common private void button2_Click(object sender, EventArgs e) { this.Validate(); - var db = new DataClasses1DataContext(); + var db = new EEEntitiesMain(); //해당 그룹에 데이터를 추가한다. var drDept = db.UserGroup.Where(t => t.dept == tbDept.Text).FirstOrDefault(); @@ -98,11 +98,12 @@ namespace Project._Common drGuser.uid = this.tbId.Text.Trim(); drGuser.Process = this.tbProcess.Text.Trim(); - db.EETGW_GroupUser.InsertOnSubmit(drGuser); + //db.EETGW_GroupUser.InsertOnSubmit(drGuser); + db.EETGW_GroupUser.Add(drGuser); } //사용자 목록에 없다면 추가한다 - var drUser = db.Users.Where(t => t.id == tbId.Text.Trim()).FirstOrDefault(); + var drUser = db.Users.SingleOrDefault(t => t.id == tbId.Text.Trim()); if(drUser == null) { drUser = new Users(); @@ -122,7 +123,7 @@ namespace Project._Common drUser.outdate = tbDateO.Text; drUser.memo = tbMemo.Text; drUser.processs = tbProcess.Text; - db.Users.InsertOnSubmit(drUser); + db.Users.Add(drUser); } else @@ -136,9 +137,9 @@ namespace Project._Common drUser.indate = tbDateIn.Text; drUser.outdate = tbDateO.Text; drUser.memo = tbMemo.Text; - drUser.processs = tbProcess.Text; + drUser.processs = tbProcess.Text; } - db.SubmitChanges(); + db.SaveChanges(); this.DialogResult = DialogResult.OK; } diff --git a/Project/_Common/fUserList.cs b/Project/_Common/fUserList.cs index 50aa8a5..db9f16d 100644 --- a/Project/_Common/fUserList.cs +++ b/Project/_Common/fUserList.cs @@ -63,7 +63,7 @@ namespace Project._Common } //부서목록 업데이트 - var db = new DataClasses1DataContext(); + var db = new EEEntitiesMain(); var GrpList = db.UserGroup.Where(t => t.gcode != null && t.permission != null && t.gcode != "" && t.permission > 0); //var tagrp = new dsMSSQLTableAdapters.UserGroupTableAdapter(); @@ -176,7 +176,7 @@ namespace Project._Common if (tbProcess.Text.Trim() == "") tbProcess.Text = "%"; this.dsMSSQL.Users.Clear(); - var db = new DataClasses1DataContext(); + var db = new EEEntitiesMain(); if (tbProcess.Text.Trim() != "" && tbProcess.Text.Trim() != "%") this.bs.DataSource = db.vGroupUser.Where(t => t.dept == this.cmbdept.Text && t.processs.Contains(tbProcess.Text.Trim())); else diff --git a/Project/app.config b/Project/app.config index 16715eb..e2f4c29 100644 --- a/Project/app.config +++ b/Project/app.config @@ -1,43 +1,22 @@ - - - - -
- - - - - - - - - - using System; -namespace HelloWorld -{ - public static class HelloWorldClass - { - public static string test() - { - return {0}; - } - } -}; - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/Project/packages.config b/Project/packages.config new file mode 100644 index 0000000..775cabc --- /dev/null +++ b/Project/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Project/vGroupUser.cs b/Project/vGroupUser.cs new file mode 100644 index 0000000..b66656d --- /dev/null +++ b/Project/vGroupUser.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace Project +{ + using System; + using System.Collections.Generic; + + public partial class vGroupUser + { + public string gcode { get; set; } + public string dept { get; set; } + public Nullable level { get; set; } + public string name { get; set; } + public string nameE { get; set; } + public string grade { get; set; } + public string email { get; set; } + public string tel { get; set; } + public string indate { get; set; } + public string outdate { get; set; } + public string hp { get; set; } + public string place { get; set; } + public string ads_employNo { get; set; } + public string ads_title { get; set; } + public string ads_created { get; set; } + public string memo { get; set; } + public string processs { get; set; } + public string id { get; set; } + } +} diff --git a/ReportForUser.xlsx b/ReportForUser.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..7403dacb6a5918eec8a3f4b2ccb251b0e981b948 GIT binary patch literal 12592 zcmeHtg;QMV^7dfC-6c4|-Q5Z9F2UUg3-0a&cPF?L+}+(>gA-f=eC+PMwY%B<{(|2< zH8rQE&grM-^xMyQ`t5FcDKKy}z&ijG001BYII?LLx`6-y0T2KHDgX*pOW4-N(b&dO zSJ~Ch*g=Q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if$1pVm%NO-AcK>81T+W#%}K%4Sye`YDCcna9Re#@4l<(%^v@rX zO&dY_3rTWe6)zCXZyPK?{0zSe_}(Ir`-6MC^Q!N?v`$j-7R9|72^C4L@@ZYvE;dEW zI`{W%F>t`GU=exyZOoS*G+59$)lwsT9Rx301-+`L#g}vEHAO1VAGWhyKdCYpuk2}N zN9pY;PCngbYRoe>e5Qr8(Ati8ha9MWt-W2+ieP#L^bL#8CzTaXUr!<}Fqa&b{OnoWoOLiT|XJ1JnY1^RuYTQ7CCnZxT(oIcEd4aDZa%YurxK*W37k0bpx5cTcs z{uhUDF8j}s9#?IH#)uT;PP(qY$9K@?L+p6T6-FmWDUj}%bluPGZn{;kc5CGHF<3;@ z%*+f51yKMKCKHzaZ0-gxxoQVy;fCi+<(`J>)&@?>B zon9S9p-EfgoX`+AY z)>FNJNyf4JWbW3fAGrw}yeqLLJVqsFwkfQDw1#&r%Fq~FyxF5VT3^FZpr=8BD|pf3%K|GqHbpv_E6pH8dUF0{o6Yzu$!C@{YPE`p;Tgot#hvSNok&Sn zb=X>bQMEF{9dn{2kY5$*TiV+Dum?$q!9&J|v<-w_N?O)MHlt=m8|a7fgPh41|ErhU zksnI@d3AcE1|`eWK@2Qve|2On{(8K*5;Llp$ucp6l_5L)CBKpJh*Nxw= z2*0M!eT@K^I`s=t{3M;YX$Al@SQw>m96!03$x4Ya@g`hN*5 BB-8)^ literal 0 HcmV?d00001 diff --git a/SubProject/FPJ0000/Common.cs b/SubProject/FPJ0000/Common.cs new file mode 100644 index 0000000..d74e7d5 --- /dev/null +++ b/SubProject/FPJ0000/Common.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace FPJ0000 +{ + using System; + using System.Collections.Generic; + + public partial class Common + { + public int idx { get; set; } + public string gcode { get; set; } + public string grp { get; set; } + public string code { get; set; } + public string svalue { get; set; } + public Nullable ivalue { get; set; } + public Nullable fvalue { get; set; } + public string memo { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + } +} diff --git a/SubProject/FPJ0000/FPJ0000.csproj b/SubProject/FPJ0000/FPJ0000.csproj index 4eb817c..5aa298a 100644 --- a/SubProject/FPJ0000/FPJ0000.csproj +++ b/SubProject/FPJ0000/FPJ0000.csproj @@ -38,6 +38,12 @@ ..\..\DLL\ArSetting.Net4.dll + + ..\..\packages\EntityFramework.6.2.0\lib\net40\EntityFramework.dll + + + ..\..\packages\EntityFramework.6.2.0\lib\net40\EntityFramework.SqlServer.dll + @@ -80,8 +86,11 @@ ..\..\packages\RichTextBoxEx.1.0.0\lib\RichTextBoxEx.dll + + + @@ -99,6 +108,9 @@ + + Model1.tt + True @@ -143,6 +155,9 @@ fMailList.cs + + Model1.tt + Form @@ -155,6 +170,27 @@ rJobChart.cs + + Form + + + rJobReportUser.cs + + + True + True + Model1.Context.tt + + + True + True + Model1.tt + + + True + True + Model1.edmx + Form @@ -297,6 +333,24 @@ fProjectPartImport.cs + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + + + Model1.tt + fHistAdd.cs @@ -313,6 +367,9 @@ rJobChart.cs + + rJobReportUser.cs + fNote.cs @@ -452,6 +509,13 @@ dsReport.xsd + + EntityModelCodeGenerator + Model1.Designer.cs + + + Model1.edmx + SettingsSingleFileGenerator @@ -482,6 +546,9 @@ + + PreserveNewest + @@ -496,6 +563,21 @@ + + + + + + TextTemplatingFileGenerator + Model1.Context.cs + Model1.edmx + + + TextTemplatingFileGenerator + Model1.edmx + Model1.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 119, 17 + + + 17, 17 + + + 17, 17 + + + 183, 17 + + + 245, 17 + + \ No newline at end of file diff --git a/SubProject/FPJ0000/Model1.Context.cs b/SubProject/FPJ0000/Model1.Context.cs new file mode 100644 index 0000000..909c139 --- /dev/null +++ b/SubProject/FPJ0000/Model1.Context.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace FPJ0000 +{ + using System; + using System.Data.Entity; + using System.Data.Entity.Infrastructure; + + public partial class EEEntities : DbContext + { + public EEEntities() + : base("name=EEEntities") + { + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + + public virtual DbSet Common { get; set; } + public virtual DbSet UserGroup { get; set; } + public virtual DbSet Users { get; set; } + public virtual DbSet vHoliday_uselist { get; set; } + public virtual DbSet vUserWorkTimeList { get; set; } + public virtual DbSet HolidayLIst { get; set; } + public virtual DbSet vJobReportForUser { get; set; } + public virtual DbSet vGroupUser { get; set; } + } +} diff --git a/SubProject/FPJ0000/Model1.Context.tt b/SubProject/FPJ0000/Model1.Context.tt new file mode 100644 index 0000000..ba33bb5 --- /dev/null +++ b/SubProject/FPJ0000/Model1.Context.tt @@ -0,0 +1,636 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF6.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +const string inputFile = @"Model1.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().FirstOrDefault(); +if (container == null) +{ + return string.Empty; +} +#> +//------------------------------------------------------------------------------ +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ + +<# + +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()) +{ + // 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()) + { +#> + <#=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 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(); + } + + 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 types, string sourceFile) + { + ArgumentNotNull(types, "types"); + ArgumentNotNull(sourceFile, "sourceFile"); + + var hash = new HashSet(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 GetEnumItemsToGenerate(IEnumerable itemCollection) + { + return GetItemsToGenerate(itemCollection) + .Where(e => IsEnumType(e)); + } + + public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType + { + return itemCollection + .OfType() + .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) + .OrderBy(i => i.Name); + } + + public IEnumerable GetAllGlobalItems(IEnumerable 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 GetSimpleProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetSimpleProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetPropertiesWithDefaultValues(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type); + } + + public IEnumerable 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)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 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 arg, string name) where T : class +{ + if (arg == null) + { + throw new ArgumentNullException(name); + } +} +#> \ No newline at end of file diff --git a/SubProject/FPJ0000/Model1.Designer.cs b/SubProject/FPJ0000/Model1.Designer.cs new file mode 100644 index 0000000..5f0ff54 --- /dev/null +++ b/SubProject/FPJ0000/Model1.Designer.cs @@ -0,0 +1,10 @@ +// 모델 'D:\Source\##### 완료아이템\(014) GroupWare\Source\SubProject\FPJ0000\Model1.edmx'에 대해 T4 코드 생성이 사용됩니다. +// 레거시 코드 생성을 사용하려면 '코드 생성 전략' 디자이너 속성의 값을 +// 'Legacy ObjectContext'로 변경하십시오. 이 속성은 모델이 디자이너에서 열릴 때 +// 속성 창에서 사용할 수 있습니다. + +// 컨텍스트 및 엔터티 클래스가 생성되지 않은 경우 빈 모델을 만들었기 때문일 수도 있지만 +// 사용할 Entity Framework 버전을 선택하지 않았기 때문일 수도 있습니다. 모델에 맞는 컨텍스트 클래스 및 +// 엔터티 클래스를 생성하려면 디자이너에서 모델을 열고 디자이너 화면에서 마우스 오른쪽 단추를 클릭한 +// 다음 '데이터베이스에서 모델 업데이트...', '모델에서 데이터베이스 생성...' 또는 '코드 생성 항목 추가...'를 +// 선택하십시오. \ No newline at end of file diff --git a/SubProject/FPJ0000/Model1.cs b/SubProject/FPJ0000/Model1.cs new file mode 100644 index 0000000..7a9ab12 --- /dev/null +++ b/SubProject/FPJ0000/Model1.cs @@ -0,0 +1,9 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + diff --git a/SubProject/FPJ0000/Model1.edmx b/SubProject/FPJ0000/Model1.edmx new file mode 100644 index 0000000..46df710 --- /dev/null +++ b/SubProject/FPJ0000/Model1.edmx @@ -0,0 +1,525 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SELECT + [vGroupUser].[gcode] AS [gcode], + [vGroupUser].[dept] AS [dept], + [vGroupUser].[level] AS [level], + [vGroupUser].[name] AS [name], + [vGroupUser].[nameE] AS [nameE], + [vGroupUser].[grade] AS [grade], + [vGroupUser].[email] AS [email], + [vGroupUser].[tel] AS [tel], + [vGroupUser].[indate] AS [indate], + [vGroupUser].[outdate] AS [outdate], + [vGroupUser].[hp] AS [hp], + [vGroupUser].[place] AS [place], + [vGroupUser].[ads_employNo] AS [ads_employNo], + [vGroupUser].[ads_title] AS [ads_title], + [vGroupUser].[ads_created] AS [ads_created], + [vGroupUser].[memo] AS [memo], + [vGroupUser].[processs] AS [processs], + [vGroupUser].[id] AS [id] + FROM [dbo].[vGroupUser] AS [vGroupUser] + + + SELECT + [vHoliday_uselist].[idx] AS [idx], + [vHoliday_uselist].[gcode] AS [gcode], + [vHoliday_uselist].[pdate] AS [pdate], + [vHoliday_uselist].[term] AS [term], + [vHoliday_uselist].[termdr] AS [termdr], + [vHoliday_uselist].[description] AS [description], + [vHoliday_uselist].[uid] AS [uid], + [vHoliday_uselist].[wuid] AS [wuid], + [vHoliday_uselist].[wdate] AS [wdate] + FROM [dbo].[vHoliday_uselist] AS [vHoliday_uselist] + + + SELECT + [vJobReportForUser].[idx] AS [idx], + [vJobReportForUser].[pdate] AS [pdate], + [vJobReportForUser].[gcode] AS [gcode], + [vJobReportForUser].[id] AS [id], + [vJobReportForUser].[name] AS [name], + [vJobReportForUser].[process] AS [process], + [vJobReportForUser].[type] AS [type], + [vJobReportForUser].[svalue] AS [svalue], + [vJobReportForUser].[hrs] AS [hrs], + [vJobReportForUser].[ot] AS [ot], + [vJobReportForUser].[userProcess] AS [userProcess] + FROM [dbo].[vJobReportForUser] AS [vJobReportForUser] + + + SELECT + [vUserWorkTimeList].[gcode] AS [gcode], + [vUserWorkTimeList].[yymm] AS [yymm], + [vUserWorkTimeList].[total] AS [total], + [vUserWorkTimeList].[uid] AS [uid], + [vUserWorkTimeList].[uname] AS [uname], + [vUserWorkTimeList].[hrs] AS [hrs], + [vUserWorkTimeList].[ot] AS [ot] + FROM [dbo].[vUserWorkTimeList] AS [vUserWorkTimeList] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SubProject/FPJ0000/Model1.edmx.diagram b/SubProject/FPJ0000/Model1.edmx.diagram new file mode 100644 index 0000000..30e51ed --- /dev/null +++ b/SubProject/FPJ0000/Model1.edmx.diagram @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SubProject/FPJ0000/Model1.tt b/SubProject/FPJ0000/Model1.tt new file mode 100644 index 0000000..985966b --- /dev/null +++ b/SubProject/FPJ0000/Model1.tt @@ -0,0 +1,733 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF6.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +const string inputFile = @"Model1.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(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(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(); +#> +//------------------------------------------------------------------------------ +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ +<#=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 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(); + } + + 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 types, string sourceFile) + { + ArgumentNotNull(types, "types"); + ArgumentNotNull(sourceFile, "sourceFile"); + + var hash = new HashSet(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 GetEnumItemsToGenerate(IEnumerable itemCollection) + { + return GetItemsToGenerate(itemCollection) + .Where(e => IsEnumType(e)); + } + + public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType + { + return itemCollection + .OfType() + .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) + .OrderBy(i => i.Name); + } + + public IEnumerable GetAllGlobalItems(IEnumerable 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 GetSimpleProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetSimpleProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetPropertiesWithDefaultValues(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type); + } + + public IEnumerable 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)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 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 arg, string name) where T : class +{ + if (arg == null) + { + throw new ArgumentNullException(name); + } +} +#> \ No newline at end of file diff --git a/SubProject/FPJ0000/Project/fPartList.cs b/SubProject/FPJ0000/Project/fPartList.cs index 07c7a58..f0be4ba 100644 --- a/SubProject/FPJ0000/Project/fPartList.cs +++ b/SubProject/FPJ0000/Project/fPartList.cs @@ -26,6 +26,7 @@ namespace FPJ0000 int colidx_supplyidx = -1; int colidx_sid = -1; int colidx_manu = -1; + int colidx_unit = -1; public fPartList(int idx_) @@ -114,6 +115,7 @@ namespace FPJ0000 else if (colname == "itemsupply") colidx_supply = col.Index; else if (colname == "itemsid") colidx_sid = col.Index; else if (colname == "itemmanu") colidx_manu = col.Index; + else if (colname == "itemunit") colidx_unit = col.Index; } this.Show(); Application.DoEvents(); @@ -485,8 +487,10 @@ namespace FPJ0000 //fpSpread1.ActiveSheet.Cells[Rowidx, colidx_supplyidx].Value = f.itemSupplyidx; //fpSpread1.ActiveSheet.Cells[Rowidx, colidx_supply].Value = f.itemSupply; - //제조사추가 201022 + //제조사추가 201022 - 박성민 fpSpread1.ActiveSheet.Cells[Rowidx, colidx_manu].Value = f.itemManu.Replace(" ", "").Trim(); + //단위추가 201028 - 박성민 + fpSpread1.ActiveSheet.Cells[Rowidx, colidx_unit].Value = f.itemUnit.Replace(" ", "").Trim(); if (f.itemmodel != "") fpSpread1.ActiveSheet.Cells[Rowidx, colidx_model].Value = f.itemmodel; diff --git a/SubProject/FPJ0000/Project/fPartList.resx b/SubProject/FPJ0000/Project/fPartList.resx index 6398f9a..d546c5d 100644 --- a/SubProject/FPJ0000/Project/fPartList.resx +++ b/SubProject/FPJ0000/Project/fPartList.resx @@ -396,20 +396,20 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALvSURBVDhPhZJZTxNRGIZ7JT/BoBdekrhAFKNGLxQELGCC - GwJBZCuFgIAEajARawpGZDEgARI1BKLxQg24QAHLVtrSNrQKUhCQfUtYKtBlpu20vJ6ZVsCExC95ci7O - vE/me2d47AQ/kCdcLtXIIso0v0PEGoqcNEc5e2rpiFI1HfZUZTgnUlQejny3jwvtntDHSsWKiV4zGAxO - o8UGo3mHNRMLjZ9LJhR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mFxs8lM/K+zCGmZNTGz5AfdEddE16oWWHD2hk79LMM9HMMdDMMNNPbUP7aQsuIFVsM0DhK + Ie/TLJJfGKl/JCHSFmrTto2+eQf65xlyMujlJNtQTWzh24iNCJzoW3JAv2hHgXwOgQ863nHh6NKAqVvS + yB1h1Q0kV95EZWsd8utLESj1RQCBX3AOwbLTKGss41ax0AyW120IjlcxnCCqOPBjx3ATmsZfo1KXw0ni + K8KQ8zYOmXUxEFRfRVJ1EhoHl9FktODr0CY2SE8hsm6aE/DL+Qd9pFkO3VgX3gzLUKTM4CQJVeEkfA2i + l6lQT1i5VdrHKShID+tWO0Lye1wCdkILVbS4JhGGCQ2q9ffxtC0b0aWXkFARCcOMDQZSLFuwetLViYkI + gmV7BBceSe1nco8irpyPvkktCrrSIJOLEfM8CHXKz/i+wMBAitVO29FDWDHbEfjYLTgp8RL6S44gszYW + t6tCEVt2mZOI5XGQ1KeSNwkCe98350Av+4kJZlKkX5bGJfCXHFrwlxwmD3nBP8cL14uCkP4qEeoRBQoU + uUj7kAhBVRQMRKAn/4aOCGi7kwiUnhUuZnXTSxs0BhccHKqxRdyrESGFBIXVMciuvbt7x2LbdhBBg0fA + 2uZNHsH/sLIrpO4RnBV32uQqw85+D+/HwJDReTy+0eKOkyJFbVOzmzZzp7rfObVKYWqFwoSbVYudg23e + QpMiB4adFEVteN9p/uGO83inRK3pfoKWthNChclP2EDvkuLC9y+CBtpb0Lx+LKm53TdRnszj8Xh/AIdo + nvbIfe02AAAAAElFTkSuQmCC diff --git a/SubProject/FPJ0000/Project/fSPMaster.Designer.cs b/SubProject/FPJ0000/Project/fSPMaster.Designer.cs index 3a5a511..289daa7 100644 --- a/SubProject/FPJ0000/Project/fSPMaster.Designer.cs +++ b/SubProject/FPJ0000/Project/fSPMaster.Designer.cs @@ -33,21 +33,21 @@ FarPoint.Win.Spread.FlatFocusIndicatorRenderer flatFocusIndicatorRenderer1 = new FarPoint.Win.Spread.FlatFocusIndicatorRenderer(); FarPoint.Win.Spread.FlatScrollBarRenderer flatScrollBarRenderer1 = new FarPoint.Win.Spread.FlatScrollBarRenderer(); FarPoint.Win.Spread.FlatScrollBarRenderer flatScrollBarRenderer2 = new FarPoint.Win.Spread.FlatScrollBarRenderer(); - FarPoint.Win.Spread.CellType.NumberCellType numberCellType1 = new FarPoint.Win.Spread.CellType.NumberCellType(); - FarPoint.Win.Spread.CellType.TextCellType textCellType1 = new FarPoint.Win.Spread.CellType.TextCellType(); - FarPoint.Win.Spread.CellType.TextCellType textCellType2 = new FarPoint.Win.Spread.CellType.TextCellType(); - FarPoint.Win.Spread.CellType.NumberCellType numberCellType2 = new FarPoint.Win.Spread.CellType.NumberCellType(); - FarPoint.Win.Spread.CellType.TextCellType textCellType3 = new FarPoint.Win.Spread.CellType.TextCellType(); - FarPoint.Win.Spread.CellType.TextCellType textCellType4 = new FarPoint.Win.Spread.CellType.TextCellType(); - FarPoint.Win.Spread.CellType.TextCellType textCellType5 = new FarPoint.Win.Spread.CellType.TextCellType(); - FarPoint.Win.Spread.CellType.TextCellType textCellType6 = new FarPoint.Win.Spread.CellType.TextCellType(); - FarPoint.Win.Spread.CellType.TextCellType textCellType7 = new FarPoint.Win.Spread.CellType.TextCellType(); - FarPoint.Win.Spread.CellType.TextCellType textCellType8 = new FarPoint.Win.Spread.CellType.TextCellType(); - FarPoint.Win.Spread.CellType.TextCellType textCellType9 = new FarPoint.Win.Spread.CellType.TextCellType(); - FarPoint.Win.Spread.CellType.TextCellType textCellType10 = new FarPoint.Win.Spread.CellType.TextCellType(); - FarPoint.Win.Spread.CellType.TextCellType textCellType11 = new FarPoint.Win.Spread.CellType.TextCellType(); - FarPoint.Win.Spread.CellType.TextCellType textCellType12 = new FarPoint.Win.Spread.CellType.TextCellType(); - FarPoint.Win.Spread.CellType.TextCellType textCellType13 = new FarPoint.Win.Spread.CellType.TextCellType(); + FarPoint.Win.Spread.CellType.NumberCellType numberCellType5 = new FarPoint.Win.Spread.CellType.NumberCellType(); + FarPoint.Win.Spread.CellType.TextCellType textCellType27 = new FarPoint.Win.Spread.CellType.TextCellType(); + FarPoint.Win.Spread.CellType.TextCellType textCellType28 = new FarPoint.Win.Spread.CellType.TextCellType(); + FarPoint.Win.Spread.CellType.NumberCellType numberCellType6 = new FarPoint.Win.Spread.CellType.NumberCellType(); + FarPoint.Win.Spread.CellType.TextCellType textCellType29 = new FarPoint.Win.Spread.CellType.TextCellType(); + FarPoint.Win.Spread.CellType.TextCellType textCellType30 = new FarPoint.Win.Spread.CellType.TextCellType(); + FarPoint.Win.Spread.CellType.TextCellType textCellType31 = new FarPoint.Win.Spread.CellType.TextCellType(); + FarPoint.Win.Spread.CellType.TextCellType textCellType32 = new FarPoint.Win.Spread.CellType.TextCellType(); + FarPoint.Win.Spread.CellType.TextCellType textCellType33 = new FarPoint.Win.Spread.CellType.TextCellType(); + FarPoint.Win.Spread.CellType.TextCellType textCellType34 = new FarPoint.Win.Spread.CellType.TextCellType(); + FarPoint.Win.Spread.CellType.TextCellType textCellType35 = new FarPoint.Win.Spread.CellType.TextCellType(); + FarPoint.Win.Spread.CellType.TextCellType textCellType36 = new FarPoint.Win.Spread.CellType.TextCellType(); + FarPoint.Win.Spread.CellType.TextCellType textCellType37 = new FarPoint.Win.Spread.CellType.TextCellType(); + FarPoint.Win.Spread.CellType.TextCellType textCellType38 = new FarPoint.Win.Spread.CellType.TextCellType(); + FarPoint.Win.Spread.CellType.TextCellType textCellType39 = new FarPoint.Win.Spread.CellType.TextCellType(); this.bn = new System.Windows.Forms.BindingNavigator(this.components); this.bs = new System.Windows.Forms.BindingSource(this.components); this.dsMSSQL = new FPJ0000.dsPRJ(); @@ -71,19 +71,20 @@ this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.fpSpread1_Sheet1 = new FarPoint.Win.Spread.SheetView(); this.panel2 = new System.Windows.Forms.Panel(); this.tbFind = new System.Windows.Forms.TextBox(); this.button1 = new System.Windows.Forms.Button(); this.label3 = new System.Windows.Forms.Label(); - this.fpSpread1_Sheet1 = new FarPoint.Win.Spread.SheetView(); + this.chkZeroCount = new System.Windows.Forms.ToolStripButton(); ((System.ComponentModel.ISupportInitialize)(this.bn)).BeginInit(); this.bn.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.bs)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dsMSSQL)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).BeginInit(); this.cm1.SuspendLayout(); - this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).BeginInit(); + this.panel2.SuspendLayout(); this.SuspendLayout(); // // bn @@ -103,7 +104,8 @@ this.bindingNavigatorMoveNextItem, this.bindingNavigatorMoveLastItem, this.bindingNavigatorSeparator2, - this.toolStripSeparator1}); + this.toolStripSeparator1, + this.chkZeroCount}); this.bn.Location = new System.Drawing.Point(0, 514); this.bn.MoveFirstItem = this.bindingNavigatorMoveFirstItem; this.bn.MoveLastItem = this.bindingNavigatorMoveLastItem; @@ -119,6 +121,7 @@ // this.bs.DataMember = "SPMaster"; this.bs.DataSource = this.dsMSSQL; + this.bs.Filter = "CurrentQty > 0"; this.bs.CurrentChanged += new System.EventHandler(this.bs_CurrentChanged); // // dsMSSQL @@ -205,6 +208,7 @@ // tam // this.tam.BackupDataSetBeforeUpdate = false; + this.tam.EETGW_NoteTableAdapter = null; this.tam.JobReportTableAdapter = null; this.tam.ProjectsHistoryTableAdapter = null; this.tam.ProjectsIOMapTableAdapter = null; @@ -298,6 +302,104 @@ this.exportListToolStripMenuItem.Text = "목록 내보내기"; this.exportListToolStripMenuItem.Click += new System.EventHandler(this.exportListToolStripMenuItem_Click); // + // fpSpread1_Sheet1 + // + this.fpSpread1_Sheet1.Reset(); + this.fpSpread1_Sheet1.SheetName = "Sheet1"; + // Formulas and custom names must be loaded with R1C1 reference style + this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1; + this.fpSpread1_Sheet1.ColumnCount = 15; + this.fpSpread1_Sheet1.ActiveColumnIndex = -1; + this.fpSpread1_Sheet1.ActiveRowIndex = -1; + this.fpSpread1_Sheet1.AutoGenerateColumns = false; + this.fpSpread1_Sheet1.ColumnFooter.DefaultStyle.BackColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.ColumnFooter.DefaultStyle.ForeColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.ColumnFooter.DefaultStyle.Parent = "ColumnFooterFlat"; + this.fpSpread1_Sheet1.ColumnFooterSheetCornerStyle.BackColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.ColumnFooterSheetCornerStyle.ForeColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.ColumnFooterSheetCornerStyle.Parent = "CornerFooterFlat"; + this.fpSpread1_Sheet1.ColumnHeader.DefaultStyle.BackColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.ColumnHeader.DefaultStyle.ForeColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.ColumnHeader.DefaultStyle.Parent = "ColumnHeaderFlat"; + this.fpSpread1_Sheet1.ColumnHeader.Rows.Get(0).Height = 36F; + numberCellType5.DecimalPlaces = 0; + numberCellType5.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.Yes; + numberCellType5.MaximumValue = 2147483647D; + numberCellType5.MinimumValue = -2147483648D; + this.fpSpread1_Sheet1.Columns.Get(0).CellType = numberCellType5; + this.fpSpread1_Sheet1.Columns.Get(0).DataField = "ID"; + this.fpSpread1_Sheet1.Columns.Get(0).Visible = false; + this.fpSpread1_Sheet1.Columns.Get(0).Width = 77F; + this.fpSpread1_Sheet1.Columns.Get(1).CellType = textCellType27; + this.fpSpread1_Sheet1.Columns.Get(1).DataField = "CtrlNo"; + this.fpSpread1_Sheet1.Columns.Get(1).Visible = false; + this.fpSpread1_Sheet1.Columns.Get(1).Width = 151F; + this.fpSpread1_Sheet1.Columns.Get(2).CellType = textCellType28; + this.fpSpread1_Sheet1.Columns.Get(2).DataField = "SIDNo"; + this.fpSpread1_Sheet1.Columns.Get(2).Width = 98F; + this.fpSpread1_Sheet1.Columns.Get(3).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); + numberCellType6.MaximumValue = 999999999999999D; + numberCellType6.MinimumValue = -999999999999999D; + this.fpSpread1_Sheet1.Columns.Get(3).CellType = numberCellType6; + this.fpSpread1_Sheet1.Columns.Get(3).DataField = "CurrentQty"; + this.fpSpread1_Sheet1.Columns.Get(3).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center; + this.fpSpread1_Sheet1.Columns.Get(3).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center; + this.fpSpread1_Sheet1.Columns.Get(3).Width = 97F; + this.fpSpread1_Sheet1.Columns.Get(4).CellType = textCellType29; + this.fpSpread1_Sheet1.Columns.Get(4).DataField = "PartName"; + this.fpSpread1_Sheet1.Columns.Get(4).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center; + this.fpSpread1_Sheet1.Columns.Get(4).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center; + this.fpSpread1_Sheet1.Columns.Get(4).Width = 91F; + this.fpSpread1_Sheet1.Columns.Get(5).CellType = textCellType30; + this.fpSpread1_Sheet1.Columns.Get(5).DataField = "PartNo"; + this.fpSpread1_Sheet1.Columns.Get(5).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center; + this.fpSpread1_Sheet1.Columns.Get(5).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center; + this.fpSpread1_Sheet1.Columns.Get(6).CellType = textCellType31; + this.fpSpread1_Sheet1.Columns.Get(6).DataField = "Storage"; + this.fpSpread1_Sheet1.Columns.Get(6).Width = 91F; + this.fpSpread1_Sheet1.Columns.Get(7).CellType = textCellType32; + this.fpSpread1_Sheet1.Columns.Get(7).DataField = "Location"; + this.fpSpread1_Sheet1.Columns.Get(7).Width = 97F; + this.fpSpread1_Sheet1.Columns.Get(8).CellType = textCellType33; + this.fpSpread1_Sheet1.Columns.Get(8).DataField = "UseEqmt"; + this.fpSpread1_Sheet1.Columns.Get(8).Visible = false; + this.fpSpread1_Sheet1.Columns.Get(8).Width = 151F; + this.fpSpread1_Sheet1.Columns.Get(9).CellType = textCellType34; + this.fpSpread1_Sheet1.Columns.Get(9).DataField = "SupplierNo"; + this.fpSpread1_Sheet1.Columns.Get(9).Visible = false; + this.fpSpread1_Sheet1.Columns.Get(9).Width = 151F; + this.fpSpread1_Sheet1.Columns.Get(10).CellType = textCellType35; + this.fpSpread1_Sheet1.Columns.Get(10).DataField = "Division"; + this.fpSpread1_Sheet1.Columns.Get(10).Width = 126F; + this.fpSpread1_Sheet1.Columns.Get(11).CellType = textCellType36; + this.fpSpread1_Sheet1.Columns.Get(11).DataField = "PriceUnit"; + this.fpSpread1_Sheet1.Columns.Get(11).Width = 72F; + this.fpSpread1_Sheet1.Columns.Get(12).CellType = textCellType37; + this.fpSpread1_Sheet1.Columns.Get(12).DataField = "Memo"; + this.fpSpread1_Sheet1.Columns.Get(12).Width = 77F; + this.fpSpread1_Sheet1.Columns.Get(13).CellType = textCellType38; + this.fpSpread1_Sheet1.Columns.Get(13).DataField = "EnrDate"; + this.fpSpread1_Sheet1.Columns.Get(13).Width = 96F; + this.fpSpread1_Sheet1.Columns.Get(14).CellType = textCellType39; + this.fpSpread1_Sheet1.Columns.Get(14).DataField = "Enrollee"; + this.fpSpread1_Sheet1.Columns.Get(14).Width = 94F; + this.fpSpread1_Sheet1.DataAutoSizeColumns = false; + this.fpSpread1_Sheet1.DataSource = this.bs; + this.fpSpread1_Sheet1.FilterBar.DefaultStyle.BackColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.FilterBar.DefaultStyle.ForeColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.FilterBar.DefaultStyle.Parent = "FilterBarFlat"; + this.fpSpread1_Sheet1.FilterBarHeaderStyle.BackColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.FilterBarHeaderStyle.ForeColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.FilterBarHeaderStyle.Parent = "FilterBarHeaderFlat"; + this.fpSpread1_Sheet1.RowHeader.Columns.Default.Resizable = false; + this.fpSpread1_Sheet1.RowHeader.DefaultStyle.BackColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.RowHeader.DefaultStyle.ForeColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.RowHeader.DefaultStyle.Parent = "RowHeaderFlat"; + this.fpSpread1_Sheet1.SheetCornerStyle.BackColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.SheetCornerStyle.ForeColor = System.Drawing.Color.Empty; + this.fpSpread1_Sheet1.SheetCornerStyle.Parent = "CornerHeaderFlat"; + this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1; + // // panel2 // this.panel2.Controls.Add(this.tbFind); @@ -344,103 +446,15 @@ this.label3.Text = "검색"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // fpSpread1_Sheet1 + // chkZeroCount // - this.fpSpread1_Sheet1.Reset(); - this.fpSpread1_Sheet1.SheetName = "Sheet1"; - // Formulas and custom names must be loaded with R1C1 reference style - this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1; - this.fpSpread1_Sheet1.ColumnCount = 15; - this.fpSpread1_Sheet1.ActiveColumnIndex = -1; - this.fpSpread1_Sheet1.ActiveRowIndex = -1; - this.fpSpread1_Sheet1.AutoGenerateColumns = false; - this.fpSpread1_Sheet1.ColumnFooter.DefaultStyle.BackColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.ColumnFooter.DefaultStyle.ForeColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.ColumnFooter.DefaultStyle.Parent = "ColumnFooterFlat"; - this.fpSpread1_Sheet1.ColumnFooterSheetCornerStyle.BackColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.ColumnFooterSheetCornerStyle.ForeColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.ColumnFooterSheetCornerStyle.Parent = "CornerFooterFlat"; - this.fpSpread1_Sheet1.ColumnHeader.DefaultStyle.BackColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.ColumnHeader.DefaultStyle.ForeColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.ColumnHeader.DefaultStyle.Parent = "ColumnHeaderFlat"; - this.fpSpread1_Sheet1.ColumnHeader.Rows.Get(0).Height = 36F; - numberCellType1.DecimalPlaces = 0; - numberCellType1.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.Yes; - numberCellType1.MaximumValue = 2147483647D; - numberCellType1.MinimumValue = -2147483648D; - this.fpSpread1_Sheet1.Columns.Get(0).CellType = numberCellType1; - this.fpSpread1_Sheet1.Columns.Get(0).DataField = "ID"; - this.fpSpread1_Sheet1.Columns.Get(0).Visible = false; - this.fpSpread1_Sheet1.Columns.Get(0).Width = 77F; - this.fpSpread1_Sheet1.Columns.Get(1).CellType = textCellType1; - this.fpSpread1_Sheet1.Columns.Get(1).DataField = "CtrlNo"; - this.fpSpread1_Sheet1.Columns.Get(1).Visible = false; - this.fpSpread1_Sheet1.Columns.Get(1).Width = 151F; - this.fpSpread1_Sheet1.Columns.Get(2).CellType = textCellType2; - this.fpSpread1_Sheet1.Columns.Get(2).DataField = "SIDNo"; - this.fpSpread1_Sheet1.Columns.Get(2).Width = 98F; - this.fpSpread1_Sheet1.Columns.Get(3).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); - numberCellType2.MaximumValue = 999999999999999D; - numberCellType2.MinimumValue = -999999999999999D; - this.fpSpread1_Sheet1.Columns.Get(3).CellType = numberCellType2; - this.fpSpread1_Sheet1.Columns.Get(3).DataField = "CurrentQty"; - this.fpSpread1_Sheet1.Columns.Get(3).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center; - this.fpSpread1_Sheet1.Columns.Get(3).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center; - this.fpSpread1_Sheet1.Columns.Get(3).Width = 97F; - this.fpSpread1_Sheet1.Columns.Get(4).CellType = textCellType3; - this.fpSpread1_Sheet1.Columns.Get(4).DataField = "PartName"; - this.fpSpread1_Sheet1.Columns.Get(4).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center; - this.fpSpread1_Sheet1.Columns.Get(4).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center; - this.fpSpread1_Sheet1.Columns.Get(4).Width = 91F; - this.fpSpread1_Sheet1.Columns.Get(5).CellType = textCellType4; - this.fpSpread1_Sheet1.Columns.Get(5).DataField = "PartNo"; - this.fpSpread1_Sheet1.Columns.Get(5).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center; - this.fpSpread1_Sheet1.Columns.Get(5).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center; - this.fpSpread1_Sheet1.Columns.Get(6).CellType = textCellType5; - this.fpSpread1_Sheet1.Columns.Get(6).DataField = "Storage"; - this.fpSpread1_Sheet1.Columns.Get(6).Width = 91F; - this.fpSpread1_Sheet1.Columns.Get(7).CellType = textCellType6; - this.fpSpread1_Sheet1.Columns.Get(7).DataField = "Location"; - this.fpSpread1_Sheet1.Columns.Get(7).Width = 97F; - this.fpSpread1_Sheet1.Columns.Get(8).CellType = textCellType7; - this.fpSpread1_Sheet1.Columns.Get(8).DataField = "UseEqmt"; - this.fpSpread1_Sheet1.Columns.Get(8).Visible = false; - this.fpSpread1_Sheet1.Columns.Get(8).Width = 151F; - this.fpSpread1_Sheet1.Columns.Get(9).CellType = textCellType8; - this.fpSpread1_Sheet1.Columns.Get(9).DataField = "SupplierNo"; - this.fpSpread1_Sheet1.Columns.Get(9).Visible = false; - this.fpSpread1_Sheet1.Columns.Get(9).Width = 151F; - this.fpSpread1_Sheet1.Columns.Get(10).CellType = textCellType9; - this.fpSpread1_Sheet1.Columns.Get(10).DataField = "Division"; - this.fpSpread1_Sheet1.Columns.Get(10).Width = 126F; - this.fpSpread1_Sheet1.Columns.Get(11).CellType = textCellType10; - this.fpSpread1_Sheet1.Columns.Get(11).DataField = "PriceUnit"; - this.fpSpread1_Sheet1.Columns.Get(11).Width = 72F; - this.fpSpread1_Sheet1.Columns.Get(12).CellType = textCellType11; - this.fpSpread1_Sheet1.Columns.Get(12).DataField = "Memo"; - this.fpSpread1_Sheet1.Columns.Get(12).Width = 77F; - this.fpSpread1_Sheet1.Columns.Get(13).CellType = textCellType12; - this.fpSpread1_Sheet1.Columns.Get(13).DataField = "EnrDate"; - this.fpSpread1_Sheet1.Columns.Get(13).Width = 96F; - this.fpSpread1_Sheet1.Columns.Get(14).CellType = textCellType13; - this.fpSpread1_Sheet1.Columns.Get(14).DataField = "Enrollee"; - this.fpSpread1_Sheet1.Columns.Get(14).Width = 94F; - this.fpSpread1_Sheet1.DataAutoSizeColumns = false; - this.fpSpread1_Sheet1.DataSource = this.bs; - this.fpSpread1_Sheet1.FilterBar.DefaultStyle.BackColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.FilterBar.DefaultStyle.ForeColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.FilterBar.DefaultStyle.Parent = "FilterBarFlat"; - this.fpSpread1_Sheet1.FilterBarHeaderStyle.BackColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.FilterBarHeaderStyle.ForeColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.FilterBarHeaderStyle.Parent = "FilterBarHeaderFlat"; - this.fpSpread1_Sheet1.RowHeader.Columns.Default.Resizable = false; - this.fpSpread1_Sheet1.RowHeader.DefaultStyle.BackColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.RowHeader.DefaultStyle.ForeColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.RowHeader.DefaultStyle.Parent = "RowHeaderFlat"; - this.fpSpread1_Sheet1.SheetCornerStyle.BackColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.SheetCornerStyle.ForeColor = System.Drawing.Color.Empty; - this.fpSpread1_Sheet1.SheetCornerStyle.Parent = "CornerHeaderFlat"; - this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1; + this.chkZeroCount.CheckOnClick = true; + this.chkZeroCount.Image = global::FPJ0000.Properties.Resources.accept; + this.chkZeroCount.ImageTransparentColor = System.Drawing.Color.Magenta; + this.chkZeroCount.Name = "chkZeroCount"; + this.chkZeroCount.Size = new System.Drawing.Size(96, 22); + this.chkZeroCount.Text = "수량 \'0\' 포함"; + this.chkZeroCount.Click += new System.EventHandler(this.chkZeroCount_Click); // // fSPMaster // @@ -459,9 +473,9 @@ ((System.ComponentModel.ISupportInitialize)(this.dsMSSQL)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).EndInit(); this.cm1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).EndInit(); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -503,5 +517,6 @@ private System.Windows.Forms.ToolStripMenuItem loadToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exportListToolStripMenuItem; private FarPoint.Win.Spread.SheetView fpSpread1_Sheet1; + private System.Windows.Forms.ToolStripButton chkZeroCount; } } \ No newline at end of file diff --git a/SubProject/FPJ0000/Project/fSPMaster.cs b/SubProject/FPJ0000/Project/fSPMaster.cs index 85a6ca9..1c41d3b 100644 --- a/SubProject/FPJ0000/Project/fSPMaster.cs +++ b/SubProject/FPJ0000/Project/fSPMaster.cs @@ -164,5 +164,13 @@ namespace FPJ0000 { FPUtil.ColSizeLoad(ref this.fpSpread1, fn_fpcolsize); } + + private void chkZeroCount_Click(object sender, EventArgs e) + { + if (chkZeroCount.Checked) + this.bs.Filter = "CurrentQty > 0"; + else + this.bs.Filter = ""; + } } } diff --git a/SubProject/FPJ0000/Project/fSPMaster.resx b/SubProject/FPJ0000/Project/fSPMaster.resx index 7de9e51..3f8a27b 100644 --- a/SubProject/FPJ0000/Project/fSPMaster.resx +++ b/SubProject/FPJ0000/Project/fSPMaster.resx @@ -167,6 +167,9 @@ 8l/FYwIYQ4UGBWBgAAC+0b+zuQxOnAAAAABJRU5ErkJggg== + + 17, 17 + 186, 17 @@ -176,6 +179,9 @@ 387, 17 + + 462, 17 + R0lGODlhEAAQAIQfAJXG2JXa+ZLO5ChrlkCy4TZ1kiVvpCN0trvo9SN5xTd4lrfh7iR9zo3S+EGz7JDJ @@ -215,7 +221,4 @@ vmv/Akgg2IMBDgsSdJwcAEICDhoECjDAmQIFBQouXNiwQYPOgqgLBgQAOw== - - 462, 17 - \ No newline at end of file diff --git a/SubProject/FPJ0000/Properties/Settings.Designer.cs b/SubProject/FPJ0000/Properties/Settings.Designer.cs index 9d8de5a..66bf1ba 100644 --- a/SubProject/FPJ0000/Properties/Settings.Designer.cs +++ b/SubProject/FPJ0000/Properties/Settings.Designer.cs @@ -33,5 +33,16 @@ namespace FPJ0000.Properties { return ((string)(this["gwcs"])); } } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)] + [global::System.Configuration.DefaultSettingValueAttribute("Data Source=10.131.15.18;Initial Catalog=EE;Persist Security Info=True;User ID=ee" + + "user;Password=Amkor123!")] + public string EEEntities { + get { + return ((string)(this["EEEntities"])); + } + } } } diff --git a/SubProject/FPJ0000/Properties/Settings.settings b/SubProject/FPJ0000/Properties/Settings.settings index 0f03c1a..1f20ad0 100644 --- a/SubProject/FPJ0000/Properties/Settings.settings +++ b/SubProject/FPJ0000/Properties/Settings.settings @@ -7,6 +7,14 @@ <SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ConnectionString>Data Source=10.131.15.18;Initial Catalog=EE;Persist Security Info=True;User ID=eeuser;Password=Amkor123!</ConnectionString> <ProviderName>System.Data.SqlClient</ProviderName> +</SerializableConnectionString> + Data Source=10.131.15.18;Initial Catalog=EE;Persist Security Info=True;User ID=eeuser;Password=Amkor123! + + + <?xml version="1.0" encoding="utf-16"?> +<SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <ConnectionString>Data Source=10.131.15.18;Initial Catalog=EE;Persist Security Info=True;User ID=eeuser;Password=Amkor123!</ConnectionString> + <ProviderName>System.Data.SqlClient</ProviderName> </SerializableConnectionString> Data Source=10.131.15.18;Initial Catalog=EE;Persist Security Info=True;User ID=eeuser;Password=Amkor123! diff --git a/SubProject/FPJ0000/ReportForUser.xlsx b/SubProject/FPJ0000/ReportForUser.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..44d845f5e7f2a6af4555d3afe2202e2b3e59b07c GIT binary patch literal 20274 zcmeIabyQu;wmwLZ;0^(T1$TFMcL?t85IndBcXtRH+}+(FSa1mL65Qz>Ifrv|^IpI1 z@%y7kzq?_u*J7^uRn2eC@~R~(0RoBw^b!aH2nYxd$bbIa$^QiqQ0z+}AY>p2V08g& zD|1N+%= zn>h==-oKz@Q}3D}+(;ccTyag-L`cHy@@cKE9=M?<;nD`L3+Y9*6E*QI>vo<)1AC7h zdJ!Yu9ERgMlf^5)Op3<&Ru7WYDj=W4cbp#hmBwKO5|dnW6p{mMSSP*UNi#iMfn0Zl zDSq~Z0@DlU@ndZ`;>ekUB1xT2hn-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w0|&r}6A~#S2p8;PJ)yCO;f%nm zeCIk2bR20p62ITVR|U*<9q3-tx+ZcB<9xqmYsb=oqXka{8Gf+^Wast$Hk?)@kzg2c z3&PHitrJUkbReRy#gk*|$r;LdaBI8&-+m!JLjE868Q97l*z$zy3=y~g zhZV3VfdSW)>KL-z!}c&d3y_YWHFeRWTAdhw!m9l?7R$Q%k6-nV*luh`iRKOnhrU9G zqQ(u%VIiV;>7k;TWn|AB(!23`JG`|~Q-ZRc@)D|AyCl|UH;nT(RxqWN_JZXUn~UAW z!cLte>y5|emB(}rI9)5Hk7oB|bS);k%W-Xo#8aT`kdwylp`x7vK}?HEg%x#YGz9+& zBLImMTg4i#cfanSlk;%KpC6hkUoU(oy5Zi=1<0>v?$QprW#L4jrv z4lL(M#YAhjkaNl~+5!=m`xS+4{tS_w1#NjQTwRB}3HJHJ#pmKeEXe+SRZR-V%2DJzB&K&+k+~O9FH7ME0 zRA#aF?CJKxxz`AM2tPvnofbw~f2*6k-g;JENku!Ax>oZJK3tgEAFF zoh;Bq=ey;Co-mVNtDfCV&JDiQ8HFnui9r>$LBugj^^5H!`$(rV zU3>X?s^Mbi{l($r$X&+t?b_Bljj(U7C5z$8QrR>zw*}0{S>`VWIs@T z--+@&!0&5j&j9VTKLDOr(0*6_ea7-x)t%+1>hJTHza#uUSM-b^#Qr-6f1Ek`9q{+5 zmuEl`j{gSmc_QX_z~3h_o&m)<{~N&PX^npa{B2s`8BmJr2jFj$0)Lz&_@9F!1CA;I z;`;vv^v9U>e-1jw`#%BwF@*XZ^!Gmev-uhPKS2MbNB_I_zjh#>b%B6%1c8A5tvmU< m`oA{(|5V=={)hUnZh))=7@%hQzNHHph!YG5=&RWGyZ;NO>+%Bt literal 0 HcmV?d00001 diff --git a/SubProject/FPJ0000/UserGroup.cs b/SubProject/FPJ0000/UserGroup.cs new file mode 100644 index 0000000..611a290 --- /dev/null +++ b/SubProject/FPJ0000/UserGroup.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace FPJ0000 +{ + using System; + using System.Collections.Generic; + + public partial class UserGroup + { + public string dept { get; set; } + public string gcode { get; set; } + public string path_kj { get; set; } + public Nullable advpurchase { get; set; } + public Nullable permission { get; set; } + } +} diff --git a/SubProject/FPJ0000/Users.cs b/SubProject/FPJ0000/Users.cs new file mode 100644 index 0000000..b1b844e --- /dev/null +++ b/SubProject/FPJ0000/Users.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace FPJ0000 +{ + using System; + using System.Collections.Generic; + + public partial class Users + { + public string id { get; set; } + public string gcode { get; set; } + public string password { get; set; } + public string nameE { get; set; } + public string name { get; set; } + public string dept { get; set; } + public string grade { get; set; } + public string email { get; set; } + public Nullable level { get; set; } + public string indate { get; set; } + public string outdate { get; set; } + public string tel { get; set; } + public string hp { get; set; } + public string place { get; set; } + public string ads_employNo { get; set; } + public string ads_title { get; set; } + public string ads_created { get; set; } + public string memo { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + public string processs { get; set; } + } +} diff --git a/SubProject/FPJ0000/app.config b/SubProject/FPJ0000/app.config index 8b514fb..c9ec2b2 100644 --- a/SubProject/FPJ0000/app.config +++ b/SubProject/FPJ0000/app.config @@ -1,9 +1,29 @@ - + - - - - - - - + +

+ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SubProject/FPJ0000/packages.config b/SubProject/FPJ0000/packages.config index e894982..f425afa 100644 --- a/SubProject/FPJ0000/packages.config +++ b/SubProject/FPJ0000/packages.config @@ -1,5 +1,7 @@  + + diff --git a/SubProject/FPJ0000/vGroupUser.cs b/SubProject/FPJ0000/vGroupUser.cs new file mode 100644 index 0000000..9d186b5 --- /dev/null +++ b/SubProject/FPJ0000/vGroupUser.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace FPJ0000 +{ + using System; + using System.Collections.Generic; + + public partial class vGroupUser + { + public string gcode { get; set; } + public string dept { get; set; } + public Nullable level { get; set; } + public string name { get; set; } + public string nameE { get; set; } + public string grade { get; set; } + public string email { get; set; } + public string tel { get; set; } + public string indate { get; set; } + public string outdate { get; set; } + public string hp { get; set; } + public string place { get; set; } + public string ads_employNo { get; set; } + public string ads_title { get; set; } + public string ads_created { get; set; } + public string memo { get; set; } + public string processs { get; set; } + public string id { get; set; } + } +} diff --git a/SubProject/FPJ0000/vHoliday_uselist.cs b/SubProject/FPJ0000/vHoliday_uselist.cs new file mode 100644 index 0000000..7674910 --- /dev/null +++ b/SubProject/FPJ0000/vHoliday_uselist.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace FPJ0000 +{ + using System; + using System.Collections.Generic; + + public partial class vHoliday_uselist + { + public int idx { get; set; } + public string gcode { get; set; } + public string pdate { get; set; } + public Nullable term { get; set; } + public int termdr { get; set; } + public string description { get; set; } + public string uid { get; set; } + public string wuid { get; set; } + public System.DateTime wdate { get; set; } + } +} diff --git a/SubProject/FPJ0000/vJobReportForUser.cs b/SubProject/FPJ0000/vJobReportForUser.cs new file mode 100644 index 0000000..247e2ef --- /dev/null +++ b/SubProject/FPJ0000/vJobReportForUser.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace FPJ0000 +{ + using System; + using System.Collections.Generic; + + public partial class vJobReportForUser + { + public int idx { get; set; } + public string pdate { get; set; } + public string gcode { get; set; } + public string id { get; set; } + public string name { get; set; } + public string process { get; set; } + public string type { get; set; } + public string svalue { get; set; } + public Nullable hrs { get; set; } + public Nullable ot { get; set; } + public string userProcess { get; set; } + } +} diff --git a/SubProject/FPJ0000/vUserWorkTimeList.cs b/SubProject/FPJ0000/vUserWorkTimeList.cs new file mode 100644 index 0000000..7ac3c7b --- /dev/null +++ b/SubProject/FPJ0000/vUserWorkTimeList.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 이 코드는 템플릿에서 생성되었습니다. +// +// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다. +// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다. +// +//------------------------------------------------------------------------------ + +namespace FPJ0000 +{ + using System; + using System.Collections.Generic; + + public partial class vUserWorkTimeList + { + public string gcode { get; set; } + public string yymm { get; set; } + public Nullable total { get; set; } + public string uid { get; set; } + public string uname { get; set; } + public Nullable hrs { get; set; } + public Nullable ot { get; set; } + } +}