diff --git a/PizzaBot/Components/Pages/PizzaOrderEdit.razor b/PizzaBot/Components/Pages/PizzaOrderEdit.razor index 9a8c9e8..393de45 100644 --- a/PizzaBot/Components/Pages/PizzaOrderEdit.razor +++ b/PizzaBot/Components/Pages/PizzaOrderEdit.razor @@ -61,6 +61,10 @@ { } + else if (GlobalStuffService.OrdersLocked) + { +

Orders have been locked!

+ } else { @@ -127,10 +131,10 @@ font-weight: 700; } - .priority-slider-container{ + .priority-slider-container { padding-bottom: 1rem; display: flex; - flex-direction:row; + flex-direction: row; align-items: center; gap: 1em; font-size: 0.75em; @@ -166,6 +170,16 @@ { Navigation.NavigateTo("/orderlist", true); } + + EventHandler NavigateOnLock = async (sender, eventArgs) => + { + if (GlobalStuffService.OrdersLocked) + { + Navigation.NavigateTo("/orderlist", true); + } + }; + + GlobalStuffService.OnLockOrMessageChange += NavigateOnLock; } void FormSubmitted(EditContext editContext) diff --git a/PizzaBot/Services/PizzaDBService.cs b/PizzaBot/Services/PizzaDBService.cs index b2e1f8e..126a0f7 100644 --- a/PizzaBot/Services/PizzaDBService.cs +++ b/PizzaBot/Services/PizzaDBService.cs @@ -128,6 +128,11 @@ namespace PizzaBot.Services public void DeleteById(int id) { + if (_globalStuffService.OrdersLocked) + { + return; + } + var request = _context.Requests.Find(id); var result = _context.Results.Find(id);