Browse Source

JobParameter

confirmation-email
J 11 years ago
parent
commit
6e61a9aac2
7 changed files with 216 additions and 3 deletions
  1. +1
    -1
      Sevomin.Models/Job.cs
  2. +13
    -2
      Sevomin.Models/JobParameter.cs
  3. +29
    -0
      Sevomin.Models/Migrations/201403281016428_JobParameter.Designer.cs
  4. +38
    -0
      Sevomin.Models/Migrations/201403281016428_JobParameter.cs
  5. +126
    -0
      Sevomin.Models/Migrations/201403281016428_JobParameter.resx
  6. +2
    -0
      Sevomin.Models/Parameter.cs
  7. +7
    -0
      Sevomin.Models/Sevomin.Models.csproj

+ 1
- 1
Sevomin.Models/Job.cs View File

@ -32,6 +32,6 @@ namespace Sevomin.Models
public bool ShowCompanyLogo { get; set; }
public bool IsFullTime { get; set; }
public virtual ICollection<JobParameter> JobParameters { get; set; }
}
}

+ 13
- 2
Sevomin.Models/JobParameter.cs View File

@ -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; }
}
}

+ 29
- 0
Sevomin.Models/Migrations/201403281016428_JobParameter.Designer.cs View File

@ -0,0 +1,29 @@
// <auto-generated />
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"); }
}
}
}

+ 38
- 0
Sevomin.Models/Migrations/201403281016428_JobParameter.cs View File

@ -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");
}
}
}

+ 126
- 0
Sevomin.Models/Migrations/201403281016428_JobParameter.resx
File diff suppressed because it is too large
View File


+ 2
- 0
Sevomin.Models/Parameter.cs View File

@ -44,5 +44,7 @@ namespace Sevomin.Models
return SevominDbContext.Current.ParameterValues.Where(x => x.GroupKey == ParameterValueId).ToList();
}
}
public virtual ICollection<JobParameter> JobParameters { get; set; }
}
}

+ 7
- 0
Sevomin.Models/Sevomin.Models.csproj View File

@ -92,6 +92,10 @@
<Compile Include="Migrations\201403280938368_Job.Designer.cs">
<DependentUpon>201403280938368_Job.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201403281016428_JobParameter.cs" />
<Compile Include="Migrations\201403281016428_JobParameter.Designer.cs">
<DependentUpon>201403281016428_JobParameter.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Parameter.cs" />
<Compile Include="ParameterValue.cs" />
@ -124,6 +128,9 @@
<EmbeddedResource Include="Migrations\201403280938368_Job.resx">
<DependentUpon>201403280938368_Job.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201403281016428_JobParameter.resx">
<DependentUpon>201403281016428_JobParameter.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.


Loading…
Cancel
Save