Merge branch 'react-version' of https://github.com/MarcEricMartel/420-5DW-HY-TP into react-version

This commit is contained in:
Victor Turgeon 2022-10-18 12:11:56 -04:00
commit 14c7ce9838
3 changed files with 25 additions and 2 deletions

View File

@ -45,7 +45,6 @@ public class SearchController : Controller {
string sTitle = prod.Title.Replace(".", " ").Replace(",", " ").ToLower(), string sTitle = prod.Title.Replace(".", " ").Replace(",", " ").ToLower(),
sCat = prod.Category.Replace(".", " ").Replace(",", " ").ToLower(), sCat = prod.Category.Replace(".", " ").Replace(",", " ").ToLower(),
sDesc = prod.Description.Replace(".", " ").Replace(",", " ").ToLower(); sDesc = prod.Description.Replace(".", " ").Replace(",", " ").ToLower();
if (sTitle.StartsWith(query)) if (sTitle.StartsWith(query))
products.Add(prod); products.Add(prod);
else if (sTitle.Contains(" " + query + " ")) else if (sTitle.Contains(" " + query + " "))

View File

@ -1,6 +1,29 @@
import { FaTimes } from 'react-icons/fa' import { FaTimes } from 'react-icons/fa'
import { FaTools } from 'react-icons/fa' import { FaTools } from 'react-icons/fa'
function renderStatus(statusCode) {
if (statusCode !== undefined) {
switch (statusCode) {
case 0:
return ("Disponible");
case 1:
return ("En commande");
case 2:
return ("Indisponible");
case 3:
return ("Liquidation");
case 4:
return ("Promotion");
case 5:
return ("Discontinué");
default:
return (<></>);
}
}
}
const SimpleItem = ({ item, onDelete, onModify }) => { const SimpleItem = ({ item, onDelete, onModify }) => {
return ( return (
<div className="inventaire-item"> <div className="inventaire-item">
@ -13,7 +36,7 @@ const SimpleItem = ({ item, onDelete, onModify }) => {
onClick={() => onDelete(item.id)} /> onClick={() => onDelete(item.id)} />
</div> </div>
</h3> </h3>
<p> Categoie: {item.category}, Prix: {item.price}, Promo: {item.promoPrice}, Quantité: {item.quantity}</p> <p> Categoie: {item.category}, Prix: {item.price}, Promo: {item.promoPrice}, Quantité: {item.quantity}, Disponibilité: {renderStatus(item.status)}</p>
<p> Description: {item.description}</p> <p> Description: {item.description}</p>
</div> </div>
) )

View File

@ -436,6 +436,7 @@ html {
display: inline-block; display: inline-block;
height: auto; height: auto;
width: 97.5%; width: 97.5%;
padding: 1.25%;
} }