Exemplo n.º 1
0
        private async Task <List <Patient> > InitModelsInForm()
        {
            try
            {
                string request = tcpService.SerializeInitPatientsInViewPatientForm(SingletoneObj.User);
                byte[] data    = await tcpService.CodeStreamAsync(request);

                await SingletoneObj.Stream.WriteAsync(data, 0, data.Length);

                string response = await tcpService.DecodeStreamAsync(SingletoneObj.Stream);

                List <Patient> models = tcpService.DeseializeInitPatientsInViewPatientForm(response);
                return(models);
            }
            catch (Exception)
            {
                return(new List <Patient>());
            }
        }