public override Task <Empty> UpdatePrisoner(PrisonerMessage request, ServerCallContext context) { Prisoner p = ConversionStuff.MessageToPrisoner(request); if (!ValidationUtility.IsPrisonerValid(p)) { return(Task.FromResult(new Empty())); } unitOfWork.PrisonerRepo.Update(p); unitOfWork.Save(); return(Task.FromResult(new Empty())); }
public async Task LoadPrisoners() { var result = await grpcClient.GetAllPrisoners(); if (result == null) { return; } ClearPrisoners(); foreach (PrisonerMessage p in result.Prisoners) { prisoners.Add(ConversionStuff.MessageToPrisoner(p)); } }
public async Task SearchPrisonersByName(string para) { var result = await grpcClient.GetPrisonersByName(new SearchParamMessage { Value = para }); if (result == null) { return; } ClearPrisoners(); foreach (PrisonerMessage p in result.Prisoners) { prisoners.Add(ConversionStuff.MessageToPrisoner(p)); } LoadPrisonerLocations(); }