Commit 1c06b36f by 李承祥

基本配置信息copy() -- 方法修改

parent a02bfe5f
...@@ -258,30 +258,21 @@ public void Copy(per_allot allot) ...@@ -258,30 +258,21 @@ public void Copy(per_allot allot)
} }
if (allotId > 0) if (allotId > 0)
{ {
var director = _perforCofdirectorRepository.GetEntities(t => t.AllotID == allotId); var director = _perforCofdirectorRepository.GetEntities(t => t.AllotID == allotId) ?? _perforCofdirectorRepository.GetEntities(t => t.AllotID == -1);
if (director != null) var newDirectors = director.Select(t => new cof_director { AllotID = allot.ID, JobTitle = t.JobTitle, TypeName = t.TypeName, Value = t.Value });
{ _perforCofdirectorRepository.AddRange(newDirectors.ToArray());
var addData = director.Select(t => new cof_director { AllotID = allot.ID, JobTitle = t.JobTitle, TypeName = t.TypeName, Value = t.Value });
_perforCofdirectorRepository.AddRange(addData.ToArray()); var durgprop = _perforCofdrugpropRepository.GetEntities(t => t.AllotID == allotId) ?? _perforCofdrugpropRepository.GetEntities(t => t.AllotID == -1);
} var newDurgprops = durgprop.Select(t => new cof_drugprop { AllotID = allot.ID, MaxRange = t.MaxRange, MinRange = t.MinRange, Value = t.Value });
var durgprop = _perforCofdrugpropRepository.GetEntities(t => t.AllotID == allotId); _perforCofdrugpropRepository.AddRange(newDurgprops.ToArray());
if (durgprop != null)
{ var income = _perforCofincomeRepository.GetEntities(t => t.AllotID == allotId) ?? _perforCofincomeRepository.GetEntities(t => t.AllotID == -1);
var addData = durgprop.Select(t => new cof_drugprop { AllotID = allot.ID, MaxRange = t.MaxRange, MinRange = t.MinRange, Value = t.Value }); var newIncomes = income.Select(t => new cof_income { AllotID = allot.ID, SheetNameKeyword = t.SheetNameKeyword, UnitName = t.UnitName, Value = t.Value });
_perforCofdrugpropRepository.AddRange(addData.ToArray()); _perforCofincomeRepository.AddRange(newIncomes.ToArray());
}
var income = _perforCofincomeRepository.GetEntities(t => t.AllotID == allotId); var workyear = _perforCofworkyearRepository.GetEntities(t => t.AllotID == allotId) ?? _perforCofworkyearRepository.GetEntities(t => t.AllotID == -1);
if (income != null) var newWorkyears = workyear.Select(t => new cof_workyear { AllotID = allot.ID, MaxRange = t.MaxRange, MinRange = t.MinRange, Value = t.Value });
{ _perforCofworkyearRepository.AddRange(newWorkyears.ToArray());
var addData = income.Select(t => new cof_income { AllotID = allot.ID, SheetNameKeyword = t.SheetNameKeyword, UnitName = t.UnitName, Value = t.Value });
_perforCofincomeRepository.AddRange(addData.ToArray());
}
var workyear = _perforCofworkyearRepository.GetEntities(t => t.AllotID == allotId);
if (workyear != null)
{
var addData = workyear.Select(t => new cof_workyear { AllotID = allot.ID, MaxRange = t.MaxRange, MinRange = t.MinRange, Value = t.Value });
_perforCofworkyearRepository.AddRange(addData.ToArray());
}
} }
} }
......
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