Пример #1
0
        public List <InformePedidoJson> MappingInforme(tblInformePedido informe, String orderCompany, String orderType, String lastStatus, String nextStatus, String version)
        {
            List <InformePedidoJson> jsonList = new List <InformePedidoJson>();

            foreach (tblInformePedidoDetalle detalle in informe.tblInformePedidoDetalle)
            {
                InformePedidoDTO informeDTO = new InformePedidoDTO();

                informeDTO.OrderCompany        = orderCompany;
                informeDTO.OrderNumber         = informe.ipec_numero.ToString();
                informeDTO.OrderType           = orderType;
                informeDTO.OrderLineNumber     = detalle.iped_linea.ToString();
                informeDTO.Lot                 = Utils.GetValueOrEmpty(detalle.iped_lote);
                informeDTO.ItemNumber          = detalle.iped_producto.TrimStart(new Char[] { '0' }).Trim(); // sin CEROS a la izquierda;
                informeDTO.ChgLastStatus       = lastStatus;
                informeDTO.ChgReference        = Utils.GetValueOrEmpty(informe.ipec_referenciaA);
                informeDTO.ChgNextStatus       = nextStatus;
                informeDTO.ChgDispatchQuantity = Decimal.ToInt32(detalle.iped_cantidad).ToString();
                informeDTO.ChgLot              = Utils.GetValueOrEmpty(detalle.iped_lote);
                informeDTO.ChgDispatchDate     = informe.ipec_fechaFinProceso.ToString("yyyy/MM/dd");
                InformePedidoJson json = GetObjectJsonFromDTO(informeDTO);
                json.P554211I_Version = version;
                jsonList.Add(json);
            }

            return(jsonList);
        }
Пример #2
0
        public String JsonToString(InformePedidoJson obj)
        {
            var json = JsonConvert.SerializeObject(obj);

            return(json);
        }