Пример #1
0
        private Movimiento ParseSQLRow(DataRow row)
        {
            Movimiento mov = new Movimiento()
            {
                Articulo      = (string)row["ARTICULO"],
                Descripcion   = (string)row["TEXT"],
                BultoId       = (int)row["CODBULTO"],
                Cantidad      = Decimal.ToInt32((decimal)row["CANTIDAD"]),
                Fecha         = (System.DateTime)row["F_MOV"],
                Lote          = (string)row["LOTE"],
                Orden         = (row["OFS"] == System.DBNull.Value ? null : row["OFS"].ToString()),
                MovimientoId  = (int)row["CODMOV"],
                UserName      = (string)row["TERMINAL"],
                UbicacionCode = (string)row["CODUBI"]
            };

            dsAlmacen.UBICACIONESDataTable dtUbicacion = new dsAlmacen.UBICACIONESDataTable();
            dtUbicacion.FillByCODUBI(mov.UbicacionCode);

            if (dtUbicacion.Count == 1)
            {
                mov.Ubicacion = Ubicacion.Parse(dtUbicacion[0]);
            }

            if (mov.Orden != null)
            {
                dsOfs.OFSDataTable dtOfs = new dsOfs.OFSDataTable();
                dtOfs.FillByOfs(int.Parse(mov.Orden));

                if (dtOfs.Count == 1)
                {
                    mov.Ofs = Orden.Parse(dtOfs[0]);
                }
            }

            dsAlmacen.BULTOSDataTable dtBultos = new dsAlmacen.BULTOSDataTable();
            dtBultos.FillByCODBULTO(mov.BultoId);

            if (dtBultos.Count == 1)
            {
                mov.Bulto = ParseBulto(dtBultos[0]);

                mov.Bulto.Ubicacion = mov.Ubicacion;
            }


            return(mov);
        }
Пример #2
0
        public IActionResult GetOfsByCodigo(string orden)
        {
            dsOfs.OFSDataTable dtOfs = new dsOfs.OFSDataTable();
            dtOfs.FillByOfs(int.Parse(orden));
            if (dtOfs.Count == 0)
            {
                return(NotFound());
            }
            else
            {
                string JSONresult;
                JSONresult = JsonConvert.SerializeObject(ParseOrden(dtOfs[0]));



                return(StatusCode(200, JSONresult));
            }
        }