示例#1
0
        public async Task <IHttpActionResult> Productos(VentaBE obj)
        {
            try
            {
                VentaBL oVentaBL           = new VentaBL(obj.IdCliente);
                Venta_DatosInicialesBE obe = oVentaBL.ListarProductos(obj.UsrCreador, obj.IdCliente, obj.IdTienda);

                if (obe != null && (obe.loProducto != null && obe.loProducto.Count > 0) && (obe.loTipoProducto != null && obe.loTipoProducto.Count > 0))
                {
                    return(Ok(Models.Util.GetBodyResponse(200, obe)));
                }
                else if (obe.loProducto == null || (obe.loProducto != null && obe.loProducto.Count == 0))
                {
                    return(Ok(Models.Util.GetBodyResponse(300, "No se encontraron Productos registrados en la Tienda seleccionada.")));
                }
                else if (obe.loTipoProducto == null || (obe.loTipoProducto != null && obe.loTipoProducto.Count == 0))
                {
                    return(Ok(Models.Util.GetBodyResponse(300, "No se encontraron Tipos de Productos registrados en la Tienda seleccionada.")));
                }
                else
                {
                    return(Ok(Models.Util.GetBodyResponse(300, "No se encontraron registros.")));
                }
            }
            catch (Exception ex)
            {
                /*LogSA.GrabarLogError("SOL TR", user, "GetListarOrdOtrs", ex);*/
                return(Ok(Models.Util.GetBodyResponse(400, ex.Message)));
            }
        }