public DTO.UndoDeletePatientAllergiesDataResponse UndoDeletePatientAllergies(DTO.UndoDeletePatientAllergiesDataRequest request) { UndoDeletePatientAllergiesDataResponse response = new UndoDeletePatientAllergiesDataResponse(); var repo = StubRepositoryFactory.GetAllergyRepository(request, RepositoryType.PatientAllergy); repo.UndoDelete(request); response.Success = true; return(response); }
public UndoDeletePatientAllergiesDataResponse Put(UndoDeletePatientAllergiesDataRequest request) { UndoDeletePatientAllergiesDataResponse response = new UndoDeletePatientAllergiesDataResponse(); try { RequireUserId(request); response = Manager.UndoDeletePatientAllergies(request); } catch (Exception ex) { RaiseException(response, ex); } return(response); }
public void UndoDeletePatientAllergies_Test() { UndoDeletePatientAllergiesDataRequest request = new UndoDeletePatientAllergiesDataRequest { Context = context, ContractNumber = contractNumber, Ids = new List <string> { "545920a184ac05124c984711", "5459271684ac05124ce6862a", "5459281584ac05124c362845", "54593ce684ac05124c3628cf" }, UserId = userId, Version = version }; UndoDeletePatientAllergiesDataResponse response = cm.UndoDeletePatientAllergies(request); Assert.IsTrue(response.Success); }
public void UndoDeletePatientAllergies_Test() { UndoDeletePatientAllergiesDataRequest request = new UndoDeletePatientAllergiesDataRequest { Context = context, ContractNumber = contractNumber, Ids = new List <string> { "545920a184ac05124c984711", "5459271684ac05124ce6862a", "5459281584ac05124c362845", "54593ce684ac05124c3628cf" }, UserId = userId, Version = version }; //[Route("/{Context}/{Version}/{ContractNumber}/PatientAllergy/UndoDelete", "PUT")] UndoDeletePatientAllergiesDataResponse response = client.Put <UndoDeletePatientAllergiesDataResponse>( string.Format("{0}/{1}/{2}/{3}/PatientAllergy/UndoDelete", url, context, version, contractNumber), request); Assert.IsNotNull(response); }
public UndoDeletePatientAllergiesDataResponse UndoDeletePatientAllergies(UndoDeletePatientAllergiesDataRequest request) { UndoDeletePatientAllergiesDataResponse response = null; try { response = new UndoDeletePatientAllergiesDataResponse(); var repo = AllergyRepositoryFactory.GetAllergyRepository(request, RepositoryType.PatientAllergy); if (request.Ids != null && request.Ids.Count > 0) { request.Ids.ForEach(u => { request.PatientAllergyId = u; repo.UndoDelete(request); }); } response.Success = true; return(response); } catch (Exception ex) { throw ex; } }
public void Undo() { try { //[Route("/{Context}/{Version}/{ContractNumber}/PatientAllergy/UndoDelete", "PUT")] string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/PatientAllergy/UndoDelete", DDAllergyUrl, "NG", request.Version, request.ContractNumber), request.UserId); UndoDeletePatientAllergiesDataResponse response = client.Put <UndoDeletePatientAllergiesDataResponse>(url, new UndoDeletePatientAllergiesDataRequest { Ids = deletedIds, Context = "NG", ContractNumber = request.ContractNumber, UserId = request.UserId, Version = request.Version } as object); } catch (Exception ex) { throw new Exception("AD: PatientAllergiesCommand Undo::" + ex.Message, ex.InnerException); } }