Skip to content

Commit

Permalink
upgraded to .NetFx4.5 and VS2016
Browse files Browse the repository at this point in the history
implemented string interpolation to reduce code
  • Loading branch information
mijaved committed Oct 3, 2016
1 parent 982c545 commit d94856e
Show file tree
Hide file tree
Showing 10 changed files with 593 additions and 523 deletions.
6 changes: 4 additions & 2 deletions CodeGenerator.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeGenerator.MVP", "CodeGenerator\CodeGenerator.MVP.csproj", "{A7D135B5-3D2D-4E1D-80F7-CF37CC367A6F}"
EndProject
Global
Expand Down
21 changes: 11 additions & 10 deletions CodeGenerator/App.config
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="ConString" value="SqlServer"/>
<add key="ProjectName" value="STS"/>
<add key="ProjectName" value="Test"/>

<!-- For Oracle Database -->
<add key="ConString_Oracle" value="Provider=OraOLEDB.Oracle;Data Source=tvl;User ID=wims_p4;Password=wims_p4;" />
<add key="ConString_Oracle" value="Provider=OraOLEDB.Oracle;Data Source=tvl;User ID=wims_p4;Password=wims_p4;"/>
<add key="PkColName" value="NUMID"/>
<add key="RecordCreatorColName" value="STRUID"/>
<add key="RecordModifierColName" value="STRLASTUID"/>
<add key="RecordCreateDateColName" value="DTUDT"/>
<add key="RecordModifiedDateColName" value="DTLASTUDT"/>

<!--For Sql Server Database-->
<add key="ConString_SqlServer" value="Provider=sqloledb;Data Source=PC69;Initial Catalog=STS;User Id=sa;Password=sa1234;" />
<add key="PkColName" value="intPK"/>
<!--<add key="ConString_SqlServer" value="Provider=sqloledb;Data Source=<ServerName>;Initial Catalog=<DBName>;User Id=<UserId>;Password=<Password>;"/>-->
<add key="ConString_SqlServer" value="Provider=sqloledb;Data Source=(LocalDB)\MSSQLLocalDB;Initial Catalog=Test;Integrated Security=SSPI;"/>
<add key="PkColName" value="intPK"/>
<add key="RecordCreatorColName" value="IUser"/>
<add key="RecordModifierColName" value="EUser"/>
<add key="RecordCreateDateColName" value="IDate"/>
<add key="RecordModifiedDateColName" value="EDate"/>

<add key="SaveDirectoty" value="D:\\CodeGeneratorFiles\\" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="SaveDirectoty" value="D:\\CodeGeneratorFiles\\"/>
<add key="ClientSettingsProvider.ServiceUri" value=""/>
</appSettings>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri=""/>
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400"/>
</providers>
</roleManager>
</system.web>
</configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
21 changes: 16 additions & 5 deletions CodeGenerator/CodeGenerator.MVP.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CodeGenerator.MVP</RootNamespace>
<AssemblyName>CodeGenerator.MVP</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
Expand All @@ -32,6 +32,12 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
<PublishUrl>http://localhost/CodeGenerator/</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
Expand All @@ -56,6 +62,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -64,6 +71,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand All @@ -74,6 +82,7 @@
<Reference Include="System.Web.Extensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
Expand Down Expand Up @@ -132,7 +141,9 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="App.config" />
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down Expand Up @@ -174,12 +185,12 @@
<ItemGroup>
<PublishFile Include="SPCreator.exe.manifest">
<Visible>False</Visible>
<PublishState>Auto</PublishState>
<IncludeHash>False</IncludeHash>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Auto</PublishState>
<IncludeHash>False</IncludeHash>
<FileType>ManifestEntryPoint</FileType>
</PublishFile>
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions CodeGenerator/DAL/SPCreatorDAL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ public static DataTable GetColumnsDesc(string strTableName)

if (Util.Utility.GetSelectedDB().Equals("Oracle"))
{
cmd = new OleDbCommand("SELECT t.COLUMN_NAME, t.DATA_TYPE, t.CHAR_LENGTH AS MAX_LENGTH, NVL(t.DATA_PRECISION, 0) AS PRECISION, NVL(t.DATA_SCALE, 0) AS SCALE from user_tab_columns t where t.TABLE_NAME = '" + strTableName + "'", con);
cmd = new OleDbCommand($"SELECT t.COLUMN_NAME, t.DATA_TYPE, t.CHAR_LENGTH AS MAX_LENGTH, NVL(t.DATA_PRECISION, 0) AS PRECISION, NVL(t.DATA_SCALE, 0) AS SCALE from user_tab_columns t where t.TABLE_NAME = '{strTableName}'", con);
}
else if (Util.Utility.GetSelectedDB().Equals("SqlServer"))
{
cmd = new OleDbCommand("SELECT cl.name AS COLUMN_NAME, tp.name AS DATA_TYPE, cl.Max_Length AS MAX_LENGTH, cl.Precision AS PRECISION, cl.Scale AS SCALE FROM sys.columns cl JOIN sys.systypes tp ON tp.xtype = cl.system_type_id WHERE object_id = OBJECT_ID('dbo." + strTableName + "') AND tp.status = 0 Order by cl.Column_ID", con);
cmd = new OleDbCommand($"SELECT cl.name AS COLUMN_NAME, tp.name AS DATA_TYPE, cl.Max_Length AS MAX_LENGTH, cl.Precision AS PRECISION, cl.Scale AS SCALE FROM sys.columns cl JOIN sys.systypes tp ON tp.xtype = cl.system_type_id WHERE object_id = OBJECT_ID('dbo.{strTableName}') AND tp.status = 0 Order by cl.Column_ID", con);
}

OleDbDataReader dr = null;
Expand Down
10 changes: 5 additions & 5 deletions CodeGenerator/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CodeGenerator.MVP")]
[assembly: AssemblyDescription("Created by Md.Ismail")]
[assembly: AssemblyDescription("Utility to generate backend code like Stored Procedure, Entity, Data Acceess Layer (DAL), Business Logic Layer (BLL) for CRUD operation on tables of both Oracle and Sql Server")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("TVL")]
[assembly: AssemblyProduct("CodeGenerator.MVP")]
[assembly: AssemblyCopyright("Copyright © TVL 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCopyright("Copyright © mijaved 2016")]
[assembly: AssemblyTrademark("Created by Md.Ismail")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
Expand Down Expand Up @@ -51,7 +51,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]

//IntallationPath: C:\Users\<CurrentUser>\AppData\Local\Apps\2.0\77QRC1HQ.A3N\NEBBNPEV.D98
4 changes: 2 additions & 2 deletions CodeGenerator/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions CodeGenerator/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d94856e

Please sign in to comment.