dbug

parent c24e41ca
...@@ -234,32 +234,32 @@ public void Copy(per_allot allot) ...@@ -234,32 +234,32 @@ public void Copy(per_allot allot)
var director = _perforCofdirectorRepository.GetEntities(t => t.AllotID == allotId); var director = _perforCofdirectorRepository.GetEntities(t => t.AllotID == allotId);
if (director != null) if (director != null)
{ {
director.ForEach(t => { t.ID = 0; t.AllotID = allot.ID; }); var addData = director.Select(t => new cof_director { AllotID = allot.ID, JobTitle = t.JobTitle, TypeName = t.TypeName, Value = t.Value });
_perforCofdirectorRepository.AddRange(director.ToArray()); _perforCofdirectorRepository.AddRange(addData.ToArray());
} }
var durgprop = _perforCofdrugpropRepository.GetEntities(t => t.AllotID == allotId); var durgprop = _perforCofdrugpropRepository.GetEntities(t => t.AllotID == allotId);
if (durgprop != null) if (durgprop != null)
{ {
durgprop.ForEach(t => { t.ID = 0; t.AllotID = allot.ID; }); var addData = durgprop.Select(t => new cof_drugprop { AllotID = allot.ID, MaxRange = t.MaxRange, MinRange = t.MinRange, Value = t.Value });
_perforCofdrugpropRepository.AddRange(durgprop.ToArray()); _perforCofdrugpropRepository.AddRange(addData.ToArray());
} }
var income = _perforCofincomeRepository.GetEntities(t => t.AllotID == allotId); var income = _perforCofincomeRepository.GetEntities(t => t.AllotID == allotId);
if (income != null) if (income != null)
{ {
income.ForEach(t => { t.ID = 0; t.AllotID = allot.ID; }); var addData = income.Select(t => new cof_income { AllotID = allot.ID, SheetNameKeyword = t.SheetNameKeyword, UnitName = t.UnitName, Value = t.Value });
_perforCofincomeRepository.AddRange(income.ToArray()); _perforCofincomeRepository.AddRange(addData.ToArray());
} }
var position = _perforCofpositionRepository.GetEntities(t => t.AllotID == allotId); var position = _perforCofpositionRepository.GetEntities(t => t.AllotID == allotId);
if (position != null) if (position != null)
{ {
position.ForEach(t => { t.ID = 0; t.AllotID = allot.ID; }); var addData = position.Select(t => new cof_position { AllotID = allot.ID, JobTitle = t.JobTitle, ExtraFactor = t.ExtraFactor, JobType = t.JobType, State = t.State });
_perforCofpositionRepository.AddRange(position.ToArray()); _perforCofpositionRepository.AddRange(addData.ToArray());
} }
var workyear = _perforCofworkyearRepository.GetEntities(t => t.AllotID == allotId); var workyear = _perforCofworkyearRepository.GetEntities(t => t.AllotID == allotId);
if (workyear != null) if (workyear != null)
{ {
workyear.ForEach(t => { t.ID = 0; t.AllotID = allot.ID; }); var addData = workyear.Select(t => new cof_workyear { AllotID = allot.ID, MaxRange = t.MaxRange, MinRange = t.MinRange, Value = t.Value });
_perforCofworkyearRepository.AddRange(workyear.ToArray()); _perforCofworkyearRepository.AddRange(addData.ToArray());
} }
} }
} }
......
...@@ -27,7 +27,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -27,7 +27,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
var row = sheet.GetRow(r); var row = sheet.GetRow(r);
if (row == null) continue; if (row == null) continue;
var accountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell).ToString(); var accountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科室").PointCell).ToString();
if (string.IsNullOrEmpty(accountingUnit)) if (string.IsNullOrEmpty(accountingUnit))
continue; continue;
PerDataSpecialUnit employee = new PerDataSpecialUnit PerDataSpecialUnit employee = new PerDataSpecialUnit
......
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