Small fix

parent e9223d07
...@@ -41,7 +41,6 @@ namespace Actions ...@@ -41,7 +41,6 @@ namespace Actions
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.Error(ex); Log.Error(ex);
} }
} }
...@@ -104,6 +103,7 @@ namespace Actions ...@@ -104,6 +103,7 @@ namespace Actions
rndtBomHeader.LO = (decimal)rndtRqLo.LO; rndtBomHeader.LO = (decimal)rndtRqLo.LO;
} }
} }
var attribute = newSpecification.Attributes.FirstOrDefault(c => c.ShortDescription == "Curator"); var attribute = newSpecification.Attributes.FirstOrDefault(c => c.ShortDescription == "Curator");
if (!(attribute is null)) if (!(attribute is null))
{ {
...@@ -164,11 +164,17 @@ namespace Actions ...@@ -164,11 +164,17 @@ namespace Actions
} }
} }
} }
var infoFieldFormulation = newSpecification.InfoCards.SelectMany(c => c.InfoFields).FirstOrDefault(c => c.ShortDescription == "FM_FormulaObjLink");
var infoFieldFormulation = newSpecification.InfoCards.SelectMany(c => c.InfoFields)
.FirstOrDefault(c => c.ShortDescription == "FM_FormulaObjLink");
if(infoFieldFormulation != null) if(infoFieldFormulation != null)
{ {
var connection = DatabaseContext.Database.Connection; var connection = DatabaseContext.Database.Connection;
var serverName = connection.GetType().GetProperty("WorkstationId").GetValue(connection, null)?.ToString().ToLower(); var serverName = connection.GetType()
.GetProperty("WorkstationId")
.GetValue(connection, null)?
.ToString()
.ToLower();
string link = @"https://" + string link = @"https://" +
$"{serverName}" + $"{serverName}" +
@"/OpcenterRDnL/Wizards/OpenRequestWizard/Formulation?page=2&filter=[{%22field%22:%22RQ@RndvRq%22,%22operator%22:%22eq%22,%22value%22:%22" + @"/OpcenterRDnL/Wizards/OpenRequestWizard/Formulation?page=2&filter=[{%22field%22:%22RQ@RndvRq%22,%22operator%22:%22eq%22,%22value%22:%22" +
...@@ -178,10 +184,9 @@ namespace Actions ...@@ -178,10 +184,9 @@ namespace Actions
string value = $"<a href={link}>Рецептура</a>"; string value = $"<a href={link}>Рецептура</a>";
infoFieldFormulation.InfoFieldValue = value; infoFieldFormulation.InfoFieldValue = value;
} }
DatabaseContext.SaveChanges();
#endregion #endregion
DatabaseContext.SaveChanges();
Log.Warn($"Specification {newSpecification.ID} created!"); Log.Warn($"Specification {newSpecification.ID} created!");
} }
else if (aMaterial.ItemChanged == RnD.Common.Enums.NullableBool.True && aSaveToSpecPref == aUpdateSpecPref) else if (aMaterial.ItemChanged == RnD.Common.Enums.NullableBool.True && aSaveToSpecPref == aUpdateSpecPref)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment