public BasicResponse <R_ArearestrictedpersonInfo> AddArearestrictedperson(R_ArearestrictedpersonAddRequest arearestrictedpersonRequest) { var _arearestrictedperson = ObjectConverter.Copy <R_ArearestrictedpersonInfo, R_ArearestrictedpersonModel>(arearestrictedpersonRequest.ArearestrictedpersonInfo); var resultarearestrictedperson = _Repository.AddArearestrictedperson(_arearestrictedperson); var arearestrictedpersonresponse = new BasicResponse <R_ArearestrictedpersonInfo>(); arearestrictedpersonresponse.Data = ObjectConverter.Copy <R_ArearestrictedpersonModel, R_ArearestrictedpersonInfo>(resultarearestrictedperson); return(arearestrictedpersonresponse); }
/// <summary> /// 保存区域限制进入、禁止进入人员信息 /// </summary> /// <param name="AreaId"></param> /// <param name="restrictedpersonInfoList"></param> private void SaveRestrictedperson(string AreaId, List <R_ArearestrictedpersonInfo> restrictedpersonInfoList) { if (restrictedpersonInfoList == null) { return; } //先删除原来的限制进入、禁止进入信息 R_ArearestrictedpersonDeleteByAreaIdRequest restrictedpersonRequest = new R_ArearestrictedpersonDeleteByAreaIdRequest(); restrictedpersonRequest.AreaId = AreaId; _R_ArearestrictedpersonService.DeleteArearestrictedpersonByAreaId(restrictedpersonRequest); //再进行添加操作 foreach (R_ArearestrictedpersonInfo addRestrictedpersonInfo in restrictedpersonInfoList) { R_ArearestrictedpersonAddRequest add_restrictedpersonRequest = new R_ArearestrictedpersonAddRequest(); add_restrictedpersonRequest.ArearestrictedpersonInfo = addRestrictedpersonInfo; _R_ArearestrictedpersonService.AddArearestrictedperson(add_restrictedpersonRequest); } }