public void AddNormalizationInfoService(NormalAddViewModel normalAddViewModel) { var xiaocommunityName = normalAddViewModel.XiaoCommunityName.Split(','); var xiaocommunitycode = normalAddViewModel.XiaoCommunityNameeCode.Split(','); for (int i = 0; i < xiaocommunityName.Length; i++) { var addmodel = _IMapper.Map <NormalAddViewModel, Normalization_Info>(normalAddViewModel); addmodel.XiaoCommunityName = xiaocommunityName[i]; addmodel.XiaoCommunityNameeCode = xiaocommunitycode[i]; _INormalizationInfoRepository.Add(addmodel); } _INormalizationInfoRepository.SaveChanges(); }
public ActionResult NormalLizationAdd(NormalAddViewModel normalAddViewModel) { normalizationInfoService.AddNormalizationInfoService(normalAddViewModel); return(null); }