Skip to content

Commit

Permalink
Fixed defect on priority mappings not being saved when values in conf…
Browse files Browse the repository at this point in the history
…ig file are incorrect
  • Loading branch information
acenolaza committed May 19, 2015
1 parent 79afb94 commit 4107352
Showing 1 changed file with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,19 @@ private void grdProjectMappings_DataError(object sender, DataGridViewDataErrorEv

private void grdPriorityMappings_DataError(object sender, DataGridViewDataErrorEventArgs e)
{
var column = grdPriorityMappings.Columns[e.ColumnIndex];

if (column == colVersionOnePriority)
{
SetDefaultValue(VersionOnePriorities, e.RowIndex, e.ColumnIndex);
}
else if (column == colJiraPriority)
if (e.ColumnIndex >= 0)
{
SetDefaultValue(JiraPriorities, e.RowIndex, e.ColumnIndex);
var column = grdPriorityMappings.Columns[e.ColumnIndex];

if (column == colVersionOnePriority)
{
SetDefaultValue(VersionOnePriorities, e.RowIndex, e.ColumnIndex);
}
else if (column == colJiraPriority)
{
SetDefaultValue(JiraPriorities, e.RowIndex, e.ColumnIndex);
}
}

e.ThrowException = false;
}

Expand Down Expand Up @@ -300,6 +302,14 @@ public void UpdateJiraPriorities(IList<ListValue> priorities)
{
JiraPriorities = priorities;
BindJiraPriorityColumn();

if (Model.PriorityMappings.Any(priorityMapping => !priorities.Any(
p =>
p.Name.Equals(priorityMapping.JiraPriority.Name) &&
p.Value.Equals(priorityMapping.JiraPriority.Id))))
{
bsPriorityMappings.Clear();
}
}
}
}

0 comments on commit 4107352

Please sign in to comment.