Пример #1
0
        public InformeRecepcionJson GetObjectJsonFromDTO(InformeRecepcionDTO detalle, String receiptsVersion)
        {
            List <InformeRecepcionDTO> list = new List <InformeRecepcionDTO>();

            list.Add(detalle);
            return(new InformeRecepcionJson(list, receiptsVersion));
        }
Пример #2
0
        internal List <InformeRecepcionJson> MappingInforme(tblInformeRecepcion informe, String OrderCompany, String OrderType, String receiptsVersion)
        {
            List <InformeRecepcionJson> jsonList = new List <InformeRecepcionJson>();

            foreach (tblInformeRecepcionDetalle detalle in informe.tblInformeRecepcionDetalle)
            {
                InformeRecepcionDTO informeDTO = new InformeRecepcionDTO();

                informeDTO.OrderCompany = OrderCompany;
                informeDTO.OrderType    = OrderType;
                int order;
                informeDTO.OrderNumber       = Int32.TryParse(informe.irec_numero, out order) ? order.ToString() : String.Empty;
                informeDTO.OrderLine         = detalle.ired_linea > 0 ? (detalle.ired_linea / 1000).ToString() : String.Empty;
                informeDTO.QuantityToRecieve = (detalle.ired_cantidadRecibida.ToString()).Replace(",", ".");
                DateTime receiptDate = informe.irec_fecha ?? Utils.ParseDate(Constants.FECHA_DEFAULT, "yyyy/MM/dd");
                informeDTO.ReceiptDate = receiptDate.ToString("yyyy/MM/dd");
                informeDTO.Lot         = detalle.ired_lote != null?detalle.ired_lote.Trim() : String.Empty;

                jsonList.Add(GetObjectJsonFromDTO(informeDTO, receiptsVersion));
            }

            return(jsonList);
        }