Commit 1c06b36f by 李承祥

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

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