Exemplo n.º 1
0
        public static DlDataResponse Deserialize(string json)
        {
            DlDataResponse rs;

            try
            {
                var jss = new JsonSerializerSettings
                {
                    DateTimeZoneHandling = DateTimeZoneHandling.Local,
                    DateFormatString     = "yyyyMMdd"
                };
                rs = JsonConvert.DeserializeObject <DlDataResponse>(json, jss);
            }
            catch
            {
                rs = new DlDataResponse();
            }
            return(rs);
        }
Exemplo n.º 2
0
        public static async Task <DlData> GetDrivingLicenses(int page, int pageSize)
        {
            DlData rs;
            var    url      = String.Format("{0}/api/v1/dl", Setting.ApiUrl);
            var    response = await Server.GetDataList(url, page, pageSize);

            if (response.StatusCode == HttpStatusCode.OK)
            {
                var content = response.Content;
                var obj     = DlDataResponse.Deserialize(content);
                rs = obj.Data;
            }
            else
            {
                rs = null;
            }

            return(rs);
        }