Example #1
0
 public Lote()
 {
     ID =0;
     DataCriacao = DateTime.MinValue;
     QtdeImagem = 0;
     Duplex = false;
     PathCaptura = string.Empty;
     UsuarioCaptura = new Usuario();
     ServicoCaptura = new Servico();
     StatusLote =0;
     OrigemID =0;
     Itens = new List<LoteItem>();
     Log = new LogLote();
 }
        private LogLote ConverteLogLoteJSON(string _pathJSON)
        {
            JObject jsonObj = new JObject();
            //JObject o1 = new JObject();
            JsonResult _js = new JsonResult();

            //o1 = JObject.Parse(System.IO.File.ReadAllText(_pathJSON));

            // read JSON directly from a file
            using (StreamReader _file = System.IO.File.OpenText(_pathJSON))
            using (JsonTextReader reader = new JsonTextReader(_file))
            {
                jsonObj = (JObject)JToken.ReadFrom(reader);
                _js = Json(jsonObj);
            }

            //JObject rss = JObject.Parse(jsonObj.ToString());

            //string _loglot = (string)rss["Lote"];

            var jsonData = default(string);
            //var lot = default(LogLote);
            LogLote _logLote = new LogLote();
            jsonData = JsonConvert.SerializeObject(jsonObj["Lote"]);

            //lot = new LogLote();
            _logLote = (LogLote)JsonConvert.DeserializeObject<LogLote>(jsonData);

            //string fa = _logLote.NomeLote;

            return _logLote;
        }