Beispiel #1
0
        public ActionResult <IEnumerable <RecordsDTO> > GetRecords(string date)
        {
            try
            {
                var dt = DataHelpercs.ConvertToDate(date);

                var res = httpClient.GetStringAsync(urlRecord + @"GetRecords/" + dt.ToShortDateString()).Result;

                return(JsonConvert.DeserializeObject <List <RecordsDTO> >(res));
            }
            catch (Exception e)
            {
                List <RecordsDTO> res = new List <RecordsDTO>();
                res.Add(new RecordsDTO {
                    ClientName = e.Message
                });

                return(res);
            }
        }
Beispiel #2
0
        public ActionResult <IEnumerable <RecordsDTO> > GetRecords(string date, string spec)
        {
            try
            {
                var dt = DataHelpercs.ConvertToDate(date);

                int specId = GetSpecialists().Value.Where(s => (s.Name == spec)).FirstOrDefault().Id;
                var res    = httpClient.GetStringAsync(urlRecord + @"GetRecords/" + dt.ToShortDateString() + @"/SpecID/" + specId).Result;



                return(JsonConvert.DeserializeObject <List <RecordsDTO> >(res));
            }
            catch (Exception e)
            {
                List <RecordsDTO> res = new List <RecordsDTO>();
                res.Add(new RecordsDTO {
                    ClientName = e.Message
                });

                return(res);
            }
        }