Browse Source

moscow bug fix in dovomin model and job controller

confirmation-email
J 11 years ago
parent
commit
7407dc85e4
8 changed files with 185 additions and 10 deletions
  1. +0
    -3
      Sevomin.Models/DovominParameter.cs
  2. +0
    -2
      Sevomin.Models/DovominParameterViewModel.cs
  3. +29
    -0
      Sevomin.Models/Migrations/201403301120307_remove-dovominParameter-moscow.Designer.cs
  4. +18
    -0
      Sevomin.Models/Migrations/201403301120307_remove-dovominParameter-moscow.cs
  5. +126
    -0
      Sevomin.Models/Migrations/201403301120307_remove-dovominParameter-moscow.resx
  6. +7
    -0
      Sevomin.Models/Sevomin.Models.csproj
  7. +0
    -3
      Sevomin.WebFrontend.Controllers/AccountController.cs
  8. +5
    -2
      Sevomin.WebFrontend.Controllers/JobController.cs

+ 0
- 3
Sevomin.Models/DovominParameter.cs View File

@ -27,8 +27,6 @@ namespace Sevomin.Models
public string StringValue { get; private set; }
public decimal? NumericValue { get; private set; }
public byte Moscow { get; set; }
public virtual Parameter Parameter { get; set; }
public virtual Dovomin Dovomin { get; set; }
@ -41,7 +39,6 @@ namespace Sevomin.Models
this.Parameter = parameter;
this.StringValue = "";
this.NumericValue = null;
this.Moscow = 0;
}
public void SetValue(string value)


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

@ -10,7 +10,6 @@ namespace Sevomin.Models
public class DovominParameterViewModel
{
public string StringValue { get; private set; }
public byte MoscowValue { get; set; }
public long Id { get; set; }
public long ParameterId { get; set; }
@ -29,7 +28,6 @@ namespace Sevomin.Models
public DovominParameterViewModel(DovominParameter dp)
{
StringValue = dp.StringValue;
MoscowValue = dp.Moscow;
Id = dp.Id;
ParameterId = dp.Parameter.Id;


+ 29
- 0
Sevomin.Models/Migrations/201403301120307_remove-dovominParameter-moscow.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 removedovominParametermoscow : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(removedovominParametermoscow));
string IMigrationMetadata.Id
{
get { return "201403301120307_remove-dovominParameter-moscow"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}

+ 18
- 0
Sevomin.Models/Migrations/201403301120307_remove-dovominParameter-moscow.cs View File

@ -0,0 +1,18 @@
namespace Sevomin.Models.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class removedovominParametermoscow : DbMigration
{
public override void Up()
{
DropColumn("dbo.DovominParameters", "Moscow");
}
public override void Down()
{
AddColumn("dbo.DovominParameters", "Moscow", c => c.Byte(nullable: false));
}
}
}

+ 126
- 0
Sevomin.Models/Migrations/201403301120307_remove-dovominParameter-moscow.resx
File diff suppressed because it is too large
View File


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

@ -111,6 +111,10 @@
<Compile Include="Migrations\201403300806354_DovominParameter.Designer.cs">
<DependentUpon>201403300806354_DovominParameter.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201403301120307_remove-dovominParameter-moscow.cs" />
<Compile Include="Migrations\201403301120307_remove-dovominParameter-moscow.Designer.cs">
<DependentUpon>201403301120307_remove-dovominParameter-moscow.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Parameter.cs" />
<Compile Include="ParameterValue.cs" />
@ -155,6 +159,9 @@
<EmbeddedResource Include="Migrations\201403300806354_DovominParameter.resx">
<DependentUpon>201403300806354_DovominParameter.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201403301120307_remove-dovominParameter-moscow.resx">
<DependentUpon>201403301120307_remove-dovominParameter-moscow.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.


+ 0
- 3
Sevomin.WebFrontend.Controllers/AccountController.cs View File

@ -180,10 +180,7 @@ namespace Sevomin.WebFrontend.Controllers
foreach (var jp in dovomin.DovominParameters)
{
string value = form[string.Format("value-{0}", jp.Parameter.Id)];
byte moscow = 0;
byte.TryParse(form[string.Format("moscow-{0}", jp.Parameter.Id)], out moscow);
jp.SetValue(value);
jp.Moscow = moscow;
}
SevominDbContext.Current.SaveChanges();


+ 5
- 2
Sevomin.WebFrontend.Controllers/JobController.cs View File

@ -66,7 +66,7 @@ namespace Sevomin.WebFrontend.Controllers
UpdateFields(JalaliExpireDate, ContactPersonName, ContactPersonPhone,
ContactPersonEMail, IsFullTime, ShowCompanyName,
Description, ShowCompanyLogo, form, job);
//JobRepository.Current.Save();
JobRepository.Current.Save();
}
catch (Exception)
{
@ -132,7 +132,10 @@ namespace Sevomin.WebFrontend.Controllers
byte moscow = 0;
byte.TryParse(form[string.Format("moscow-{0}", jp.Parameter.Id)], out moscow);
jp.SetValue(value);
jp.Moscow = moscow;
if (string.IsNullOrWhiteSpace(jp.StringValue))
jp.Moscow = 0;
else
jp.Moscow = moscow;
}
}


Loading…
Cancel
Save