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 }); }
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 }); }
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; }
public EditUserRoleViewModel(int userRoleId) { DbConversation.UsingTransaction(() => Element = new UserRoleModel(DbConversation.GetById <UserRole>(userRoleId))); DisplayName = Strings.EditUserRole_EditUserRole; }