Commit 4a1fb586 by 李承祥

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

parent 1c06b36f
...@@ -256,24 +256,21 @@ public void Copy(per_allot allot) ...@@ -256,24 +256,21 @@ public void Copy(per_allot allot)
if (list[i].ID == allot.ID && (i - 1) >= 0) if (list[i].ID == allot.ID && (i - 1) >= 0)
allotId = list[i - 1].ID; allotId = list[i - 1].ID;
} }
if (allotId > 0) 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 });
var director = _perforCofdirectorRepository.GetEntities(t => t.AllotID == allotId) ?? _perforCofdirectorRepository.GetEntities(t => t.AllotID == -1); _perforCofdirectorRepository.AddRange(newDirectors.ToArray());
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 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 newDurgprops = durgprop.Select(t => new cof_drugprop { AllotID = allot.ID, MaxRange = t.MaxRange, MinRange = t.MinRange, Value = t.Value });
_perforCofdrugpropRepository.AddRange(newDurgprops.ToArray()); _perforCofdrugpropRepository.AddRange(newDurgprops.ToArray());
var income = _perforCofincomeRepository.GetEntities(t => t.AllotID == allotId) ?? _perforCofincomeRepository.GetEntities(t => t.AllotID == -1); 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 }); var newIncomes = income.Select(t => new cof_income { AllotID = allot.ID, SheetNameKeyword = t.SheetNameKeyword, UnitName = t.UnitName, Value = t.Value });
_perforCofincomeRepository.AddRange(newIncomes.ToArray()); _perforCofincomeRepository.AddRange(newIncomes.ToArray());
var workyear = _perforCofworkyearRepository.GetEntities(t => t.AllotID == allotId) ?? _perforCofworkyearRepository.GetEntities(t => t.AllotID == -1); 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 }); var newWorkyears = workyear.Select(t => new cof_workyear { AllotID = allot.ID, MaxRange = t.MaxRange, MinRange = t.MinRange, Value = t.Value });
_perforCofworkyearRepository.AddRange(newWorkyears.ToArray()); _perforCofworkyearRepository.AddRange(newWorkyears.ToArray());
}
} }
/// <summary> /// <summary>
......
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