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.

This commit is contained in:
2017-06-22 17:02:01 -05:00
parent fc472928cc
commit 308b60bd84
36 changed files with 296 additions and 1255 deletions
@@ -1,6 +1,6 @@
namespace AdvertsingProfitControl
{
partial class AboutBox1
partial class AboutBox
{
/// <summary>
/// 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;
@@ -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}";
-43
View File
@@ -1,43 +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 ActualSale
{
public int Id { get; set; }
[StringLength(128)]
public string Sold { get; set; }
[StringLength(128)]
public string SalePrice { get; set; }
public decimal? TotalSales { get; set; }
public decimal? Cost { get; set; }
public decimal? ProfitReturn { get; set; }
public decimal? TotalProfitReturn { get; set; }
public int RowPosition { get; set; }
public int RowAttribute { get; set; }
public int FkAdItemId { get; set; }
public int? FkAdSpecialId { get; set; }
public int FkDateId { get; set; }
public virtual AdItem AdItem { get; set; }
public virtual AdSpecial AdSpecial { get; set; }
public virtual WeekEndingDate WeekEndingDate { get; set; }
}
}
-37
View File
@@ -1,37 +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 AdItem
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public AdItem()
{
ActualSales = new HashSet<ActualSale>();
Inventories = new HashSet<Inventory>();
Projections = new HashSet<Projection>();
}
public int Id { get; set; }
[Required]
[StringLength(256)]
public string Name { get; set; }
[StringLength(256)]
public string Description { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<ActualSale> ActualSales { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Inventory> Inventories { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Projection> Projections { get; set; }
}
}
-37
View File
@@ -1,37 +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 AdSpecial
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public AdSpecial()
{
ActualSales = new HashSet<ActualSale>();
Inventories = new HashSet<Inventory>();
Projections = new HashSet<Projection>();
}
public int Id { get; set; }
[Required]
[StringLength(256)]
public string Name { get; set; }
[StringLength(256)]
public string Description { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<ActualSale> ActualSales { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Inventory> Inventories { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Projection> Projections { get; set; }
}
}
@@ -1,310 +0,0 @@
using AdvertsingProfitControl.Properties;
namespace AdvertsingProfitControl
{
using System.Data.Entity;
public partial class AdvertisingProfitControlModel : DbContext
{
public AdvertisingProfitControlModel()
: base(Settings.Default.ConnectionString)
{
}
public virtual DbSet<ActualSale> ActualSales { get; set; }
public virtual DbSet<AdItem> AdItems { get; set; }
public virtual DbSet<AdSpecial> AdSpecials { get; set; }
public virtual DbSet<CostAnalysi> CostAnalysis { get; set; }
public virtual DbSet<Inventory> Inventories { get; set; }
public virtual DbSet<Invoice> Invoices { get; set; }
public virtual DbSet<Note> Notes { get; set; }
public virtual DbSet<Projection> Projections { get; set; }
public virtual DbSet<Supplier> Suppliers { get; set; }
public virtual DbSet<Taxable> Taxables { get; set; }
public virtual DbSet<Version> Versions { get; set; }
public virtual DbSet<WeekEndingDate> WeekEndingDates { get; set; }
public virtual DbSet<WeeklySale> WeeklySales { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<ActualSale>()
.Property(e => e.Sold)
.IsUnicode(false);
modelBuilder.Entity<ActualSale>()
.Property(e => e.SalePrice)
.IsUnicode(false);
modelBuilder.Entity<ActualSale>()
.Property(e => e.TotalSales)
.HasPrecision(19, 2);
modelBuilder.Entity<ActualSale>()
.Property(e => e.Cost)
.HasPrecision(19, 2);
modelBuilder.Entity<ActualSale>()
.Property(e => e.ProfitReturn)
.HasPrecision(19, 2);
modelBuilder.Entity<ActualSale>()
.Property(e => e.TotalProfitReturn)
.HasPrecision(19, 2);
modelBuilder.Entity<AdItem>()
.Property(e => e.Name)
.IsUnicode(false);
modelBuilder.Entity<AdItem>()
.Property(e => e.Description)
.IsUnicode(false);
modelBuilder.Entity<AdItem>()
.HasMany(e => e.ActualSales)
.WithRequired(e => e.AdItem)
.HasForeignKey(e => e.FkAdItemId)
.WillCascadeOnDelete(false);
modelBuilder.Entity<AdItem>()
.HasMany(e => e.Inventories)
.WithRequired(e => e.AdItem)
.HasForeignKey(e => e.FkAdItemId)
.WillCascadeOnDelete(false);
modelBuilder.Entity<AdItem>()
.HasMany(e => e.Projections)
.WithRequired(e => e.AdItem)
.HasForeignKey(e => e.FkAdItemId)
.WillCascadeOnDelete(false);
modelBuilder.Entity<AdSpecial>()
.Property(e => e.Name)
.IsUnicode(false);
modelBuilder.Entity<AdSpecial>()
.Property(e => e.Description)
.IsUnicode(false);
modelBuilder.Entity<AdSpecial>()
.HasMany(e => e.ActualSales)
.WithOptional(e => e.AdSpecial)
.HasForeignKey(e => e.FkAdSpecialId);
modelBuilder.Entity<AdSpecial>()
.HasMany(e => e.Inventories)
.WithOptional(e => e.AdSpecial)
.HasForeignKey(e => e.FkAdSpecialId);
modelBuilder.Entity<AdSpecial>()
.HasMany(e => e.Projections)
.WithOptional(e => e.AdSpecial)
.HasForeignKey(e => e.FkAdSpecialId);
modelBuilder.Entity<CostAnalysi>()
.Property(e => e.SalesPerManHour)
.HasPrecision(19, 2);
modelBuilder.Entity<CostAnalysi>()
.Property(e => e.SalaryPercentage)
.HasPrecision(19, 2);
modelBuilder.Entity<CostAnalysi>()
.Property(e => e.SalaryDollar)
.HasPrecision(19, 2);
modelBuilder.Entity<CostAnalysi>()
.Property(e => e.Supplies)
.HasPrecision(19, 2);
modelBuilder.Entity<Inventory>()
.Property(e => e.BeginningInventory)
.IsUnicode(false);
modelBuilder.Entity<Inventory>()
.Property(e => e.Recieved)
.IsUnicode(false);
modelBuilder.Entity<Inventory>()
.Property(e => e.TotalInventory)
.IsUnicode(false);
modelBuilder.Entity<Inventory>()
.Property(e => e.EndingInventory)
.IsUnicode(false);
modelBuilder.Entity<Invoice>()
.Property(e => e.InvoiceNumber)
.IsUnicode(false);
modelBuilder.Entity<Invoice>()
.Property(e => e.InvoiceNetAmountAtCost)
.HasPrecision(19, 2);
modelBuilder.Entity<Invoice>()
.Property(e => e.InvoiceNetAmount)
.HasPrecision(19, 2);
modelBuilder.Entity<Invoice>()
.Property(e => e.InvoiceNote)
.IsUnicode(false);
modelBuilder.Entity<Note>()
.Property(e => e.Remark)
.IsUnicode(false);
modelBuilder.Entity<Projection>()
.Property(e => e.Sold)
.IsUnicode(false);
modelBuilder.Entity<Projection>()
.Property(e => e.SalePrice)
.IsUnicode(false);
modelBuilder.Entity<Projection>()
.Property(e => e.TotalSales)
.HasPrecision(19, 2);
modelBuilder.Entity<Projection>()
.Property(e => e.Cost)
.HasPrecision(19, 2);
modelBuilder.Entity<Projection>()
.Property(e => e.ProfitReturn)
.HasPrecision(19, 2);
modelBuilder.Entity<Projection>()
.Property(e => e.TotalProfitReturn)
.HasPrecision(19, 2);
modelBuilder.Entity<Supplier>()
.Property(e => e.Name)
.IsUnicode(false);
modelBuilder.Entity<Supplier>()
.Property(e => e.Description)
.IsUnicode(false);
modelBuilder.Entity<Supplier>()
.HasMany(e => e.Invoices)
.WithRequired(e => e.Supplier)
.HasForeignKey(e => e.FkSupplierId)
.WillCascadeOnDelete(false);
modelBuilder.Entity<Taxable>()
.Property(e => e.Sunday)
.HasPrecision(19, 2);
modelBuilder.Entity<Taxable>()
.Property(e => e.Monday)
.HasPrecision(19, 2);
modelBuilder.Entity<Taxable>()
.Property(e => e.Tuesday)
.HasPrecision(19, 2);
modelBuilder.Entity<Taxable>()
.Property(e => e.Wednesday)
.HasPrecision(19, 2);
modelBuilder.Entity<Taxable>()
.Property(e => e.Thursday)
.HasPrecision(19, 2);
modelBuilder.Entity<Taxable>()
.Property(e => e.Friday)
.HasPrecision(19, 2);
modelBuilder.Entity<Taxable>()
.Property(e => e.Saturday)
.HasPrecision(19, 2);
modelBuilder.Entity<Taxable>()
.Property(e => e.Total)
.HasPrecision(19, 2);
modelBuilder.Entity<Version>()
.Property(e => e.VersionNumber)
.IsUnicode(false);
modelBuilder.Entity<WeekEndingDate>()
.HasMany(e => e.ActualSales)
.WithRequired(e => e.WeekEndingDate)
.HasForeignKey(e => e.FkDateId)
.WillCascadeOnDelete(false);
modelBuilder.Entity<WeekEndingDate>()
.HasMany(e => e.CostAnalysis)
.WithRequired(e => e.WeekEndingDate)
.HasForeignKey(e => e.FkDateId)
.WillCascadeOnDelete(false);
modelBuilder.Entity<WeekEndingDate>()
.HasMany(e => e.Inventories)
.WithRequired(e => e.WeekEndingDate)
.HasForeignKey(e => e.FkDateId)
.WillCascadeOnDelete(false);
modelBuilder.Entity<WeekEndingDate>()
.HasMany(e => e.Invoices)
.WithRequired(e => e.WeekEndingDate)
.HasForeignKey(e => e.FkDateId)
.WillCascadeOnDelete(false);
modelBuilder.Entity<WeekEndingDate>()
.HasMany(e => e.Notes)
.WithRequired(e => e.WeekEndingDate)
.HasForeignKey(e => e.FkDateId)
.WillCascadeOnDelete(false);
modelBuilder.Entity<WeekEndingDate>()
.HasMany(e => e.Projections)
.WithRequired(e => e.WeekEndingDate)
.HasForeignKey(e => e.FkDateId)
.WillCascadeOnDelete(false);
modelBuilder.Entity<WeekEndingDate>()
.HasMany(e => e.Taxables)
.WithRequired(e => e.WeekEndingDate)
.HasForeignKey(e => e.FkDateId)
.WillCascadeOnDelete(false);
modelBuilder.Entity<WeekEndingDate>()
.HasMany(e => e.WeeklySales)
.WithRequired(e => e.WeekEndingDate)
.HasForeignKey(e => e.FkDateId)
.WillCascadeOnDelete(false);
modelBuilder.Entity<WeeklySale>()
.Property(e => e.Sunday)
.HasPrecision(19, 2);
modelBuilder.Entity<WeeklySale>()
.Property(e => e.Monday)
.HasPrecision(19, 2);
modelBuilder.Entity<WeeklySale>()
.Property(e => e.Tuesday)
.HasPrecision(19, 2);
modelBuilder.Entity<WeeklySale>()
.Property(e => e.Wednesday)
.HasPrecision(19, 2);
modelBuilder.Entity<WeeklySale>()
.Property(e => e.Thursday)
.HasPrecision(19, 2);
modelBuilder.Entity<WeeklySale>()
.Property(e => e.Friday)
.HasPrecision(19, 2);
modelBuilder.Entity<WeeklySale>()
.Property(e => e.Saturday)
.HasPrecision(19, 2);
modelBuilder.Entity<WeeklySale>()
.Property(e => e.TotalSales)
.HasPrecision(19, 2);
}
}
}
@@ -109,7 +109,6 @@
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.Serialization" />
@@ -120,25 +119,14 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AboutBox1.cs">
<Compile Include="AboutBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AboutBox1.Designer.cs">
<DependentUpon>AboutBox1.cs</DependentUpon>
<Compile Include="AboutBox.Designer.cs">
<DependentUpon>AboutBox.cs</DependentUpon>
</Compile>
<Compile Include="ActualSale.cs" />
<Compile Include="AdItem.cs" />
<Compile Include="AdSpecial.cs" />
<Compile Include="AdvertisingProfitControlModel.cs" />
<Compile Include="AdvertisingProfitControlTableHelper.cs" />
<Compile Include="ApplicationColors.cs" />
<Compile Include="CostAnalysi.cs" />
<Compile Include="DebugDatabaseConverter.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="DebugDatabaseConverter.Designer.cs">
<DependentUpon>DebugDatabaseConverter.cs</DependentUpon>
</Compile>
<Compile Include="FrmChangeShrink.cs">
<SubType>Form</SubType>
</Compile>
@@ -182,24 +170,18 @@
<DependentUpon>FrmReportSettings.cs</DependentUpon>
</Compile>
<Compile Include="Holiday.cs" />
<Compile Include="Inventory.cs" />
<Compile Include="Invoice.cs" />
<Compile Include="NewModifyRecord.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="NewModifyRecord.Designer.cs">
<DependentUpon>NewModifyRecord.cs</DependentUpon>
</Compile>
<Compile Include="Note.cs" />
<Compile Include="Projection.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="ReportGenerator.cs" />
<Compile Include="Supplier.cs" />
<Compile Include="Taxable.cs" />
<Compile Include="TextFormat.cs" />
<Compile Include="BackPageGenerator.cs" />
<Compile Include="FrmAddRecord.cs">
@@ -225,14 +207,8 @@
<Compile Include="RowParsing.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Version.cs" />
<Compile Include="WeekEndingDate.cs" />
<Compile Include="WeeklySale.cs" />
<EmbeddedResource Include="AboutBox1.resx">
<DependentUpon>AboutBox1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DebugDatabaseConverter.resx">
<DependentUpon>DebugDatabaseConverter.cs</DependentUpon>
<EmbeddedResource Include="AboutBox.resx">
<DependentUpon>AboutBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmAddRecord.resx">
<DependentUpon>FrmAddRecord.cs</DependentUpon>
@@ -326,7 +302,12 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\AdvertisingProfitControlData\AdvertisingProfitControlData.csproj">
<Project>{e30f8b0e-dff3-4ab7-8d0c-47bd11164e51}</Project>
<Name>AdvertisingProfitControlData</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -5,6 +5,7 @@ using System.IO;
using System.Linq;
using System.Web.UI;
using Pechkin;
using AdvertisingProfitControlData;
namespace AdvertsingProfitControl
{
-25
View File
@@ -1,25 +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 CostAnalysi
{
public int Id { get; set; }
public decimal? SalesPerManHour { get; set; }
public decimal? SalaryPercentage { get; set; }
public decimal? SalaryDollar { get; set; }
public decimal? Supplies { get; set; }
public int FkDateId { get; set; }
public virtual WeekEndingDate WeekEndingDate { get; set; }
}
}
-133
View File
@@ -1,133 +0,0 @@
namespace AdvertsingProfitControl
{
partial class DebugDatabaseConverter
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.existingDatesListBox = new System.Windows.Forms.ListBox();
this.datesToConvertListBox = new System.Windows.Forms.ListBox();
this.moveOverButton = new System.Windows.Forms.Button();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.convertButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.webBrowser1 = new System.Windows.Forms.WebBrowser();
this.SuspendLayout();
//
// existingDatesListBox
//
this.existingDatesListBox.FormattingEnabled = true;
this.existingDatesListBox.ItemHeight = 24;
this.existingDatesListBox.Location = new System.Drawing.Point(23, 12);
this.existingDatesListBox.Name = "existingDatesListBox";
this.existingDatesListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
this.existingDatesListBox.Size = new System.Drawing.Size(353, 364);
this.existingDatesListBox.TabIndex = 0;
//
// datesToConvertListBox
//
this.datesToConvertListBox.FormattingEnabled = true;
this.datesToConvertListBox.ItemHeight = 24;
this.datesToConvertListBox.Location = new System.Drawing.Point(556, 29);
this.datesToConvertListBox.Name = "datesToConvertListBox";
this.datesToConvertListBox.Size = new System.Drawing.Size(97, 52);
this.datesToConvertListBox.TabIndex = 1;
//
// moveOverButton
//
this.moveOverButton.Enabled = false;
this.moveOverButton.Location = new System.Drawing.Point(381, 417);
this.moveOverButton.Name = "moveOverButton";
this.moveOverButton.Size = new System.Drawing.Size(160, 56);
this.moveOverButton.TabIndex = 2;
this.moveOverButton.Text = "Move Selected";
this.moveOverButton.UseVisualStyleBackColor = true;
this.moveOverButton.Click += new System.EventHandler(this.MoveOverButton_Click);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// convertButton
//
this.convertButton.Location = new System.Drawing.Point(556, 530);
this.convertButton.Name = "convertButton";
this.convertButton.Size = new System.Drawing.Size(133, 50);
this.convertButton.TabIndex = 3;
this.convertButton.Text = "Convert";
this.convertButton.UseVisualStyleBackColor = true;
this.convertButton.Click += new System.EventHandler(this.convertButton_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 515);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 25);
this.label1.TabIndex = 4;
this.label1.Text = "label1";
//
// webBrowser1
//
this.webBrowser1.AllowNavigation = false;
this.webBrowser1.AllowWebBrowserDrop = false;
this.webBrowser1.Location = new System.Drawing.Point(776, 53);
this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
this.webBrowser1.Name = "webBrowser1";
this.webBrowser1.Size = new System.Drawing.Size(1524, 940);
this.webBrowser1.TabIndex = 6;
this.webBrowser1.Url = new System.Uri("file:///C:/Users/Crypto/Desktop/FrontPage.html", System.UriKind.Absolute);
//
// DebugDatabaseConverter
//
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(2374, 1114);
this.Controls.Add(this.webBrowser1);
this.Controls.Add(this.label1);
this.Controls.Add(this.convertButton);
this.Controls.Add(this.moveOverButton);
this.Controls.Add(this.datesToConvertListBox);
this.Controls.Add(this.existingDatesListBox);
this.Name = "DebugDatabaseConverter";
this.Text = "DebugDatabaseConverter";
this.Load += new System.EventHandler(this.DebugDatabaseConverter_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ListBox existingDatesListBox;
private System.Windows.Forms.ListBox datesToConvertListBox;
private System.Windows.Forms.Button moveOverButton;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Button convertButton;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.WebBrowser webBrowser1;
}
}
@@ -1,799 +0,0 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Linq;
using System.Transactions;
using System.Windows.Forms;
namespace AdvertsingProfitControl
{
public partial class DebugDatabaseConverter : Form
{
private string _filePath;
private string _connectionString;
public DebugDatabaseConverter()
{
InitializeComponent();
existingDatesListBox.SelectedIndexChanged += EnableButton;
}
private void EnableButton(object sender, EventArgs e)
{
moveOverButton.Enabled = true;
}
private void DebugDatabaseConverter_Load(object sender, EventArgs e)
{
openFileDialog1.DefaultExt = "accdb";
openFileDialog1.Filter = @"Access Files (*.accdb) | *.accdb";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
var filePath = openFileDialog1.FileName;
if (File.Exists(filePath))
{
_filePath = filePath;
//Get the list of dates.
var connectionString =
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filePath + ";Persist Security Info=False";
_connectionString = connectionString;
var dates = new List<DateTime>();
var oleDbCommand = new OleDbCommand
{
CommandText = "SELECT EndOfWeekDate FROM WeekEnding"
};
var connection = new OleDbConnection(connectionString);
oleDbCommand.Connection = connection;
using (connection)
{
using (oleDbCommand)
{
connection.Open();
using (var reader = oleDbCommand.ExecuteReader())
{
while (reader != null && reader.Read())
{
dates.Add(DateTime.Parse(reader[0].ToString()));
}
}
}
connection.Close();
}
foreach (var date in dates)
{
existingDatesListBox.Items.Add(date.ToShortDateString());
}
}
}
}
private void MoveOverButton_Click(object sender, EventArgs e)
{
if (existingDatesListBox.SelectedIndex == -1) return;
foreach (var index in existingDatesListBox.SelectedItems)
{
datesToConvertListBox.Items.Add(index);
//existingDatesListBox.Items.Remove(index);
}
moveOverButton.Enabled = false;
}
private void convertButton_Click(object sender, EventArgs e)
{
if (datesToConvertListBox.Items.Count == 0)
{
return;
}
//Start by bringing in all the ad items then the suppliers.
var adItems = GetAdItems();
foreach (var adItem in adItems)
{
var db = new AdvertisingProfitControlModel();
if (db.AdItems.Any(x => x.Name == adItem)) continue;
var temp = new AdItem { Name = TextFormat.FormatAdItemText(adItem) };
db.AdItems.Add(temp);
db.SaveChanges();
}
var suppliers = GetSuppliers();
foreach (var supplier in suppliers)
{
var db = new AdvertisingProfitControlModel();
if (db.Suppliers.Any(x => x.Name == supplier)) continue;
var temp = new Supplier { Name = supplier };
db.Suppliers.Add(temp);
db.SaveChanges();
}
var adSpecials = GetAdSpecials();
foreach (var adSpecial in adSpecials)
{
var db = new AdvertisingProfitControlModel();
if(db.AdSpecials.Any(x => x.Name == adSpecial)) continue;
var tempAd = new AdSpecial
{
Name = adSpecial
};
db.AdSpecials.Add(tempAd);
db.SaveChanges();
}
foreach (var date in datesToConvertListBox.Items)
{
var oldDateId = GetDateIdByDateString(date.ToString());
//Get the tables.
var projectionsTable = ReturnProjections(oldDateId);
var inventoryTable = ReturnInventory(oldDateId);
var actualSales = ReturnActualSales(oldDateId);
var invoices = ReturnInvoiceTable(oldDateId);
var weeklySales = ReturnWeeklySalesFromDateId(oldDateId);
var taxable = ReturnTaxableFromDateId(oldDateId, _connectionString);
var comment = GetComments(oldDateId);
var costs = ReturnCostAnalysis(oldDateId, _connectionString);
MassiveWriteFunction(date.ToString(), projectionsTable, inventoryTable, actualSales, invoices, weeklySales, taxable, costs, comment);
}
}
private void MassiveWriteFunction(string dateString, DataTable projections, DataTable inventory, DataTable actualSales, DataTable invoice, DataTable weeklySales, DataTable taxableTable, DataTable costOfSales, string comments)
{
try
{
using (var transaction = new TransactionScope())
{
var db = new AdvertisingProfitControlModel();
var date = new WeekEndingDate {EndingDate = DateTime.Parse(dateString)};
if (db.WeekEndingDates.Any(x => x.EndingDate == date.EndingDate))
{
date = db.WeekEndingDates.First(x => x.EndingDate == date.EndingDate);
}
else
{
db.WeekEndingDates.Add(date);
}
var adSpecialId = -1;
for (var rowIndex = 0; rowIndex < projections.Rows.Count; rowIndex++)
{
var projectionedSale = new Projection();
var adItem = new AdItem();
var adItemId = 0;
//var id = int.Parse(projections.Rows[rowIndex][0].ToString());
var spam = TextFormat.FormatAdItemText(projections.Rows[rowIndex][0].ToString());
if (db.AdItems.Any(x => x.Name == spam))
{
//Exists
adItem = db.AdItems.First(x => x.Name == spam);
adItemId = adItem.Id;
}
else
{
//Doesn't
adItem.Name = projections.Rows[rowIndex][0].ToString();
db.AdItems.Add(adItem);
adItemId = adItem.Id;
}
projectionedSale.Sold = projections.Rows[rowIndex][1].ToString();
projectionedSale.SalePrice = projections.Rows[rowIndex][2].ToString();
projectionedSale.TotalSales = decimal.Parse(projections.Rows[rowIndex][3].ToString());
projectionedSale.Cost = decimal.Parse(projections.Rows[rowIndex][4].ToString());
projectionedSale.ProfitReturn = decimal.Parse(projections.Rows[rowIndex][5].ToString());
projectionedSale.TotalProfitReturn = decimal.Parse(projections.Rows[rowIndex][6].ToString());
projectionedSale.FkAdItemId = db.AdItems.First(x => x.Id == adItemId).Id;
projectionedSale.RowAttribute = int.Parse(projections.Rows[rowIndex][7].ToString());
if ((int) projections.Rows[rowIndex][8] == 0 && adSpecialId == -1)
{
projectionedSale.FkAdSpecialId = null;
}
else
{
if ((int) (projections.Rows[rowIndex][8]) == 0)
{
projectionedSale.FkAdSpecialId = adSpecialId;
}
else
{
adSpecialId = (int) projections.Rows[rowIndex][8];
projectionedSale.FkAdSpecialId = (int) projections.Rows[rowIndex][8];
}
}
projectionedSale.RowPosition = rowIndex + 1;
projectionedSale.FkDateId = date.Id;
db.Projections.Add(projectionedSale);
}
//inventory
adSpecialId = -1;
for (var i = 0; i < inventory.Rows.Count; i++)
{
var inventoryObject = new Inventory();
AdItem adItem;
var adItemId = 0;
var spam = TextFormat.FormatAdItemText(inventory.Rows[i][0].ToString());
if (db.AdItems.Any(x => x.Name == spam))
{
//Exists
adItem = db.AdItems.First(x => x.Name == spam);
adItemId = adItem.Id;
}
inventoryObject.BeginningInventory = inventory.Rows[i][1].ToString();
inventoryObject.Recieved = inventory.Rows[i][2].ToString();
inventoryObject.TotalInventory = inventory.Rows[i][3].ToString();
inventoryObject.EndingInventory = inventory.Rows[i][4].ToString();
inventoryObject.FkAdItemId = adItemId;
inventoryObject.RowAttribute = int.Parse(inventory.Rows[i][5].ToString());
if ((int)inventory.Rows[i][6] == 0 && adSpecialId == -1)
{
inventoryObject.FkAdSpecialId = null;
}
else
{
if ((int)(inventory.Rows[i][6]) == 0)
{
inventoryObject.FkAdSpecialId = adSpecialId;
}
else
{
adSpecialId = (int)inventory.Rows[i][6];
inventoryObject.FkAdSpecialId = (int)inventory.Rows[i][6];
}
}
inventoryObject.RowPosition = i + 1;
inventoryObject.FkDateId = date.Id;
db.Inventories.Add(inventoryObject);
}
//actual sales
adSpecialId = -1;
for (var rowIndex = 0; rowIndex < actualSales.Rows.Count; rowIndex++)
{
var actualSale = new ActualSale();
//Get the ID number of the ad item.
var adItemId = 0;
var spam = TextFormat.FormatAdItemText(actualSales.Rows[rowIndex][0].ToString());
if (db.AdItems.Any(x => x.Name == spam))
{
//Exists
var adItem = db.AdItems.First(x => x.Name == spam);
adItemId = adItem.Id;
}
//adspecialId = GetAdSpecialId(int.Parse(actualSales.Rows[rowIndex][8].ToString()));
//oleDbCommand.CommandText =
// "INSERT INTO ActualSales (Sold, SalePrice, TotalSales, Cost, ProfitReturn, TotalProfitReturn, FK_AdItemID, RowAttribute, FK_AdSpecialGroupName, RowPosition, FK_DateID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
//SELECT AdItem.AdItem, APC.ProjectionSold, APC.ProjectionSalePrice, APC.ProjectionTotalSales, APC.ProjectionCost, APC.ProjectionProfitReturn, APC.ProjectionTotalProfitReturn, APC.RowAttribute, APC.FK_GroupID FROM (AdItem INNER JOIN APC ON AdItem.ID = APC.FK_AdItemID) WHERE FK_DateID = ? ORDER BY RowPosition ASC
//SELECT Projections.ID, AdItem.AdItem, Projections.Sold, Projections.SalePrice, Projections.TotalSales, Projections.Cost, Projections.ProfitReturn, Projections.TotalProfitReturn, Projections.RowAttribute, Projections.FK_AdSpecialGroupName FROM (AdItem INNER JOIN Projections ON AdItem.ID = Projections.FK_AdItemID) WHERE FK_DateID = ? ORDER BY RowPosition ASC
actualSale.Sold = actualSales.Rows[rowIndex][1].ToString();
actualSale.SalePrice = actualSales.Rows[rowIndex][2].ToString();
actualSale.TotalSales = decimal.Parse(actualSales.Rows[rowIndex][3].ToString());
actualSale.Cost = decimal.Parse(actualSales.Rows[rowIndex][4].ToString());
actualSale.ProfitReturn = decimal.Parse(actualSales.Rows[rowIndex][5].ToString());
actualSale.TotalProfitReturn = decimal.Parse(actualSales.Rows[rowIndex][6].ToString());
actualSale.FkAdItemId = adItemId;
actualSale.RowAttribute = int.Parse(actualSales.Rows[rowIndex][7].ToString());
if ((int)actualSales.Rows[rowIndex][8] == 0 && adSpecialId == -1)
{
actualSale.FkAdSpecialId = null;
}
else
{
if ((int)(projections.Rows[rowIndex][8]) == 0)
{
actualSale.FkAdSpecialId = adSpecialId;
}
else
{
adSpecialId = (int)actualSales.Rows[rowIndex][8];
actualSale.FkAdSpecialId = (int)actualSales.Rows[rowIndex][8];
}
}
actualSale.RowPosition = rowIndex + 1;
actualSale.FkDateId = date.Id; //db.WeekEndingDates.First(x => x.Id == dateId);
//oleDbCommand.Parameters.AddWithValue("Sold", actualSales.Rows[rowIndex][1]);
//oleDbCommand.Parameters.AddWithValue("SalesPrice", actualSales.Rows[rowIndex][2]);
//oleDbCommand.Parameters.AddWithValue("TotalSales", actualSales.Rows[rowIndex][3]);
//oleDbCommand.Parameters.AddWithValue("Cost", actualSales.Rows[rowIndex][4]);
//oleDbCommand.Parameters.AddWithValue("ProfitReturn", actualSales.Rows[rowIndex][5]);
//oleDbCommand.Parameters.AddWithValue("TotalProfitReturn", actualSales.Rows[rowIndex][6]);
//oleDbCommand.Parameters.AddWithValue("adItemID", adItemId);
//oleDbCommand.Parameters.AddWithValue("RowAttribute",
// int.Parse(projections.Rows[rowIndex][7].ToString()));
//oleDbCommand.Parameters.AddWithValue("adSpecialID", adspecialId);
//oleDbCommand.Parameters.AddWithValue("RowPosition", (rowIndex + 1));
//oleDbCommand.Parameters.AddWithValue("dateID", dateId);
//oleDbCommand.ExecuteNonQuery();
//oleDbCommand.Parameters.Clear();
db.ActualSales.Add(actualSale);
}
for (var i = 0; i < invoice.Rows.Count; i++)
{
var invoiceObject = new Invoice();
var supplier = new Supplier();
var spam = invoice.Rows[i][1].ToString();
if (db.Suppliers.Any(x => x.Name == spam))
{
supplier = db.Suppliers.First(x => x.Name == spam);
}
else
{
supplier.Name = invoice.Rows[i][1].ToString();
db.Suppliers.Add(supplier);
}
invoiceObject.InvoiceDate = DateTime.Parse(invoice.Rows[i][0].ToString());
invoiceObject.InvoiceNumber = invoice.Rows[i][2].ToString();
invoiceObject.InvoiceNetAmountAtCost = decimal.Parse(invoice.Rows[i][3].ToString());
invoiceObject.InvoiceNetAmount = decimal.Parse(invoice.Rows[i][4].ToString());
invoiceObject.InvoiceNote = invoice.Rows[i][5].ToString();
invoiceObject.FkSupplierId = supplier.Id;
invoiceObject.FkDateId = date.Id;
db.Invoices.Add(invoiceObject);
// //SELECT Invoice.InvoiceDate, Supplier.SupplierName, Invoice.InvoiceNumber, Invoice.InvoiceNetAmountAtCost, Invoice.InvoiceNetAmount, Invoice.InvoiceNote FROM (Supplier INNER JOIN Invoice ON Supplier.ID = Invoice.FK_Supplier) WHERE FK_DateID = ?
// oleDbCommand.CommandText =
// "INSERT INTO Invoice (InvoiceDate, InvoiceNumber, InvoiceNetAmountAtCost, InvoiceNetAmount, InvoiceNote, FK_Supplier, FK_DateID) VALUES(?,?,?,?,?,?,?)";
// oleDbCommand.Parameters.AddWithValue("InvoiceDate", invoice.Rows[i][0].ToString());
// oleDbCommand.Parameters.AddWithValue("InvoiceNumber", invoice.Rows[i][2].ToString());
// oleDbCommand.Parameters.AddWithValue("InvoiceNetAmountAtCost",
// invoice.Rows[i][3].ToString() == "" ? 0 : double.Parse(invoice.Rows[i][3].ToString()));
// oleDbCommand.Parameters.AddWithValue("InvoiceNetAmount",
// invoice.Rows[i][4].ToString() == "" ? 0 : double.Parse(invoice.Rows[i][4].ToString()));
// oleDbCommand.Parameters.AddWithValue("InvoiceNote", invoice.Rows[i][5].ToString());
// oleDbCommand.Parameters.AddWithValue("FK_Supplier", supplier.Id);
// oleDbCommand.Parameters.AddWithValue("FK_DateID", dateId);
// oleDbCommand.ExecuteNonQuery();
// oleDbCommand.Parameters.Clear();
}
if (weeklySales.Rows.Count == 1)
{
var weeklySale = new WeeklySale
{
Sunday = decimal.Parse(weeklySales.Rows[0][0].ToString()),
Monday = decimal.Parse(weeklySales.Rows[0][1].ToString()),
Tuesday = decimal.Parse(weeklySales.Rows[0][2].ToString()),
Wednesday = decimal.Parse(weeklySales.Rows[0][3].ToString()),
Thursday = decimal.Parse(weeklySales.Rows[0][4].ToString()),
Friday = decimal.Parse(weeklySales.Rows[0][5].ToString()),
Saturday = decimal.Parse(weeklySales.Rows[0][6].ToString()),
TotalSales = decimal.Parse(weeklySales.Rows[0][7].ToString()),
FkDateId = date.Id
};
db.WeeklySales.Add(weeklySale);
}
if (taxableTable.Rows.Count == 1)
{
//Comes from DatabaseReader class, so offset by one because zero is the ID number.
var taxable = new Taxable
{
Sunday = decimal.Parse(taxableTable.Rows[0][1].ToString()),
Monday = decimal.Parse(taxableTable.Rows[0][2].ToString()),
Tuesday = decimal.Parse(taxableTable.Rows[0][3].ToString()),
Wednesday = decimal.Parse(taxableTable.Rows[0][4].ToString()),
Thursday = decimal.Parse(taxableTable.Rows[0][5].ToString()),
Friday = decimal.Parse(taxableTable.Rows[0][6].ToString()),
Saturday = decimal.Parse(taxableTable.Rows[0][7].ToString()),
Total = decimal.Parse(taxableTable.Rows[0][8].ToString()),
FkDateId = date.Id
};
db.Taxables.Add(taxable);
}
//SELECT CostOfSalesAnalysis.ID, CostOfSalesAnalysis.SalesPerManHour, CostOfSalesAnalysis.SalaryPercentage, CostOfSalesAnalysis.SalaryDollars, CostOfSalesAnalysis.Supplies FROM CostOfSalesAnalysis WHERE FK_DateID = ?
if (costOfSales.Rows.Count == 1)
{
var cost = new CostAnalysi
{
SalesPerManHour = decimal.Parse(costOfSales.Rows[0][1].ToString()),
SalaryPercentage = decimal.Parse(costOfSales.Rows[0][2].ToString()),
SalaryDollar = decimal.Parse(costOfSales.Rows[0][3].ToString()),
Supplies = decimal.Parse(costOfSales.Rows[0][4].ToString()),
FkDateId = date.Id
};
db.CostAnalysis.Add(cost);
}
if (!string.IsNullOrEmpty(comments))
{
var comment = new Note
{
Remark = comments,
FkDateId = date.Id
};
db.Notes.Add(comment);
}
//oleDbCommand.Parameters.Clear();
//oleDbCommand.CommandText = "INSERT INTO Comment (Comment, FK_DateID) VALUES (?, ?)";
//oleDbCommand.Parameters.AddWithValue("Com", comments);
//oleDbCommand.Parameters.AddWithValue("FK", dateId);
//oleDbCommand.ExecuteNonQuery();
//oleDbTransaction.Commit();
db.SaveChanges();
transaction.Complete();
}
}
catch (OleDbException e)
{
MessageBox.Show(e.Message);
//oleDbTransaction?.Rollback();
}
}
public List<string> GetAdItems()
{
var adItems = new List<string>();
var oleDbCommand = new OleDbCommand
{
CommandText = "SELECT AdItem.AdItem FROM AdItem ORDER BY AdItem.AdItem ASC"
};
var connection = new OleDbConnection(_connectionString);
oleDbCommand.Connection = connection;
using (connection)
{
using (oleDbCommand)
{
connection.Open();
var reader = oleDbCommand.ExecuteReader();
while (reader != null && reader.Read())
{
adItems.Add(reader[0].ToString());
}
}
}
return adItems;
}
public List<string> GetSuppliers()
{
var adItems = new List<string>();
var oleDbCommand = new OleDbCommand
{
CommandText = "SELECT Supplier.SupplierName FROM Supplier ORDER BY Supplier.SupplierName ASC"
};
var connection = new OleDbConnection(_connectionString);
oleDbCommand.Connection = connection;
using (connection)
{
using (oleDbCommand)
{
connection.Open();
var reader = oleDbCommand.ExecuteReader();
while (reader != null && reader.Read())
{
adItems.Add(reader[0].ToString());
}
}
}
return adItems;
}
public List<string> GetAdSpecials()
{
var adItems = new List<string>();
var oleDbCommand = new OleDbCommand
{
CommandText = "SELECT AdSpecialName.AdSpecialName FROM AdSpecialName"
};
var connection = new OleDbConnection(_connectionString);
oleDbCommand.Connection = connection;
using (connection)
{
using (oleDbCommand)
{
connection.Open();
var reader = oleDbCommand.ExecuteReader();
while (reader != null && reader.Read())
{
adItems.Add(reader[0].ToString());
}
}
}
return adItems;
}
public int GetSupplierId(string supplierName)
{
var supplier = new Supplier();
var db = new AdvertisingProfitControlModel();
try
{
if (db.Suppliers.Any(x => x.Name == supplierName))
{
return db.Suppliers.First(x => x.Name == supplierName).Id;
}
//No match
supplier.Name = supplierName;
db.Suppliers.Add(supplier);
db.SaveChanges();
return supplier.Id;
}
catch (OleDbException e)
{
MessageBox.Show(e.Message);
}
return 0;
}
private string GetComments(int dateId)
{
var comments = "";
var oleDbCommand = new OleDbCommand
{
CommandText = "SELECT Comment.Comment FROM Comment WHERE Comment.FK_DateID = ?"
};
oleDbCommand.Parameters.AddWithValue("DateID", dateId);
var connection = new OleDbConnection(_connectionString);
oleDbCommand.Connection = connection;
using (connection)
{
using (oleDbCommand)
{
connection.Open();
var reader = oleDbCommand.ExecuteReader();
while (reader != null && reader.Read())
{
comments = reader[0].ToString();
}
}
}
return comments;
}
public string RetrieveAdItemName(int id)
{
var oleDbCommand = new OleDbCommand()
{
CommandText = "SELECT AdItem.AdItem FROM AdItem WHERE AdItem.ID = ?"
};
oleDbCommand.Parameters.AddWithValue("ding", id);
var connection = new OleDbConnection(_connectionString);
oleDbCommand.Connection = connection;
var adItemName = "";
using (connection)
{
using (oleDbCommand)
{
connection.Open();
using (var reader = oleDbCommand.ExecuteReader())
{
while (reader != null && reader.Read())
{
adItemName = reader[0].ToString();
}
}
}
connection.Close();
}
return adItemName;
}
private int GetDateIdByDateString(string dateString)
{
var dateId = 0;
var oleDbCommand = new OleDbCommand()
{
CommandText = "SELECT WeekEnding.ID FROM WeekEnding WHERE WeekEnding.EndOfWeekDate = ?"
};
oleDbCommand.Parameters.AddWithValue("DateString", dateString);
var connection = new OleDbConnection(_connectionString);
oleDbCommand.Connection = connection;
using (connection)
{
using (oleDbCommand)
{
connection.Open();
using (var reader = oleDbCommand.ExecuteReader())
{
while (reader != null && reader.Read())
{
dateId = int.Parse(reader[0].ToString());
}
}
}
connection.Close();
}
return dateId;
}
private DataTable ReturnProjections(int dateId)
{
var dataTable = new DataTable();
var oleDbCommand = new OleDbCommand
{
CommandText = "SELECT AdItem.AdItem, Projections.Sold, Projections.SalePrice, Projections.TotalSales, Projections.Cost, Projections.ProfitReturn, Projections.TotalProfitReturn, Projections.RowAttribute, Projections.FK_AdSpecialGroupName FROM (AdItem INNER JOIN Projections ON AdItem.ID = Projections.FK_AdItemID) WHERE FK_DateID = ? ORDER BY RowPosition ASC"
};
oleDbCommand.Parameters.AddWithValue("DateID", dateId);
var connection = new OleDbConnection(_connectionString);
oleDbCommand.Connection = connection;
using (connection)
{
using (oleDbCommand)
{
connection.Open();
using (var dataAdapter = new OleDbDataAdapter(oleDbCommand))
{
dataAdapter.Fill(dataTable);
}
}
connection.Close();
}
return dataTable;
}
public DataTable ReturnInventory(int dateId)
{
var dataTable = new DataTable();
var oleDbCommand = new OleDbCommand()
{
CommandText = "SELECT AdItem.AdItem, Inventory.BeginningInventory, Inventory.Received, Inventory.TotalInventory, Inventory.EndingInventory, Inventory.RowAttribute, Inventory.FK_AdSpecialGroupName FROM (AdItem INNER JOIN Inventory ON AdItem.ID = Inventory.FK_AdItemID) WHERE FK_DateID = ? ORDER BY RowPosition ASC"
};
oleDbCommand.Parameters.AddWithValue("DateID", dateId);
var connection = new OleDbConnection(_connectionString);
oleDbCommand.Connection = connection;
using (connection)
{
using (oleDbCommand)
{
connection.Open();
using (var dataAdapter = new OleDbDataAdapter(oleDbCommand))
{
dataAdapter.Fill(dataTable);
}
}
connection.Close();
}
return dataTable;
}
public DataTable ReturnActualSales(int dateId)
{
var dataTable = new DataTable();
var oleDbCommand = new OleDbCommand()
{
CommandText = "SELECT AdItem.AdItem, ActualSales.Sold, ActualSales.SalePrice, ActualSales.TotalSales, ActualSales.Cost, ActualSales.ProfitReturn, ActualSales.TotalProfitReturn, ActualSales.RowAttribute, ActualSales.FK_AdSpecialGroupName FROM (AdItem INNER JOIN ActualSales ON AdItem.ID = ActualSales.FK_AdItemID) WHERE FK_DateID = ? ORDER BY RowPosition ASC"
};
oleDbCommand.Parameters.AddWithValue("DateID", dateId);
var connection = new OleDbConnection(_connectionString);
oleDbCommand.Connection = connection;
using (connection)
{
using (oleDbCommand)
{
connection.Open();
using (var dataAdapter = new OleDbDataAdapter(oleDbCommand))
{
dataAdapter.Fill(dataTable);
}
}
connection.Close();
}
return dataTable;
}
public DataTable ReturnInvoiceTable(int dateId)
{
var dataTable = new DataTable();
var oleDbCommand = new OleDbCommand()
{
CommandText = "SELECT Invoice.InvoiceDate, Supplier.SupplierName, Invoice.InvoiceNumber, Invoice.InvoiceNetAmountAtCost, Invoice.InvoiceNetAmount, Invoice.InvoiceNote FROM (Supplier INNER JOIN Invoice ON Supplier.ID = Invoice.FK_Supplier) WHERE FK_DateID = ?"
};
oleDbCommand.Parameters.AddWithValue("DateID", dateId);
var connection = new OleDbConnection(_connectionString);
oleDbCommand.Connection = connection;
using (connection)
{
using (oleDbCommand)
{
using (var adapter = new OleDbDataAdapter(oleDbCommand))
{
adapter.Fill(dataTable);
}
}
connection.Close();
}
return dataTable;
}
public DataTable ReturnWeeklySalesFromDateId(int dateId)
{
var dataTable = new DataTable();
var oleDbCommand = new OleDbCommand()
{
CommandText = "SELECT WeeklySales.Sunday, WeeklySales.Monday, WeeklySales.Tuesday, WeeklySales.Wednesday, WeeklySales.Thursday, WeeklySales.Friday, WeeklySales.Saturday, WeeklySales.TotalSales FROM WeeklySales WHERE FK_DateID = ?"
};
oleDbCommand.Parameters.AddWithValue("DateID", dateId);
var connection = new OleDbConnection(_connectionString);
oleDbCommand.Connection = connection;
using (connection)
{
using (oleDbCommand)
{
connection.Open();
using (var dataAdapter = new OleDbDataAdapter(oleDbCommand))
{
dataAdapter.Fill(dataTable);
}
}
connection.Close();
}
return dataTable;
}
public DataTable ReturnTaxableFromDateId(int dateId, string connectionString)
{
var dataTable = new DataTable();
var oleDbCommand = new OleDbCommand
{
CommandText = "SELECT Taxable.ID, Taxable.Sunday, Taxable.Monday, Taxable.Tuesday, Taxable.Wednesday, Taxable.Thursday, Taxable.Friday, Taxable.Saturday, Taxable.Total FROM Taxable WHERE FK_DateID = ?"
};
oleDbCommand.Parameters.AddWithValue("DateID", dateId);
var connection = new OleDbConnection(connectionString);
oleDbCommand.Connection = connection;
using (connection)
{
using (oleDbCommand)
{
connection.Open();
using (var dataAdapter = new OleDbDataAdapter(oleDbCommand))
{
dataAdapter.Fill(dataTable);
}
}
}
return dataTable;
}
public DataTable ReturnCostAnalysis(int dateId, string connectionString)
{
var dataTable = new DataTable();
var oleDbCommand = new OleDbCommand
{
CommandText = "SELECT CostOfSalesAnalysis.ID, CostOfSalesAnalysis.SalesPerManHour, CostOfSalesAnalysis.SalaryPercentage, CostOfSalesAnalysis.SalaryDollars, CostOfSalesAnalysis.Supplies FROM CostOfSalesAnalysis WHERE FK_DateID = ?"
};
oleDbCommand.Parameters.AddWithValue("DateID", dateId);
var connection = new OleDbConnection(connectionString);
oleDbCommand.Connection = connection;
using (connection)
{
using (oleDbCommand)
{
connection.Open();
using (var dataAdapter = new OleDbDataAdapter(oleDbCommand))
{
dataAdapter.Fill(dataTable);
}
}
}
return dataTable;
}
private void button1_Click(object sender, EventArgs e)
{
var db = new AdvertisingProfitControlModel();
using (var scope = new TransactionScope())
{
var invoices = db.Invoices.Select(x => x);
foreach (var invoice in invoices)
{
invoice.InvoiceNetAmountAtCost = invoice.InvoiceNetAmount;
invoice.InvoiceNetAmount = null;
}
db.SaveChanges();
scope.Complete();
}
}
}
}
@@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
+2 -1
View File
@@ -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();
+3 -4
View File
@@ -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();
}
/// <summary>
@@ -3,6 +3,7 @@ using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Transactions;
using System.Windows.Forms;
using AdvertisingProfitControlData;
namespace AdvertsingProfitControl
{
@@ -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
{
@@ -3,6 +3,7 @@ using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Transactions;
using System.Windows.Forms;
using AdvertisingProfitControlData;
namespace AdvertsingProfitControl
{
@@ -5,6 +5,7 @@ using System.IO;
using System.Web.UI;
using System.Linq;
using Pechkin;
using AdvertisingProfitControlData;
namespace AdvertsingProfitControl
{
-42
View File
@@ -1,42 +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("Inventory")]
public partial class Inventory
{
public int Id { get; set; }
[StringLength(256)]
public string BeginningInventory { get; set; }
[StringLength(256)]
public string Recieved { get; set; }
[StringLength(256)]
public string TotalInventory { get; set; }
[StringLength(256)]
public string EndingInventory { get; set; }
public int RowPosition { get; set; }
public int RowAttribute { get; set; }
public int FkAdItemId { get; set; }
public int? FkAdSpecialId { get; set; }
public int FkDateId { get; set; }
public virtual AdItem AdItem { get; set; }
public virtual AdSpecial AdSpecial { get; set; }
public virtual WeekEndingDate WeekEndingDate { get; set; }
}
}
-35
View File
@@ -1,35 +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 Invoice
{
public int Id { get; set; }
[Column(TypeName = "date")]
public DateTime InvoiceDate { get; set; }
[Required]
[StringLength(256)]
public string InvoiceNumber { get; set; }
public decimal? InvoiceNetAmountAtCost { get; set; }
public decimal? InvoiceNetAmount { get; set; }
[StringLength(256)]
public string InvoiceNote { get; set; }
public int FkSupplierId { get; set; }
public int FkDateId { get; set; }
public virtual WeekEndingDate WeekEndingDate { get; set; }
public virtual Supplier Supplier { get; set; }
}
}
@@ -8,6 +8,7 @@ using System.Linq;
using System.Text.RegularExpressions;
using System.Transactions;
using System.Windows.Forms;
using AdvertisingProfitControlData;
namespace AdvertsingProfitControl
{
-21
View File
@@ -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; }
}
}
-43
View File
@@ -1,43 +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 Projection
{
public int Id { get; set; }
[StringLength(128)]
public string Sold { get; set; }
[StringLength(128)]
public string SalePrice { get; set; }
public decimal? TotalSales { get; set; }
public decimal? Cost { get; set; }
public decimal? ProfitReturn { get; set; }
public decimal? TotalProfitReturn { get; set; }
public int RowPosition { get; set; }
public int RowAttribute { get; set; }
public int FkAdItemId { get; set; }
public int? FkAdSpecialId { get; set; }
public int FkDateId { get; set; }
public virtual AdItem AdItem { get; set; }
public virtual AdSpecial AdSpecial { get; set; }
public virtual WeekEndingDate WeekEndingDate { get; set; }
}
}
-28
View File
@@ -1,28 +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 Supplier
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public Supplier()
{
Invoices = new HashSet<Invoice>();
}
public int Id { get; set; }
[StringLength(256)]
public string Name { get; set; }
[StringLength(256)]
public string Description { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Invoice> Invoices { get; set; }
}
}
-34
View File
@@ -1,34 +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("Taxable")]
public partial class Taxable
{
public int Id { get; set; }
public decimal? Sunday { get; set; }
public decimal? Monday { get; set; }
public decimal? Tuesday { get; set; }
public decimal? Wednesday { get; set; }
public decimal? Thursday { get; set; }
public decimal? Friday { get; set; }
public decimal? Saturday { get; set; }
public decimal? Total { get; set; }
public int FkDateId { get; set; }
public virtual WeekEndingDate WeekEndingDate { get; set; }
}
}
-17
View File
@@ -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; }
}
}
-53
View File
@@ -1,53 +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 WeekEndingDate
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public WeekEndingDate()
{
ActualSales = new HashSet<ActualSale>();
CostAnalysis = new HashSet<CostAnalysi>();
Inventories = new HashSet<Inventory>();
Invoices = new HashSet<Invoice>();
Notes = new HashSet<Note>();
Projections = new HashSet<Projection>();
Taxables = new HashSet<Taxable>();
WeeklySales = new HashSet<WeeklySale>();
}
public int Id { get; set; }
[Column(TypeName = "date")]
public DateTime EndingDate { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<ActualSale> ActualSales { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<CostAnalysi> CostAnalysis { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Inventory> Inventories { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Invoice> Invoices { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Note> Notes { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Projection> Projections { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Taxable> Taxables { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<WeeklySale> WeeklySales { get; set; }
}
}
-33
View File
@@ -1,33 +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 WeeklySale
{
public int Id { get; set; }
public decimal? Sunday { get; set; }
public decimal? Monday { get; set; }
public decimal? Tuesday { get; set; }
public decimal? Wednesday { get; set; }
public decimal? Thursday { get; set; }
public decimal? Friday { get; set; }
public decimal? Saturday { get; set; }
public decimal? TotalSales { get; set; }
public int FkDateId { get; set; }
public virtual WeekEndingDate WeekEndingDate { get; set; }
}
}