From 308b60bd84fae4650f172e0e583bcf19171eff2b Mon Sep 17 00:00:00 2001 From: Garritt McCune Date: Thu, 22 Jun 2017 17:02:01 -0500 Subject: [PATCH] Split the database objects out into a seperate project. Needs renaming in some areas and updates in the installer. Otherwise first version of a proper data DLL file. --- .../ActualSale.cs | 12 +- .../AdItem.cs | 13 +- .../AdSpecial.cs | 13 +- .../AdvertisingProfitControlData.csproj | 70 ++ .../AdvertisingProfitControlModel.cs | 43 +- AdvertisingProfitControlData/App.config | 13 + .../CostAnaylsi.cs | 10 +- .../Inventory.cs | 13 +- .../Invoice.cs | 14 +- AdvertisingProfitControlData/Note.cs | 17 + .../Projection.cs | 12 +- .../Properties/AssemblyInfo.cs | 36 + .../Supplier.cs | 13 +- .../Taxable.cs | 12 +- AdvertisingProfitControlData/Version.cs | 14 + .../WeekEndingDate.cs | 14 +- .../WeeklySales.cs | 10 +- AdvertisingProfitControlData/packages.config | 4 + AdvertsingProfitControl.sln | 12 +- ...tBox1.Designer.cs => AboutBox.Designer.cs} | 46 +- .../{AboutBox1.cs => AboutBox.cs} | 5 +- .../{AboutBox1.resx => AboutBox.resx} | 0 .../AdvertsingProfitControl.csproj | 41 +- AdvertsingProfitControl/BackPageGenerator.cs | 1 + .../DebugDatabaseConverter.Designer.cs | 133 --- .../DebugDatabaseConverter.cs | 799 ------------------ .../DebugDatabaseConverter.resx | 123 --- AdvertsingProfitControl/FrmLoginForm.cs | 3 +- AdvertsingProfitControl/FrmMain.cs | 7 +- AdvertsingProfitControl/FrmManageAdItems.cs | 1 + AdvertsingProfitControl/FrmManageSuppliers.cs | 6 +- .../FrmRegisterAdSpecial.cs | 1 + AdvertsingProfitControl/FrontPageGenerator.cs | 1 + AdvertsingProfitControl/NewModifyRecord.cs | 1 + AdvertsingProfitControl/Note.cs | 21 - AdvertsingProfitControl/Version.cs | 17 - 36 files changed, 296 insertions(+), 1255 deletions(-) rename {AdvertsingProfitControl => AdvertisingProfitControlData}/ActualSale.cs (75%) rename {AdvertsingProfitControl => AdvertisingProfitControlData}/AdItem.cs (81%) rename {AdvertsingProfitControl => AdvertisingProfitControlData}/AdSpecial.cs (81%) create mode 100644 AdvertisingProfitControlData/AdvertisingProfitControlData.csproj rename {AdvertsingProfitControl => AdvertisingProfitControlData}/AdvertisingProfitControlModel.cs (89%) create mode 100644 AdvertisingProfitControlData/App.config rename AdvertsingProfitControl/CostAnalysi.cs => AdvertisingProfitControlData/CostAnaylsi.cs (57%) rename {AdvertsingProfitControl => AdvertisingProfitControlData}/Inventory.cs (75%) rename {AdvertsingProfitControl => AdvertisingProfitControlData}/Invoice.cs (70%) create mode 100644 AdvertisingProfitControlData/Note.cs rename {AdvertsingProfitControl => AdvertisingProfitControlData}/Projection.cs (75%) create mode 100644 AdvertisingProfitControlData/Properties/AssemblyInfo.cs rename {AdvertsingProfitControl => AdvertisingProfitControlData}/Supplier.cs (69%) rename {AdvertsingProfitControl => AdvertisingProfitControlData}/Taxable.cs (67%) create mode 100644 AdvertisingProfitControlData/Version.cs rename {AdvertsingProfitControl => AdvertisingProfitControlData}/WeekEndingDate.cs (89%) rename AdvertsingProfitControl/WeeklySale.cs => AdvertisingProfitControlData/WeeklySales.cs (66%) create mode 100644 AdvertisingProfitControlData/packages.config rename AdvertsingProfitControl/{AboutBox1.Designer.cs => AboutBox.Designer.cs} (88%) rename AdvertsingProfitControl/{AboutBox1.cs => AboutBox.cs} (86%) rename AdvertsingProfitControl/{AboutBox1.resx => AboutBox.resx} (100%) delete mode 100644 AdvertsingProfitControl/DebugDatabaseConverter.Designer.cs delete mode 100644 AdvertsingProfitControl/DebugDatabaseConverter.cs delete mode 100644 AdvertsingProfitControl/DebugDatabaseConverter.resx delete mode 100644 AdvertsingProfitControl/Note.cs delete mode 100644 AdvertsingProfitControl/Version.cs diff --git a/AdvertsingProfitControl/ActualSale.cs b/AdvertisingProfitControlData/ActualSale.cs similarity index 75% rename from AdvertsingProfitControl/ActualSale.cs rename to AdvertisingProfitControlData/ActualSale.cs index 9d410f4..3eaa459 100644 --- a/AdvertsingProfitControl/ActualSale.cs +++ b/AdvertisingProfitControlData/ActualSale.cs @@ -1,12 +1,8 @@ -namespace AdvertsingProfitControl -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Data.Entity.Spatial; +using System.ComponentModel.DataAnnotations; - public partial class ActualSale +namespace AdvertisingProfitControlData +{ + public class ActualSale { public int Id { get; set; } diff --git a/AdvertsingProfitControl/AdItem.cs b/AdvertisingProfitControlData/AdItem.cs similarity index 81% rename from AdvertsingProfitControl/AdItem.cs rename to AdvertisingProfitControlData/AdItem.cs index 81cc6bf..279c2e7 100644 --- a/AdvertsingProfitControl/AdItem.cs +++ b/AdvertisingProfitControlData/AdItem.cs @@ -1,12 +1,9 @@ -namespace AdvertsingProfitControl -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Data.Entity.Spatial; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; - public partial class AdItem +namespace AdvertisingProfitControlData +{ + public class AdItem { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public AdItem() diff --git a/AdvertsingProfitControl/AdSpecial.cs b/AdvertisingProfitControlData/AdSpecial.cs similarity index 81% rename from AdvertsingProfitControl/AdSpecial.cs rename to AdvertisingProfitControlData/AdSpecial.cs index ca04ff2..ef74561 100644 --- a/AdvertsingProfitControl/AdSpecial.cs +++ b/AdvertisingProfitControlData/AdSpecial.cs @@ -1,12 +1,9 @@ -namespace AdvertsingProfitControl -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Data.Entity.Spatial; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; - public partial class AdSpecial +namespace AdvertisingProfitControlData +{ + public class AdSpecial { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public AdSpecial() diff --git a/AdvertisingProfitControlData/AdvertisingProfitControlData.csproj b/AdvertisingProfitControlData/AdvertisingProfitControlData.csproj new file mode 100644 index 0000000..f0570c2 --- /dev/null +++ b/AdvertisingProfitControlData/AdvertisingProfitControlData.csproj @@ -0,0 +1,70 @@ + + + + + Debug + AnyCPU + {E30F8B0E-DFF3-4AB7-8D0C-47BD11164E51} + Library + Properties + AdvertisingProfitControlData + AdvertisingProfitControlData + v4.5 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AdvertsingProfitControl/AdvertisingProfitControlModel.cs b/AdvertisingProfitControlData/AdvertisingProfitControlModel.cs similarity index 89% rename from AdvertsingProfitControl/AdvertisingProfitControlModel.cs rename to AdvertisingProfitControlData/AdvertisingProfitControlModel.cs index ff8c5ce..3f03699 100644 --- a/AdvertsingProfitControl/AdvertisingProfitControlModel.cs +++ b/AdvertisingProfitControlData/AdvertisingProfitControlModel.cs @@ -1,14 +1,43 @@ -using AdvertsingProfitControl.Properties; +using System; +using System.Data.Entity; -namespace AdvertsingProfitControl +namespace AdvertisingProfitControlData { - using System.Data.Entity; - - public partial class AdvertisingProfitControlModel : DbContext + public class AdvertisingProfitControlModel : DbContext { - public AdvertisingProfitControlModel() - : base(Settings.Default.ConnectionString) + private static string _connectionString = string.Empty; + + /// + /// Initializes and stores the supplied connection string. This allows calls to + /// an overloaded constructor to take no parameters. + /// + /// The connection string for the database. + public AdvertisingProfitControlModel(string connectionString) : base(connectionString) { + _connectionString = connectionString; + } + + /// + /// Creates the database context using a previously initialized connection string. + /// + public AdvertisingProfitControlModel() + : base(ValidateConnectionString()) + { + + } + + /// + /// Checks to make sure a connection string has been initialized. + /// + /// + private static string ValidateConnectionString() + { + if (_connectionString == string.Empty) + { + throw new OperationCanceledException("A connection string must be specified."); + } + + return _connectionString; } public virtual DbSet ActualSales { get; set; } diff --git a/AdvertisingProfitControlData/App.config b/AdvertisingProfitControlData/App.config new file mode 100644 index 0000000..b9c08ba --- /dev/null +++ b/AdvertisingProfitControlData/App.config @@ -0,0 +1,13 @@ + + + + +
+ + + + + + + + diff --git a/AdvertsingProfitControl/CostAnalysi.cs b/AdvertisingProfitControlData/CostAnaylsi.cs similarity index 57% rename from AdvertsingProfitControl/CostAnalysi.cs rename to AdvertisingProfitControlData/CostAnaylsi.cs index 1689734..ba65063 100644 --- a/AdvertsingProfitControl/CostAnalysi.cs +++ b/AdvertisingProfitControlData/CostAnaylsi.cs @@ -1,12 +1,6 @@ -namespace AdvertsingProfitControl +namespace AdvertisingProfitControlData { - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Data.Entity.Spatial; - - public partial class CostAnalysi + public class CostAnalysi { public int Id { get; set; } diff --git a/AdvertsingProfitControl/Inventory.cs b/AdvertisingProfitControlData/Inventory.cs similarity index 75% rename from AdvertsingProfitControl/Inventory.cs rename to AdvertisingProfitControlData/Inventory.cs index 42d1cc0..3ac7bec 100644 --- a/AdvertsingProfitControl/Inventory.cs +++ b/AdvertisingProfitControlData/Inventory.cs @@ -1,13 +1,10 @@ -namespace AdvertsingProfitControl -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Data.Entity.Spatial; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace AdvertisingProfitControlData +{ [Table("Inventory")] - public partial class Inventory + public class Inventory { public int Id { get; set; } diff --git a/AdvertsingProfitControl/Invoice.cs b/AdvertisingProfitControlData/Invoice.cs similarity index 70% rename from AdvertsingProfitControl/Invoice.cs rename to AdvertisingProfitControlData/Invoice.cs index 00c6d6a..73a1226 100644 --- a/AdvertsingProfitControl/Invoice.cs +++ b/AdvertisingProfitControlData/Invoice.cs @@ -1,12 +1,10 @@ -namespace AdvertsingProfitControl -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Data.Entity.Spatial; +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; - public partial class Invoice +namespace AdvertisingProfitControlData +{ + public class Invoice { public int Id { get; set; } diff --git a/AdvertisingProfitControlData/Note.cs b/AdvertisingProfitControlData/Note.cs new file mode 100644 index 0000000..ce8fbd7 --- /dev/null +++ b/AdvertisingProfitControlData/Note.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations; + +namespace AdvertisingProfitControlData +{ + public class Note + { + public int Id { get; set; } + + [Required] + [StringLength(256)] + public string Remark { get; set; } + + public int FkDateId { get; set; } + + public virtual WeekEndingDate WeekEndingDate { get; set; } + } +} diff --git a/AdvertsingProfitControl/Projection.cs b/AdvertisingProfitControlData/Projection.cs similarity index 75% rename from AdvertsingProfitControl/Projection.cs rename to AdvertisingProfitControlData/Projection.cs index 96a5a11..fb1e104 100644 --- a/AdvertsingProfitControl/Projection.cs +++ b/AdvertisingProfitControlData/Projection.cs @@ -1,12 +1,8 @@ -namespace AdvertsingProfitControl -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Data.Entity.Spatial; +using System.ComponentModel.DataAnnotations; - public partial class Projection +namespace AdvertisingProfitControlData +{ + public class Projection { public int Id { get; set; } diff --git a/AdvertisingProfitControlData/Properties/AssemblyInfo.cs b/AdvertisingProfitControlData/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f2ca177 --- /dev/null +++ b/AdvertisingProfitControlData/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("AdvertisingProfitControlData")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("AdvertisingProfitControlData")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("e30f8b0e-dff3-4ab7-8d0c-47bd11164e51")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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")] diff --git a/AdvertsingProfitControl/Supplier.cs b/AdvertisingProfitControlData/Supplier.cs similarity index 69% rename from AdvertsingProfitControl/Supplier.cs rename to AdvertisingProfitControlData/Supplier.cs index 93ebdf0..8b24224 100644 --- a/AdvertsingProfitControl/Supplier.cs +++ b/AdvertisingProfitControlData/Supplier.cs @@ -1,12 +1,9 @@ -namespace AdvertsingProfitControl -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Data.Entity.Spatial; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; - public partial class Supplier +namespace AdvertisingProfitControlData +{ + public class Supplier { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public Supplier() diff --git a/AdvertsingProfitControl/Taxable.cs b/AdvertisingProfitControlData/Taxable.cs similarity index 67% rename from AdvertsingProfitControl/Taxable.cs rename to AdvertisingProfitControlData/Taxable.cs index 725a826..81262a6 100644 --- a/AdvertsingProfitControl/Taxable.cs +++ b/AdvertisingProfitControlData/Taxable.cs @@ -1,13 +1,9 @@ -namespace AdvertsingProfitControl -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Data.Entity.Spatial; +using System.ComponentModel.DataAnnotations.Schema; +namespace AdvertisingProfitControlData +{ [Table("Taxable")] - public partial class Taxable + public class Taxable { public int Id { get; set; } diff --git a/AdvertisingProfitControlData/Version.cs b/AdvertisingProfitControlData/Version.cs new file mode 100644 index 0000000..c0d51cb --- /dev/null +++ b/AdvertisingProfitControlData/Version.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AdvertisingProfitControlData +{ + [Table("Version")] + public class Version + { + public int Id { get; set; } + + [StringLength(32)] + public string VersionNumber { get; set; } + } +} diff --git a/AdvertsingProfitControl/WeekEndingDate.cs b/AdvertisingProfitControlData/WeekEndingDate.cs similarity index 89% rename from AdvertsingProfitControl/WeekEndingDate.cs rename to AdvertisingProfitControlData/WeekEndingDate.cs index 5e2b4e6..4a3f84f 100644 --- a/AdvertsingProfitControl/WeekEndingDate.cs +++ b/AdvertisingProfitControlData/WeekEndingDate.cs @@ -1,12 +1,10 @@ -namespace AdvertsingProfitControl -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Data.Entity.Spatial; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; - public partial class WeekEndingDate +namespace AdvertisingProfitControlData +{ + public class WeekEndingDate { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public WeekEndingDate() diff --git a/AdvertsingProfitControl/WeeklySale.cs b/AdvertisingProfitControlData/WeeklySales.cs similarity index 66% rename from AdvertsingProfitControl/WeeklySale.cs rename to AdvertisingProfitControlData/WeeklySales.cs index 03b4c96..cf054b1 100644 --- a/AdvertsingProfitControl/WeeklySale.cs +++ b/AdvertisingProfitControlData/WeeklySales.cs @@ -1,12 +1,6 @@ -namespace AdvertsingProfitControl +namespace AdvertisingProfitControlData { - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Data.Entity.Spatial; - - public partial class WeeklySale + public class WeeklySale { public int Id { get; set; } diff --git a/AdvertisingProfitControlData/packages.config b/AdvertisingProfitControlData/packages.config new file mode 100644 index 0000000..4409173 --- /dev/null +++ b/AdvertisingProfitControlData/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/AdvertsingProfitControl.sln b/AdvertsingProfitControl.sln index caa69e2..58e82ca 100644 --- a/AdvertsingProfitControl.sln +++ b/AdvertsingProfitControl.sln @@ -1,12 +1,14 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26403.3 +VisualStudioVersion = 15.0.26228.4 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdvertsingProfitControl", "AdvertsingProfitControl\AdvertsingProfitControl.csproj", "{4A45C665-5D02-4724-9CC5-C0C50CA44760}" EndProject Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SetupProject", "SetupProject\SetupProject.wixproj", "{EB640D80-1A1E-4835-90B3-83A688419321}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdvertisingProfitControlData", "AdvertisingProfitControlData\AdvertisingProfitControlData.csproj", "{E30F8B0E-DFF3-4AB7-8D0C-47BD11164E51}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -29,6 +31,14 @@ Global {EB640D80-1A1E-4835-90B3-83A688419321}.Release|Any CPU.ActiveCfg = Release|x86 {EB640D80-1A1E-4835-90B3-83A688419321}.Release|x86.ActiveCfg = Release|x86 {EB640D80-1A1E-4835-90B3-83A688419321}.Release|x86.Build.0 = Release|x86 + {E30F8B0E-DFF3-4AB7-8D0C-47BD11164E51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E30F8B0E-DFF3-4AB7-8D0C-47BD11164E51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E30F8B0E-DFF3-4AB7-8D0C-47BD11164E51}.Debug|x86.ActiveCfg = Debug|Any CPU + {E30F8B0E-DFF3-4AB7-8D0C-47BD11164E51}.Debug|x86.Build.0 = Debug|Any CPU + {E30F8B0E-DFF3-4AB7-8D0C-47BD11164E51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E30F8B0E-DFF3-4AB7-8D0C-47BD11164E51}.Release|Any CPU.Build.0 = Release|Any CPU + {E30F8B0E-DFF3-4AB7-8D0C-47BD11164E51}.Release|x86.ActiveCfg = Release|Any CPU + {E30F8B0E-DFF3-4AB7-8D0C-47BD11164E51}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/AdvertsingProfitControl/AboutBox1.Designer.cs b/AdvertsingProfitControl/AboutBox.Designer.cs similarity index 88% rename from AdvertsingProfitControl/AboutBox1.Designer.cs rename to AdvertsingProfitControl/AboutBox.Designer.cs index 545e2ea..2fd1cb4 100644 --- a/AdvertsingProfitControl/AboutBox1.Designer.cs +++ b/AdvertsingProfitControl/AboutBox.Designer.cs @@ -1,6 +1,6 @@ namespace AdvertsingProfitControl { - partial class AboutBox1 + partial class AboutBox { /// /// Required designer variable. @@ -39,10 +39,9 @@ // this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.okButton.Location = new System.Drawing.Point(620, 442); - this.okButton.Margin = new System.Windows.Forms.Padding(6); + this.okButton.Location = new System.Drawing.Point(339, 240); this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(138, 40); + this.okButton.Size = new System.Drawing.Size(75, 22); this.okButton.TabIndex = 24; this.okButton.Text = "&OK"; // @@ -50,11 +49,11 @@ // this.databaseVersionLabel.BackColor = System.Drawing.Color.Transparent; this.databaseVersionLabel.Dock = System.Windows.Forms.DockStyle.Fill; - this.databaseVersionLabel.Location = new System.Drawing.Point(11, 48); - this.databaseVersionLabel.Margin = new System.Windows.Forms.Padding(11, 0, 6, 0); - this.databaseVersionLabel.MaximumSize = new System.Drawing.Size(0, 31); + this.databaseVersionLabel.Location = new System.Drawing.Point(6, 26); + this.databaseVersionLabel.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); + this.databaseVersionLabel.MaximumSize = new System.Drawing.Size(0, 17); this.databaseVersionLabel.Name = "databaseVersionLabel"; - this.databaseVersionLabel.Size = new System.Drawing.Size(747, 31); + this.databaseVersionLabel.Size = new System.Drawing.Size(408, 17); this.databaseVersionLabel.TabIndex = 0; this.databaseVersionLabel.Text = "Database Version:"; this.databaseVersionLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -63,11 +62,11 @@ // this.labelProductVerion.BackColor = System.Drawing.Color.Transparent; this.labelProductVerion.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelProductVerion.Location = new System.Drawing.Point(11, 0); - this.labelProductVerion.Margin = new System.Windows.Forms.Padding(11, 0, 6, 0); - this.labelProductVerion.MaximumSize = new System.Drawing.Size(0, 31); + this.labelProductVerion.Location = new System.Drawing.Point(6, 0); + this.labelProductVerion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); + this.labelProductVerion.MaximumSize = new System.Drawing.Size(0, 17); this.labelProductVerion.Name = "labelProductVerion"; - this.labelProductVerion.Size = new System.Drawing.Size(747, 31); + this.labelProductVerion.Size = new System.Drawing.Size(408, 17); this.labelProductVerion.TabIndex = 19; this.labelProductVerion.Text = "Advertising Prodift Control Version:"; this.labelProductVerion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -82,8 +81,7 @@ this.tableLayoutPanel.Controls.Add(this.okButton, 0, 6); this.tableLayoutPanel.Controls.Add(this.reportGeneratingVersionLabel, 0, 5); this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel.Location = new System.Drawing.Point(17, 17); - this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(6); + this.tableLayoutPanel.Location = new System.Drawing.Point(9, 9); this.tableLayoutPanel.Name = "tableLayoutPanel"; this.tableLayoutPanel.RowCount = 7; this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); @@ -93,35 +91,35 @@ this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40F)); this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel.Size = new System.Drawing.Size(764, 488); + this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 11F)); + this.tableLayoutPanel.Size = new System.Drawing.Size(417, 265); this.tableLayoutPanel.TabIndex = 0; // // reportGeneratingVersionLabel // this.reportGeneratingVersionLabel.AutoSize = true; - this.reportGeneratingVersionLabel.Location = new System.Drawing.Point(3, 387); + this.reportGeneratingVersionLabel.Location = new System.Drawing.Point(2, 210); + this.reportGeneratingVersionLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.reportGeneratingVersionLabel.Name = "reportGeneratingVersionLabel"; - this.reportGeneratingVersionLabel.Size = new System.Drawing.Size(314, 25); + this.reportGeneratingVersionLabel.Size = new System.Drawing.Size(171, 13); this.reportGeneratingVersionLabel.TabIndex = 25; this.reportGeneratingVersionLabel.Text = "Report Generating Engine Version:"; // - // AboutBox1 + // AboutBox // this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackgroundImage = global::AdvertsingProfitControl.Properties.Resources.Large_Allens_Icon_Template___Copy; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.ClientSize = new System.Drawing.Size(798, 522); + this.ClientSize = new System.Drawing.Size(435, 283); this.Controls.Add(this.tableLayoutPanel); this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Margin = new System.Windows.Forms.Padding(6); this.MaximizeBox = false; this.MinimizeBox = false; - this.Name = "AboutBox1"; - this.Padding = new System.Windows.Forms.Padding(17); + this.Name = "AboutBox"; + this.Padding = new System.Windows.Forms.Padding(9, 9, 9, 9); this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; diff --git a/AdvertsingProfitControl/AboutBox1.cs b/AdvertsingProfitControl/AboutBox.cs similarity index 86% rename from AdvertsingProfitControl/AboutBox1.cs rename to AdvertsingProfitControl/AboutBox.cs index 53c99ff..7509e69 100644 --- a/AdvertsingProfitControl/AboutBox1.cs +++ b/AdvertsingProfitControl/AboutBox.cs @@ -1,12 +1,13 @@ using System.Linq; using System.Reflection; using System.Windows.Forms; +using AdvertisingProfitControlData; namespace AdvertsingProfitControl { - internal partial class AboutBox1 : Form + internal partial class AboutBox : Form { - public AboutBox1() + public AboutBox() { InitializeComponent(); labelProductVerion.Text = $@"Advertising Profit Control Version: {Assembly.GetEntryAssembly().GetName().Version}"; diff --git a/AdvertsingProfitControl/AboutBox1.resx b/AdvertsingProfitControl/AboutBox.resx similarity index 100% rename from AdvertsingProfitControl/AboutBox1.resx rename to AdvertsingProfitControl/AboutBox.resx diff --git a/AdvertsingProfitControl/AdvertsingProfitControl.csproj b/AdvertsingProfitControl/AdvertsingProfitControl.csproj index 33e3e28..bb6176d 100644 --- a/AdvertsingProfitControl/AdvertsingProfitControl.csproj +++ b/AdvertsingProfitControl/AdvertsingProfitControl.csproj @@ -109,7 +109,6 @@ - @@ -120,25 +119,14 @@ - + Form - - AboutBox1.cs + + AboutBox.cs - - - - - - - Form - - - DebugDatabaseConverter.cs - Form @@ -182,24 +170,18 @@ FrmReportSettings.cs - - Form NewModifyRecord.cs - - True True Resources.resx - - @@ -225,14 +207,8 @@ - - - - - AboutBox1.cs - - - DebugDatabaseConverter.cs + + AboutBox.cs FrmAddRecord.cs @@ -326,7 +302,12 @@ Always - + + + {e30f8b0e-dff3-4ab7-8d0c-47bd11164e51} + AdvertisingProfitControlData + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - 17, 17 - - \ No newline at end of file diff --git a/AdvertsingProfitControl/FrmLoginForm.cs b/AdvertsingProfitControl/FrmLoginForm.cs index 0490f7d..b76f0a3 100644 --- a/AdvertsingProfitControl/FrmLoginForm.cs +++ b/AdvertsingProfitControl/FrmLoginForm.cs @@ -1,6 +1,7 @@ using System; using System.Data.SqlClient; using System.Windows.Forms; +using AdvertisingProfitControlData; using Microsoft.Win32; namespace AdvertsingProfitControl @@ -56,7 +57,7 @@ namespace AdvertsingProfitControl } ConnectionSuccessful = true; //Try to initialize the database. - var db = new AdvertisingProfitControlModel(); + var db = new AdvertisingProfitControlModel(connectionString); //Force the UI thread to draw the label's text so the user can see it. informationLabel.Text = @"Connection successful! Preparing main form..."; informationLabel.Invalidate(); diff --git a/AdvertsingProfitControl/FrmMain.cs b/AdvertsingProfitControl/FrmMain.cs index 0aaa4ee..4f894b6 100644 --- a/AdvertsingProfitControl/FrmMain.cs +++ b/AdvertsingProfitControl/FrmMain.cs @@ -5,6 +5,7 @@ using System.Drawing.Printing; using System.Linq; using System.Transactions; using System.Windows.Forms; +using AdvertisingProfitControlData; namespace AdvertsingProfitControl { @@ -268,7 +269,7 @@ namespace AdvertsingProfitControl private void DisplayProductVersionNumbers(object sender, EventArgs e) { - var form = new AboutBox1(); + var form = new AboutBox(); form.ShowDialog(); } @@ -900,9 +901,7 @@ namespace AdvertsingProfitControl private void DisplayDebugTool(object sender, EventArgs e) { - var form = new DebugDatabaseConverter(); - form.ShowDialog(); - RefreshDateListing(); + } /// diff --git a/AdvertsingProfitControl/FrmManageAdItems.cs b/AdvertsingProfitControl/FrmManageAdItems.cs index 2b5e093..9d1e31e 100644 --- a/AdvertsingProfitControl/FrmManageAdItems.cs +++ b/AdvertsingProfitControl/FrmManageAdItems.cs @@ -3,6 +3,7 @@ using System.Data.Entity.Infrastructure; using System.Linq; using System.Transactions; using System.Windows.Forms; +using AdvertisingProfitControlData; namespace AdvertsingProfitControl { diff --git a/AdvertsingProfitControl/FrmManageSuppliers.cs b/AdvertsingProfitControl/FrmManageSuppliers.cs index a7d2cbd..5e17eea 100644 --- a/AdvertsingProfitControl/FrmManageSuppliers.cs +++ b/AdvertsingProfitControl/FrmManageSuppliers.cs @@ -1,13 +1,9 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; using System.Data.Entity.Infrastructure; -using System.Drawing; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Transactions; using System.Windows.Forms; +using AdvertisingProfitControlData; namespace AdvertsingProfitControl { diff --git a/AdvertsingProfitControl/FrmRegisterAdSpecial.cs b/AdvertsingProfitControl/FrmRegisterAdSpecial.cs index 7b1a49d..ea53b55 100644 --- a/AdvertsingProfitControl/FrmRegisterAdSpecial.cs +++ b/AdvertsingProfitControl/FrmRegisterAdSpecial.cs @@ -3,6 +3,7 @@ using System.Data.Entity.Infrastructure; using System.Linq; using System.Transactions; using System.Windows.Forms; +using AdvertisingProfitControlData; namespace AdvertsingProfitControl { diff --git a/AdvertsingProfitControl/FrontPageGenerator.cs b/AdvertsingProfitControl/FrontPageGenerator.cs index a395a35..1372881 100644 --- a/AdvertsingProfitControl/FrontPageGenerator.cs +++ b/AdvertsingProfitControl/FrontPageGenerator.cs @@ -5,6 +5,7 @@ using System.IO; using System.Web.UI; using System.Linq; using Pechkin; +using AdvertisingProfitControlData; namespace AdvertsingProfitControl { diff --git a/AdvertsingProfitControl/NewModifyRecord.cs b/AdvertsingProfitControl/NewModifyRecord.cs index f5ccacd..7ad4d92 100644 --- a/AdvertsingProfitControl/NewModifyRecord.cs +++ b/AdvertsingProfitControl/NewModifyRecord.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Text.RegularExpressions; using System.Transactions; using System.Windows.Forms; +using AdvertisingProfitControlData; namespace AdvertsingProfitControl { diff --git a/AdvertsingProfitControl/Note.cs b/AdvertsingProfitControl/Note.cs deleted file mode 100644 index 08a2646..0000000 --- a/AdvertsingProfitControl/Note.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace AdvertsingProfitControl -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Data.Entity.Spatial; - - public partial class Note - { - public int Id { get; set; } - - [Required] - [StringLength(256)] - public string Remark { get; set; } - - public int FkDateId { get; set; } - - public virtual WeekEndingDate WeekEndingDate { get; set; } - } -} diff --git a/AdvertsingProfitControl/Version.cs b/AdvertsingProfitControl/Version.cs deleted file mode 100644 index d7a8647..0000000 --- a/AdvertsingProfitControl/Version.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace AdvertsingProfitControl -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Data.Entity.Spatial; - - [Table("Version")] - public partial class Version - { - public int Id { get; set; } - - [StringLength(32)] - public string VersionNumber { get; set; } - } -}