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
@@ -0,0 +1,39 @@
using System.ComponentModel.DataAnnotations;
namespace AdvertisingProfitControlData
{
public 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; }
}
}
+34
View File
@@ -0,0 +1,34 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace AdvertisingProfitControlData
{
public 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; }
}
}
+34
View File
@@ -0,0 +1,34 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace AdvertisingProfitControlData
{
public 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; }
}
}
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E30F8B0E-DFF3-4AB7-8D0C-47BD11164E51}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AdvertisingProfitControlData</RootNamespace>
<AssemblyName>AdvertisingProfitControlData</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ActualSale.cs" />
<Compile Include="AdItem.cs" />
<Compile Include="AdSpecial.cs" />
<Compile Include="AdvertisingProfitControlModel.cs" />
<Compile Include="CostAnaylsi.cs" />
<Compile Include="Inventory.cs" />
<Compile Include="Invoice.cs" />
<Compile Include="Note.cs" />
<Compile Include="Projection.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Supplier.cs" />
<Compile Include="Taxable.cs" />
<Compile Include="Version.cs" />
<Compile Include="WeekEndingDate.cs" />
<Compile Include="WeeklySales.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,339 @@
using System;
using System.Data.Entity;
namespace AdvertisingProfitControlData
{
public class AdvertisingProfitControlModel : DbContext
{
private static string _connectionString = string.Empty;
/// <summary>
/// Initializes and stores the supplied connection string. This allows calls to
/// an overloaded constructor to take no parameters.
/// </summary>
/// <param name="connectionString">The connection string for the database.</param>
public AdvertisingProfitControlModel(string connectionString) : base(connectionString)
{
_connectionString = connectionString;
}
/// <summary>
/// Creates the database context using a previously initialized connection string.
/// </summary>
public AdvertisingProfitControlModel()
: base(ValidateConnectionString())
{
}
/// <summary>
/// Checks to make sure a connection string has been initialized.
/// </summary>
/// <returns></returns>
private static string ValidateConnectionString()
{
if (_connectionString == string.Empty)
{
throw new OperationCanceledException("A connection string must be specified.");
}
return _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);
}
}
}
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
</providers>
</entityFramework>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
@@ -0,0 +1,19 @@
namespace AdvertisingProfitControlData
{
public 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; }
}
}
+39
View File
@@ -0,0 +1,39 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AdvertisingProfitControlData
{
[Table("Inventory")]
public 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; }
}
}
+33
View File
@@ -0,0 +1,33 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AdvertisingProfitControlData
{
public 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; }
}
}
+17
View File
@@ -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; }
}
}
@@ -0,0 +1,39 @@
using System.ComponentModel.DataAnnotations;
namespace AdvertisingProfitControlData
{
public 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; }
}
}
@@ -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")]
+25
View File
@@ -0,0 +1,25 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace AdvertisingProfitControlData
{
public 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; }
}
}
+30
View File
@@ -0,0 +1,30 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace AdvertisingProfitControlData
{
[Table("Taxable")]
public 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; }
}
}
+14
View File
@@ -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; }
}
}
@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace AdvertisingProfitControlData
{
public 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; }
}
}
@@ -0,0 +1,27 @@
namespace AdvertisingProfitControlData
{
public 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; }
}
}
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.3" targetFramework="net452" />
</packages>