Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Keas.Core/Domain/FinancialOrganization.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
Expand All @@ -13,17 +13,17 @@ public class FinancialOrganization

[StringLength(1)]
[Required]
public string Chart { get; set; }
public string Chart { get; set; } = "X";

[StringLength(4)]
[StringLength(6)]
[Required]
public string OrgCode { get; set; }

[Required]
public Team Team { get; set; }
public int TeamId { get; set; }

public string ChartAndOrg => string.Format("{0}-{1}", Chart, OrgCode);
public string ChartAndOrg => string.Format("{0}", OrgCode);

}
}
5 changes: 3 additions & 2 deletions Keas.Mvc/Controllers/TeamAdminController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public async Task<IActionResult> AddFISOrg(FISOrgAddModel model)
{
return NotFound();
}
var foundInSpaces = await _context.Spaces.FirstOrDefaultAsync(a => a.Active && a.ChartNum == model.Chart && a.OrgId == model.OrgCode);
//var foundInSpaces = await _context.Spaces.FirstOrDefaultAsync(a => a.Active && a.ChartNum == model.Chart && a.OrgId == model.OrgCode);
var foundInSpaces = await _context.Spaces.FirstOrDefaultAsync(a => a.Active && a.OrgId == model.OrgCode);
if (!await _financialService.ValidateFISOrg(model.Chart, model.OrgCode))
{
if (foundInSpaces != null)
Expand All @@ -131,7 +132,7 @@ public async Task<IActionResult> AddFISOrg(FISOrgAddModel model)
}
}

var FISOrg = new FinancialOrganization { Chart = model.Chart, OrgCode = model.OrgCode, Team = team };
var FISOrg = new FinancialOrganization { Chart = "X", OrgCode = model.OrgCode, Team = team };

if (ModelState.IsValid)
{
Expand Down
3 changes: 1 addition & 2 deletions Keas.Mvc/Models/FISOrgAddModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ namespace Keas.Mvc.Models
public class FISOrgAddModel
{
[StringLength(1)]
[Required]
public string Chart { get; set; }

[StringLength(4)]
[StringLength(6)]
[Required]
[Display(Name = "Org Code")]
public string OrgCode { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions Keas.Mvc/Views/TeamAdmin/AddFISOrg.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
<div class="card-content col-lg-4">
<form asp-action="AddFISOrg">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
@* <div class="form-group">
<label asp-for="Chart" class="control-label"></label>
<input asp-for="Chart" class="form-control" />
<span asp-validation-for="Chart" class="text-danger"></span>
</div>
</div> *@
<div class="form-group">
<label asp-for="OrgCode" class="control-label"></label>
<input asp-for="OrgCode" class="form-control" />
Expand Down
4 changes: 2 additions & 2 deletions Keas.Mvc/Views/TeamAdmin/RemoveFISOrg.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
<div>

<dl class="dl-horizontal">
<dt>
@* <dt>
@Html.DisplayNameFor(model => model.Chart)
</dt>
<dd>
@Html.DisplayFor(model => model.Chart)
</dd>
</dd> *@
<dt>
@Html.DisplayNameFor(model => model.OrgCode)
</dt>
Expand Down
4 changes: 2 additions & 2 deletions Keas.Sql/dbo/Tables/FISOrgs.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE TABLE [dbo].[FISOrgs] (
CREATE TABLE [dbo].[FISOrgs] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Chart] NVARCHAR (1) NOT NULL,
[OrgCode] NVARCHAR (4) NOT NULL,
[OrgCode] NVARCHAR (6) NOT NULL,
[TeamId] INT NOT NULL,
CONSTRAINT [PK_FISOrgs] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_FISOrgs_Teams_TeamId] FOREIGN KEY ([TeamId]) REFERENCES [dbo].[Teams] ([Id]) ON DELETE CASCADE
Expand Down
4 changes: 2 additions & 2 deletions Test/TestsDatabase/FinancialOrganizationTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Text;
using Keas.Core.Domain;
Expand Down Expand Up @@ -49,7 +49,7 @@ public void TestDatabaseFieldAttributes()
expectedFields.Add(new NameAndType("OrgCode", "System.String", new List<string>
{
"[System.ComponentModel.DataAnnotations.RequiredAttribute()]",
"[System.ComponentModel.DataAnnotations.StringLengthAttribute((Int32)4)]"
"[System.ComponentModel.DataAnnotations.StringLengthAttribute((Int32)6)]"
}));
expectedFields.Add(new NameAndType("Team", "Keas.Core.Domain.Team", new List<string>
{
Expand Down