From 6e61a9aac257b9f413ca0c9f92fa8e9d030029d0 Mon Sep 17 00:00:00 2001 From: J Date: Fri, 28 Mar 2014 14:47:59 +0430 Subject: [PATCH] JobParameter --- Sevomin.Models/Job.cs | 2 +- Sevomin.Models/JobParameter.cs | 15 ++- .../201403281016428_JobParameter.Designer.cs | 29 ++++ .../201403281016428_JobParameter.cs | 38 ++++++ .../201403281016428_JobParameter.resx | 126 ++++++++++++++++++ Sevomin.Models/Parameter.cs | 2 + Sevomin.Models/Sevomin.Models.csproj | 7 + 7 files changed, 216 insertions(+), 3 deletions(-) create mode 100644 Sevomin.Models/Migrations/201403281016428_JobParameter.Designer.cs create mode 100644 Sevomin.Models/Migrations/201403281016428_JobParameter.cs create mode 100644 Sevomin.Models/Migrations/201403281016428_JobParameter.resx diff --git a/Sevomin.Models/Job.cs b/Sevomin.Models/Job.cs index 44f443e..ee8e6fc 100644 --- a/Sevomin.Models/Job.cs +++ b/Sevomin.Models/Job.cs @@ -32,6 +32,6 @@ namespace Sevomin.Models public bool ShowCompanyLogo { get; set; } public bool IsFullTime { get; set; } - + public virtual ICollection JobParameters { get; set; } } } diff --git a/Sevomin.Models/JobParameter.cs b/Sevomin.Models/JobParameter.cs index c01cde6..9bc180a 100644 --- a/Sevomin.Models/JobParameter.cs +++ b/Sevomin.Models/JobParameter.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -12,12 +13,22 @@ namespace Sevomin.Models [Key] public long Id { get; set; } + [Index("IX_JobParameterUniqueIndex", Order=1, IsUnique=true)] + [Required] public long ParameterId { get; set; } - public virtual Parameter Parameter { get; set; } + + [Index] + [Index("IX_JobParameterUniqueIndex", Order=2, IsUnique=true)] + [Required] public long JobId { get; set; } - public virtual Job Job {get;set;} + public string StringValue { get; set; } + public decimal? NumericValue { get; set; } + public byte Moscow { get; set; } + + public virtual Parameter Parameter { get; set; } + public virtual Job Job { get; set; } } } diff --git a/Sevomin.Models/Migrations/201403281016428_JobParameter.Designer.cs b/Sevomin.Models/Migrations/201403281016428_JobParameter.Designer.cs new file mode 100644 index 0000000..fea61cf --- /dev/null +++ b/Sevomin.Models/Migrations/201403281016428_JobParameter.Designer.cs @@ -0,0 +1,29 @@ +// +namespace Sevomin.Models.Migrations +{ + using System.CodeDom.Compiler; + using System.Data.Entity.Migrations; + using System.Data.Entity.Migrations.Infrastructure; + using System.Resources; + + [GeneratedCode("EntityFramework.Migrations", "6.1.0-30225")] + public sealed partial class JobParameter : IMigrationMetadata + { + private readonly ResourceManager Resources = new ResourceManager(typeof(JobParameter)); + + string IMigrationMetadata.Id + { + get { return "201403281016428_JobParameter"; } + } + + string IMigrationMetadata.Source + { + get { return null; } + } + + string IMigrationMetadata.Target + { + get { return Resources.GetString("Target"); } + } + } +} diff --git a/Sevomin.Models/Migrations/201403281016428_JobParameter.cs b/Sevomin.Models/Migrations/201403281016428_JobParameter.cs new file mode 100644 index 0000000..e6111e6 --- /dev/null +++ b/Sevomin.Models/Migrations/201403281016428_JobParameter.cs @@ -0,0 +1,38 @@ +namespace Sevomin.Models.Migrations +{ + using System; + using System.Data.Entity.Migrations; + + public partial class JobParameter : DbMigration + { + public override void Up() + { + CreateTable( + "dbo.JobParameters", + c => new + { + Id = c.Long(nullable: false, identity: true), + ParameterId = c.Long(nullable: false), + JobId = c.Long(nullable: false), + StringValue = c.String(), + NumericValue = c.Decimal(precision: 18, scale: 2), + Moscow = c.Byte(nullable: false), + }) + .PrimaryKey(t => t.Id) + .ForeignKey("dbo.Jobs", t => t.JobId, cascadeDelete: true) + .ForeignKey("dbo.Parameters", t => t.ParameterId, cascadeDelete: true) + .Index(t => new { t.ParameterId, t.JobId }, unique: true, name: "IX_JobParameterUniqueIndex") + .Index(t => t.JobId); + + } + + public override void Down() + { + DropForeignKey("dbo.JobParameters", "ParameterId", "dbo.Parameters"); + DropForeignKey("dbo.JobParameters", "JobId", "dbo.Jobs"); + DropIndex("dbo.JobParameters", new[] { "JobId" }); + DropIndex("dbo.JobParameters", "IX_JobParameterUniqueIndex"); + DropTable("dbo.JobParameters"); + } + } +} diff --git a/Sevomin.Models/Migrations/201403281016428_JobParameter.resx b/Sevomin.Models/Migrations/201403281016428_JobParameter.resx new file mode 100644 index 0000000..c129750 --- /dev/null +++ b/Sevomin.Models/Migrations/201403281016428_JobParameter.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + H4sIAAAAAAAEAO1d2W4ktxV9D5B/KPSTHcjdWmYGE6FlQ6PFUTJaMC0ZeROoKqpVcC3tKrZGQuAvy0M+Kb8QslbuRdbWrYlhYNwii+dyuby83A7/++//zH96CQPnGSapH0dHk73p7sSBkRt7frQ8mqzR4w8fJz/9+Oc/zc+88MX5pfzugHyHU0bp0eQJodXhbJa6TzAE6TT03SRO40c0deNwBrx4tr+7+9fZ3t4MYogJxnKc+Zd1hPwQZn/gP0/iyIUrtAbBZezBIC3CccwiQ3WuQAjTFXDh0WQBn+PQj6b5lxPnOPBBSoKDx4kDoihGAOE8Ht6lcIGSOFouVjgABLevK4i/ewRBCou8H9afmxZjd58UY1YnLKHcdYri0BJw76ColxmfvFXtTqp6wzV3hmsYvZJSZ7V3NLkBCf4/gsnE4aUdngQJ+ZKv3WmVZsdhY3YqXcAqQ/7bcU7WAVon8CiCa5SAYMe5WT8EvvsP+Hob/wqjo2gdBHQOcR5xHBOAg26SeAUT9PoFPhb5vvAmzoxNN+MTVsmoNHmBLiL04d3EucLCwUMAKwWgCr9AcQJ/hhFMAILeDUC4vBHBgFkVCtI5WeTfUhrW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XLiU+Val9soqp1v/hA2wFKPnTD0jaUtKmUZiUsx19BTBkhFSAloxSwK7MugFcxMnQFK+XgpOwMSa6Kb5Nfx6aSyJ4H2A7m9aZsatY32YTqJxS2ilZdnn9l5jdS/IH50qWMz7KHEhpmcBIU5UMQG+RHFwiyjYvJjKMK9pCeCtoHHXr7gjKDtoLcoqeCdmc/b1/MMdTWfCqtHpJs5+Edq8h4iGtRHTbzSkmFtJ6WdqwSzj1h+KLMK8WCEV+8pI/ndeuI3DTI/zqFqb+sIeYYM4IuM6OrvrmIHuNyUsnlqPyEv/IIEfDwdO84Qf4jucmVxOSSQfaWduaakqsuD9C7iK7XaLVGuMgwfAiYE5FkgqqTn9H+s3meX2dX79I+ioCz6ZPLGdfRp7UfeFW+zyXn5xQQZOZbHOknbYnI0f7la4V0JdDVqoCK6qsm7LcwXAUYLL2OFuAZtskbVtnPcAnc1/oIuAqkuSHYap+f+mCJvZe0wKjT4z+xDnvhy4//A8Od2CA7qQAA + + + dbo + + \ No newline at end of file diff --git a/Sevomin.Models/Parameter.cs b/Sevomin.Models/Parameter.cs index 9c48c57..9b3a2f2 100644 --- a/Sevomin.Models/Parameter.cs +++ b/Sevomin.Models/Parameter.cs @@ -44,5 +44,7 @@ namespace Sevomin.Models return SevominDbContext.Current.ParameterValues.Where(x => x.GroupKey == ParameterValueId).ToList(); } } + + public virtual ICollection JobParameters { get; set; } } } diff --git a/Sevomin.Models/Sevomin.Models.csproj b/Sevomin.Models/Sevomin.Models.csproj index 1564363..a964d3d 100644 --- a/Sevomin.Models/Sevomin.Models.csproj +++ b/Sevomin.Models/Sevomin.Models.csproj @@ -92,6 +92,10 @@ 201403280938368_Job.cs + + + 201403281016428_JobParameter.cs + @@ -124,6 +128,9 @@ 201403280938368_Job.cs + + 201403281016428_JobParameter.cs +