Esempio n. 1
0
 private bool CanMoveOrders(string arg)
 {
     if (SelectedTicket.IsLocked || SelectedTicket.IsClosed)
     {
         return(false);
     }
     if (!SelectedTicket.CanRemoveSelectedOrders(SelectedOrders))
     {
         return(false);
     }
     if (SelectedOrders.Any(x => x.Id == 0))
     {
         return(false);
     }
     if (SelectedOrders.Any(x => !x.Locked) && _userService.IsUserPermittedFor(PermissionNames.MoveUnlockedOrders))
     {
         return(true);
     }
     return(_userService.IsUserPermittedFor(PermissionNames.MoveOrders));
 }
Esempio n. 2
0
 private bool CanShowOrderStatesExecute(OrderStateGroup arg)
 {
     if (!SelectedOrders.Any())
     {
         return(false);
     }
     if (!arg.DecreaseOrderInventory && !arg.IncreaseOrderInventory && SelectedOrders.Any(x => !x.Locked && !x.IsStateApplied(arg)))
     {
         return(false);
     }
     if (!arg.CalculateOrderPrice && !SelectedTicket.CanRemoveSelectedOrders(SelectedOrders))
     {
         return(false);
     }
     if (SelectedOrders.Any(x => !x.DecreaseInventory && !x.IsStateApplied(arg)))
     {
         return(false);
     }
     return(!arg.UnlocksOrder || !SelectedOrders.Any(x => x.Locked && x.OrderStateGroupId == arg.Id));
 }