示例#1
0
        private tblRecepcion fillCabezera(ReceptionDTO receptionDTO, String emplazamiento, String tipo)
        {
            tblRecepcion recepcion = new tblRecepcion();

            recepcion.recc_contacto         = String.Empty;
            recepcion.recc_despacho         = String.Empty;
            recepcion.recc_ordenCompra      = String.Empty;
            recepcion.recc_motivoDevolucion = String.Empty;
            recepcion.recc_observaciones    = String.Empty;
            recepcion.recc_emplazamiento    = emplazamiento;
            recepcion.recc_trec_codigo      = tipo;
            //recepcion.recc_numero = receptionDTO.F4201_DOCO; JHV 28/06 se pasa a trabajar con la OT.
            recepcion.recc_numero = receptionDTO.F4211_RORN;

            if (!String.IsNullOrWhiteSpace(receptionDTO.F4201_OPDJ))
            {
                string result = DateTime.ParseExact(receptionDTO.F4201_OPDJ, "yyyyMMdd", CultureInfo.InvariantCulture).ToString("yyyy/MM/dd");
                recepcion.recc_fechaEntrega = Utils.ParseDate(result, "yyyy/MM/dd");
            }
            else
            {
                recepcion.recc_fechaEntrega = Utils.ParseDate(Constants.FECHA_DEFAULT, "yyyy/MM/dd");
            }

            recepcion.recc_proveedor = !String.IsNullOrWhiteSpace(receptionDTO.F4211_AN8) ? receptionDTO.F4211_AN8.Trim() : String.Empty;
            recepcion.recc_almacen   = FilePropertyUtils.Instance.GetValueString(Constants.ALMACEN, recepcion.recc_proveedor);

            // VERY HARDCODE
            recepcion.recc_fechaEmision = Utils.ParseDate(Constants.FECHA_DEFAULT, "yyyy/MM/dd");

            return(recepcion);
        }
        private tblRecepcion fillCabezera(ReceptionDTO receptionDTO, String emplazamiento)
        {
            tblRecepcion recepcion = new tblRecepcion();

            recepcion.recc_contacto         = String.Empty;
            recepcion.recc_despacho         = String.Empty;
            recepcion.recc_ordenCompra      = String.Empty;
            recepcion.recc_motivoDevolucion = String.Empty;
            recepcion.recc_observaciones    = String.Empty;
            recepcion.recc_emplazamiento    = emplazamiento;
            recepcion.recc_trec_codigo      = receptionDTO.F4201_DCTO;
            recepcion.recc_numero           = receptionDTO.F4201_DOCO;

            if (!String.IsNullOrWhiteSpace(receptionDTO.F4201_OPDJ))
            {
                string result = DateTime.ParseExact(receptionDTO.F4201_OPDJ, "yyyyMMdd", CultureInfo.InvariantCulture).ToString("yyyy/MM/dd");
                recepcion.recc_fechaEntrega = Utils.ParseDate(result, "yyyy/MM/dd");
            }
            else
            {
                recepcion.recc_fechaEntrega = Utils.ParseDate(Constants.FECHA_DEFAULT, "yyyy/MM/dd");
            }

            recepcion.recc_proveedor = !String.IsNullOrWhiteSpace(receptionDTO.F4211_MCU) ? receptionDTO.F4211_MCU.Trim() : String.Empty;

            // VERY HARDCODE
            recepcion.recc_fechaEmision = Utils.ParseDate(Constants.FECHA_DEFAULT, "yyyy/MM/dd");

            return(recepcion);
        }
示例#3
0
        private tblRecepcionDetalle fillDetalle(ReceptionDTO receptionDTO)
        {
            tblRecepcionDetalle detalle = new tblRecepcionDetalle();

            detalle.recd_serie = String.Empty;
            double linea = String.IsNullOrWhiteSpace(receptionDTO.F4211_LNID) ? 0.0 : double.Parse(receptionDTO.F4211_LNID, System.Globalization.CultureInfo.InvariantCulture) * 1000;

            detalle.recd_linea       = Convert.ToInt64(linea);
            detalle.recd_lineaPedido = 0;
            detalle.recd_lote        = !String.IsNullOrWhiteSpace(receptionDTO.F4211_LOTN) ? receptionDTO.F4211_LOTN.Trim() : String.Empty;
            detalle.recd_cantidad    = !String.IsNullOrWhiteSpace(receptionDTO.F4211_UORG) ? Convert.ToInt64(Convert.ToDouble(receptionDTO.F4211_UORG)) : 0;
            detalle.recd_compania    = !String.IsNullOrWhiteSpace(receptionDTO.F4211_SRP1) ? receptionDTO.F4211_SRP1.Trim() : String.Empty;

            if (!String.IsNullOrWhiteSpace(receptionDTO.F4211_LITM) && receptionDTO.F4211_LITM.Length > 15)
            {
                // VERY HARDCODE
                detalle.recd_producto = "99999999999999";
            }
            else
            {
                detalle.recd_producto = receptionDTO.F4211_LITM;
            }

            if (!String.IsNullOrWhiteSpace(receptionDTO.F4108_MMEJ))
            {
                string result = DateTime.ParseExact(receptionDTO.F4108_MMEJ, "yyyyMMdd", CultureInfo.InvariantCulture).ToString("yyyy/MM/dd");
                detalle.recd_fechaVencimiento = Utils.ParseDate(result, "yyyy/MM/dd");
            }
            else
            {
                detalle.recd_fechaVencimiento = Utils.ParseDate(Constants.FECHA_DEFAULT, "yyyy/MM/dd");
            }

            // VERY HARDCODE
            detalle.recd_numeroPedido = "0";

            return(detalle);
        }