Ejemplo n.º 1
0
        public PmsTerminal ClaimTerminal(uint terminalId)
        {
            if (terminalId == 0)
            {
                throw new InvalidTerminalIdException();
            }

            var terminal = DbConversation.GetById <Terminal>(terminalId);

            if (terminal == null)
            {
                throw new TerminalNotFoundException();
            }

            return(new PmsTerminal(WorkbenchProvider)
            {
                Terminal = terminal
            });
        }
Ejemplo n.º 2
0
        public PmsWorkbench ClaimWorkbench(uint waiterId)
        {
            if (waiterId == 0)
            {
                throw new InvalidWaiterIdException();
            }

            var waiter = DbConversation.GetById <Waiter>(waiterId);

            if (waiter == null)
            {
                throw new WaiterNotFoundException();
            }

            return(new PmsWorkbench(TableProvider)
            {
                Waiter = waiter
            });
        }
Ejemplo n.º 3
0
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            var userRoles = GetUserRoles(navigationContext).ToList();

            if (userRoles.Any())
            {
                DbConversation.UsingTransaction(() =>
                {
                    EditMode  = EditMode.Edit;
                    var first = true;
                    foreach (var userRoleId in userRoles)
                    {
                        var userRole = DbConversation.GetById <UserRole>(userRoleId);
                        Name         = EditItemsViewModel.GetTargetValue(first, CurrentEdit.Name, userRole.Name, null);
                        _editedUserRoles.Add(userRole);
                        first = false;
                    }
                });
            }
            _navigationJournal = navigationContext.NavigationService.Journal;
        }
Ejemplo n.º 4
0
 public EditUserRoleViewModel(int userRoleId)
 {
     DbConversation.UsingTransaction(() =>
                                     Element = new UserRoleModel(DbConversation.GetById <UserRole>(userRoleId)));
     DisplayName = Strings.EditUserRole_EditUserRole;
 }