Exemplo n.º 1
0
 private static void OnWorkperiodStatusChanged(EventParameters<WorkPeriod> obj)
 {
     if (obj.Topic == EventTopicNames.WorkPeriodStatusChanged)
     {
         using (var ws = WorkspaceFactory.Create())
         {
             if (ws.Count<Recipe>() > 0)
             {
                 if (!AppServices.MainDataContext.IsCurrentWorkPeriodOpen)
                 {
                     var pc = InventoryService.GetCurrentPeriodicConsumption(ws);
                     if (pc.Id == 0) ws.Add(pc);
                     ws.CommitChanges();
                 }
                 else
                 {
                     if (AppServices.MainDataContext.PreviousWorkPeriod != null)
                     {
                         var pc = InventoryService.GetPreviousPeriodicConsumption(ws);
                         if (pc != null)
                         {
                             InventoryService.CalculateCost(pc, AppServices.MainDataContext.PreviousWorkPeriod);
                             ws.CommitChanges();
                         }
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 private void OnAutomationCommandEvent(EventParameters<AutomationCommand> obj)
 {
     if (obj.Topic == EventTopicNames.SelectAutomationCommandValue)
     {
         DisplayAutomationCommandValueSelector();
     }
 }
 private void OnWorkperiodStatusChanged(EventParameters<WorkPeriod> obj)
 {
     if (obj.Topic == EventTopicNames.WorkPeriodStatusChanged)
     {
         _timer.Change(1, 60000);
     }
 }
Exemplo n.º 4
0
 private void OnWorkPeriodEvent(EventParameters<WorkPeriod> obj)
 {
     if (obj.Topic == EventTopicNames.DisplayTicketExplorer)
     {
         DisplayTicketExplorerScreen();
     }
 }
 private void OnWorkPeriodChanged(EventParameters<WorkPeriod> obj)
 {
     if (obj.Topic == EventTopicNames.WorkPeriodStatusChanged)
     {
         RaisePropertyChanged(() => CanChangeDepartment);
     }
 }
Exemplo n.º 6
0
 private void OnRegionDataEvent(EventParameters<RegionData> obj)
 {
     if (IsPortrait && obj.Topic == EventTopicNames.RegionActivated && obj.Value.RegionName == RegionNames.PosSubRegion)
     {
         Grid2.SelectedIndex = 1;
     }
 }
Exemplo n.º 7
0
 private void OnUserLoginEvent(EventParameters<User> obj)
 {
     if (obj.Topic == EventTopicNames.UserLoggedOut)
     {
         CloseTicket();
     }
 }
Exemplo n.º 8
0
 private static void OnTicketCommandAdded(EventParameters<ICaptionCommand> obj)
 {
     if(obj.Topic==EventTopicNames.AddCustomTicketCommand)
         TicketCommands.Add(obj.Value);
     if (obj.Topic == EventTopicNames.AddCustomOrderCommand)
         OrderCommands.Add(obj.Value);
 }
        private void OnTicketViewModelEvent(EventParameters<TicketViewModel> obj)
        {
            if (obj.Topic == EventTopicNames.SelectTicketTag)
            {
                ResetValues(obj.Value);
                _showFreeTagEditor = SelectedTicket.LastSelectedTicketTag.FreeTagging;

                List<TicketTag> tags;
                if (_showFreeTagEditor)
                {
                    tags = Dao.Query<TicketTagGroup>(x => x.Id == SelectedTicket.LastSelectedTicketTag.Id,
                                                 x => x.TicketTags).SelectMany(x => x.TicketTags).OrderBy(x => x.Name).ToList();
                }
                else
                {
                    tags = AppServices.MainDataContext.SelectedDepartment.TicketTagGroups.Where(
                           x => x.Name == obj.Value.LastSelectedTicketTag.Name).SelectMany(x => x.TicketTags).ToList();
                }
                tags.Sort(new AlphanumComparator());
                TicketTags.AddRange(tags);

                if (SelectedTicket.IsTaggedWith(SelectedTicket.LastSelectedTicketTag.Name)) TicketTags.Add(TicketTag.Empty);
                if (TicketTags.Count == 1 && !_showFreeTagEditor) obj.Value.UpdateTag(SelectedTicket.LastSelectedTicketTag, TicketTags[0]);
                RaisePropertyChanged("TagColumnCount");
                RaisePropertyChanged("IsFreeTagEditorVisible");
                RaisePropertyChanged("FilteredTextBoxType");
            }

            if (obj.Topic == EventTopicNames.SelectVoidReason)
            {
                ResetValues(obj.Value);
                Reasons.AddRange(AppServices.MainDataContext.Reasons.Values.Where(x => x.ReasonType == 0));
                if (Reasons.Count == 0) obj.Value.VoidSelectedItems(0);
                RaisePropertyChanged("ReasonColumnCount");
            }

            if (obj.Topic == EventTopicNames.SelectGiftReason)
            {
                ResetValues(obj.Value);
                Reasons.AddRange(AppServices.MainDataContext.Reasons.Values.Where(x => x.ReasonType == 1));
                if (Reasons.Count == 0) obj.Value.GiftSelectedItems(0);
                RaisePropertyChanged("ReasonColumnCount");
            }

            if (obj.Topic == EventTopicNames.SelectExtraProperty)
            {
                ResetValues(obj.Value);
                _showExtraPropertyEditor = true;
                RaisePropertyChanged("IsExtraPropertyEditorVisible");
                RaisePropertyChanged("IsPortionsVisible");
            }

            if (obj.Topic == EventTopicNames.EditTicketNote)
            {
                ResetValues(obj.Value);
                _showTicketNoteEditor = true;
                RaisePropertyChanged("IsTicketNoteEditorVisible");
            }
        }
Exemplo n.º 10
0
 private void OnEventGenerated(EventParameters<EventAggregator> obj)
 {
     if (obj.Topic == EventTopicNames.ResetCache)
     {
         _paymentScreenValues = null;
         RaisePropertyChanged(() => PaymentScreenValues);
     }
 }
Exemplo n.º 11
0
 private void OnWarehouseEvent(EventParameters<Warehouse> obj)
 {
     if (obj.Topic == EventTopicNames.DisplayInventory)
     {
         _warehouseInventoryViewModel.Refresh(obj.Value.Id);
         ActivateInventoryView();
     }
 }
Exemplo n.º 12
0
 private void OnTicketTagDataSelected(EventParameters<TicketTagData> obj)
 {
     if (obj.Topic == EventTopicNames.SelectTicketTag)
     {
         var isTagSelected = _ticketTagEditorViewModel.TicketTagSelected(obj.Value.Ticket, obj.Value.TicketTagGroup);
         if (!isTagSelected) DisplayTicketTagEditor();
     }
 }
Exemplo n.º 13
0
 private void OnResourceEvent(EventParameters<Entity> obj)
 {
     if (obj.Topic == EventTopicNames.DisplayInventory)
     {
         var warehouse = _cacheService.GetWarehouses().Single(x => x.Id == obj.Value.WarehouseId);
         _warehouseInventoryViewModel.Refresh(warehouse.Id);
         ActivateInventoryView();
     }
 }
 private void OnDocumentCreation(EventParameters<DocumentCreationData> obj)
 {
     SelectedAccount = obj.Value.Account;
     DocumentTemplate = obj.Value.DocumentTemplate;
     Description = _accountService.GetDescription(obj.Value.DocumentTemplate, obj.Value.Account);
     Amount = _accountService.GetDefaultAmount(obj.Value.DocumentTemplate, obj.Value.Account);
     RaisePropertyChanged(() => Description);
     RaisePropertyChanged(() => Amount);
     RaisePropertyChanged(() => AccountName);
 }
Exemplo n.º 15
0
 private void OnEditResource(EventParameters<EntityOperationRequest<Resource>> obj)
 {
     if (obj.Topic == EventTopicNames.EditResourceDetails)
     {
         _operationRequest = obj.Value;
         var resourceTemplate = _cacheService.GetResourceTemplateById(obj.Value.SelectedEntity.ResourceTemplateId);
         SelectedResource = new ResourceSearchResultViewModel(obj.Value.SelectedEntity, resourceTemplate);
         CustomDataViewModel = new ResourceCustomDataViewModel(obj.Value.SelectedEntity, resourceTemplate);
         RaisePropertyChanged(() => CustomDataViewModel);
     }
 }
Exemplo n.º 16
0
 private void OnActionData(EventParameters<IActionData> obj)
 {
     if (obj.Value.Action.ActionType == ActionNames.ExecuteScript)
     {
         var script = obj.Value.GetAsString("ScriptName");
         if (!string.IsNullOrEmpty(script))
         {
             _expressionService.EvalCommand(script, "", obj.Value.DataObject, true);
         }
     }
 }
Exemplo n.º 17
0
 private void OnEvent(EventParameters<EventAggregator> obj)
 {
     switch (obj.Topic)
     {
         case EventTopicNames.DisableLandscape:
             DisableLandscapeMode();
             break;
         case EventTopicNames.EnableLandscape:
             EnableLandscapeMode();
             break;
     }
 }
Exemplo n.º 18
0
 private void OnTransactionDocumentEvent(EventParameters<AccountTransactionDocumentType> ep)
 {
     switch (ep.Topic)
     {
         case EventTopicNames.BatchCreateDocument:
             _batchDocumentCreatorViewModel.Update(ep.Value);
             ActivateBatchDocumentCreator();
             break;
         case EventTopicNames.BatchDocumentsCreated:
             ActivateAccountSelector();
             break;
     }
 }
Exemplo n.º 19
0
        private void OnDocumentCreation(EventParameters<DocumentCreationData> obj)
        {
            _description = _accountService.GetDescription(obj.Value.DocumentType, obj.Value.Account);
            SelectedAccount = obj.Value.Account;
            DocumentType = obj.Value.DocumentType;
            Description = _description;
            Amount = _accountService.GetDefaultAmount(obj.Value.DocumentType, obj.Value.Account);
            AccountSelectors = GetAccountSelectors().ToList();

            RaisePropertyChanged(() => Description);
            RaisePropertyChanged(() => Amount);
            RaisePropertyChanged(() => AccountName);
            RaisePropertyChanged(() => IsPrintCommandVisible);
        }
 private void OnAutomationCommandEvent(EventParameters<AutomationCommand> obj)
 {
     if (obj.Topic == EventTopicNames.SelectAutomationCommandValue)
     {
         CommandValues.Clear();
         SetSelectedAutomationCommand(obj.Value);
         CommandValues.AddRange(obj.Value.Values.Split('|'));
         if (CommandValues.Count == 1)
         {
             OnAutomationCommandValueSelected(CommandValues.ElementAt(0));
             return;
         }
         RaisePropertyChanged(() => ColumnCount);
     }
 }
Exemplo n.º 21
0
 private static void OnDashboardCommand(EventParameters<ICategoryCommand> result)
 {
     if (result.Topic == EventTopicNames.DashboardCommandAdded)
     {
         var cat = DashboardCommandCategories.FirstOrDefault(item => item.Category == result.Value.Category);
         if (cat == null)
         {
             cat = new DashboardCommandCategory(result.Value.Category);
             DashboardCommandCategories.Add(cat);
         }
         if (result.Value.Order > cat.Order)
             cat.Order = result.Value.Order;
         cat.AddCommand(result.Value);
     }
 }
Exemplo n.º 22
0
 private void OnUserLoggedIn(EventParameters <User> obj)
 {
     if (obj.Topic == EventTopicNames.UserLoggedIn)
     {
         _permittedDepartments = null;
         RaisePropertyChanged(() => IsDepartmentSelectorVisible);
         RaisePropertyChanged(() => PermittedDepartments);
         RaisePropertyChanged(() => CanChangeDepartment);
         if (obj.Value.UserRole.DepartmentId > 0)
         {
             _applicationStateSetter.SetSelectedEntityScreen("");
             _applicationStateSetter.SetCurrentDepartment(obj.Value.UserRole.DepartmentId);
             //_applicationStateSetter.SetCurrentTicketType(_cacheService.GetTicketTypeById(_applicationState.CurrentDepartment.TicketTypeId));
         }
     }
 }
 private void OnUserLoggedIn(EventParameters<User> obj)
 {
     if (obj.Topic == EventTopicNames.UserLoggedIn)
     {
         _permittedDepartments = null;
         RaisePropertyChanged(() => IsDepartmentSelectorVisible);
         RaisePropertyChanged(() => PermittedDepartments);
         RaisePropertyChanged(() => CanChangeDepartment);
         if (obj.Value.UserRole.DepartmentId > 0)
         {
             _applicationStateSetter.SetSelectedEntityScreen(null);
             _applicationStateSetter.SetCurrentDepartment(obj.Value.UserRole.DepartmentId);
             //_applicationStateSetter.SetCurrentTicketType(_cacheService.GetTicketTypeById(_applicationState.CurrentDepartment.TicketTypeId));
         }
     }
 }
Exemplo n.º 24
0
        private void OnSelectedOrdersDataEvent(EventParameters <SelectedOrdersData> selectedOrdersEvent)
        {
            if (selectedOrdersEvent.Topic == EventTopicNames.SelectedOrdersChanged)
            {
                _selectedOrders = selectedOrdersEvent.Value.SelectedOrders.ToList();

                if (_selectedOrdersViewModel.ShouldDisplay(selectedOrdersEvent.Value.Ticket, _selectedOrders))
                {
                    DisplayTicketDetailsScreen();
                }
                else if (_productTimerEditorViewModel.ShouldDisplay(selectedOrdersEvent.Value.Ticket, _selectedOrders.ToList()))
                {
                    DisplayProdcutTimerEdior(_selectedOrders.First());
                }
            }
        }
        private void OnOrderStateDataSelected(EventParameters<OrderStateData> obj)
        {
            if (obj.Topic == EventTopicNames.SelectOrderState)
            {
                ResetValues(obj.Value.Ticket);
                SelectedOrderStateData = obj.Value;
                OrderStates.AddRange(obj.Value.OrderStateGroup.OrderStates.Select(x => new OrderStateButtonViewModel(obj.Value.SelectedOrders, obj.Value.OrderStateGroup, x)));
                if (OrderStates.Count == 1)
                {
                    obj.Value.SelectedOrderState = OrderStates[0].Model;
                    obj.Value.PublishEvent(EventTopicNames.OrderStateSelected);
                    return;
                }
                RaisePropertyChanged(() => OrderStateColumnCount);

            }
        }
Exemplo n.º 26
0
        private void OnAccountSelectedFromPopup(EventParameters <PopupData> obj)
        {
            if (obj.Value.EventMessage == EventTopicNames.SelectEntity)
            {
                //todo fix (caller id popupuna týklandýðýnda adisyon açan metod)

                //var dep = AppServices.MainDataContext.Departments.FirstOrDefault(y => y.IsTakeAway);
                //if (dep != null)
                //{
                //    UpdateSelectedDepartment(dep.Id);
                //    SelectedTicketView = OpenTicketListView;
                //}
                //if (SelectedDepartment == null)
                //    SelectedDepartment = AppServices.MainDataContext.Departments.FirstOrDefault();
                RefreshVisuals();
            }
        }
Exemplo n.º 27
0
        public void RoundTripMinimum()
        {
            var x = new EventParameters
            {
                DocumentId  = _id,
                ElementId   = "abc",
                EventName   = "click",
                EventNumber = 1,
            };
            var json   = LaraUI.JSON.Stringify(x);
            var result = LaraUI.JSON.Parse <EventParameters>(json);

            Assert.Equal(x.DocumentId, result.DocumentId);
            Assert.Equal(x.ElementId, result.ElementId);
            Assert.Equal(x.EventName, result.EventName);
            Assert.Equal(x.EventNumber, result.EventNumber);
        }
Exemplo n.º 28
0
 private void OnTicketIdPublished(EventParameters <int> obj)
 {
     if (obj.Topic == EventTopicNames.DisplayTicket)
     {
         if (SelectedTicket != null)
         {
             CloseTicket();
         }
         if (SelectedTicket != null)
         {
             return;
         }
         ExpectedAction = obj.ExpectedAction;
         OpenTicket(obj.Value);
         EventServiceFactory.EventService.PublishEvent(EventTopicNames.RefreshSelectedTicket);
     }
 }
Exemplo n.º 29
0
 private void OnEvent(EventParameters<EventAggregator> obj)
 {
     switch (obj.Topic)
     {
         case EventTopicNames.ActivateMenuView:
             if (IsPortrait) Grid2.SelectedIndex = 1;
             break;
         case EventTopicNames.ActivatePosView:
             if (IsPortrait) Grid2.SelectedIndex = 0;
             break;
         case EventTopicNames.DisableLandscape:
             DisableLandscapeMode();
             break;
         case EventTopicNames.EnableLandscape:
             EnableLandscapeMode();
             break;
     }
 }
Exemplo n.º 30
0
        //Parameter commands
        private void OnCreateParameter()
        {
            //Adds a blank entry to the EventParameters collection
            EventParameter eventParameter = new EventParameter();

            eventParameter.PropertyName     = "";
            eventParameter.MappedTo_Input_X = "";
            eventParameter.WFProfileId      = 0;
            EventParameters.Add(eventParameter);

            SelectedEventParameter = eventParameter;

            CreatingItem = true;
            CreateParameterCommand.RaiseCanExecuteChanged();
            UpdateParameterCommand.RaiseCanExecuteChanged();
            DeleteParameterCommand.RaiseCanExecuteChanged();
            RefreshParametersCommand.RaiseCanExecuteChanged();
        }
Exemplo n.º 31
0
        private void OnOrderTagEvent(EventParameters <OrderTagData> obj)
        {
            if (obj.Topic == EventTopicNames.OrderTagSelected)
            {
                _ticketService.TagOrders(SelectedTicket, SelectedTicket.ExtractSelectedOrders(), obj.Value.OrderTagGroup, obj.Value.SelectedOrderTag, "");
                _ticketOrdersViewModel.SelectedTicket = SelectedTicket;
                ClearSelection = true;
                RefreshVisuals();
            }

            if (obj.Topic == EventTopicNames.OrderTagRemoved)
            {
                _ticketService.UntagOrders(SelectedTicket, SelectedTicket.ExtractSelectedOrders(), obj.Value.OrderTagGroup,
                                           obj.Value.SelectedOrderTag);
                _ticketOrdersViewModel.RefreshSelectedOrders();
                RefreshVisuals();
            }
        }
Exemplo n.º 32
0
        private void OnTicketViewModelEvent(EventParameters<TicketViewModel> obj)
        {
            if (obj.Topic == EventTopicNames.SelectedItemsChanged)
            {
                if (SelectedTicketItemsViewModel.ShouldDisplay(obj.Value))
                    DisplayTicketDetailsScreen();
                else DisplayCategoriesScreen();
            }

            if (obj.Topic == EventTopicNames.SelectVoidReason
                || obj.Topic == EventTopicNames.SelectGiftReason
                || obj.Topic == EventTopicNames.SelectExtraProperty
                || obj.Topic == EventTopicNames.SelectTicketTag
                || obj.Topic == EventTopicNames.EditTicketNote)
            {
                DisplayTicketDetailsScreen();
            }
        }
Exemplo n.º 33
0
        public async Task <IActionResult> GetEventsForAccount(Guid accountId, [FromQuery] EventParameters eventParameters)
        {
            if (eventParameters.ValidDateRange !)
            {
                return(BadRequest("Max date can't be less than min age."));
            }

            PagedList <Event> accountEvents = await _repository.Event.GetEventsAsync(accountId, eventParameters, trackChanges : false);

            Response.Headers.Add("X-Pagination", JsonConvert.SerializeObject(accountEvents.MetaData));

            var eventsDTO = _mapper.Map <IEnumerable <EventDTO> >(accountEvents);

            var links = _eventLinks.TryGenerateLinks(eventsDTO,
                                                     eventParameters.Fields, accountId, HttpContext);

            return(links.HasLinks ? Ok(links.LinkedEntites) : Ok(links.ShapedEntities));
        }
Exemplo n.º 34
0
 private void OnTicketTagSelected(EventParameters <TicketTagGroup> obj)
 {
     if (obj.Topic == EventTopicNames.ActivateTicketList)
     {
         if (SelectedTicket != null)
         {
             CloseTicket();
         }
         _ticketListViewModel.UpdateListByTicketTagGroup(obj.Value);
         if (_ticketListViewModel.Tickets.Any())
         {
             DisplayTicketList();
         }
         else
         {
             DisplayTickets();
         }
     }
 }
Exemplo n.º 35
0
 /// <summary>Initializes a blank Briefing</summary>
 public Briefing()
 {               //initialize
     _eventParameters = new EventParameters();
     _platform        = MissionFile.Platform.TIE;
     Length           = 0x21C;   //default 45 seconds
     _events          = new short[0x190];
     _briefingTags    = new string[0x20];
     _briefingStrings = new string[0x20];
     for (int i = 0; i < 0x20; i++)
     {
         _briefingTags[i]    = "";
         _briefingStrings[i] = "";
     }
     _events[1] = (short)EventType.MoveMap;
     _events[5] = (short)EventType.ZoomMap;
     _events[6] = 0x30;
     _events[7] = 0x30;
     _events[8] = 9999;
     _events[9] = (short)EventType.EndBriefing;
 }
        private void OnSelectedOrdersDataEvent(EventParameters <OperationRequest <SelectedOrdersData> > selectedOrdersEvent)
        {
            if (selectedOrdersEvent.Topic == EventTopicNames.DisplayTicketOrderDetails)
            {
                _selectedOrders = selectedOrdersEvent.Value.SelectedItem.SelectedOrders.ToList();

                if (_selectedOrdersViewModel.ShouldDisplay(selectedOrdersEvent.Value.SelectedItem.Ticket, _selectedOrders))
                {
                    DisplayTicketDetailsScreen(selectedOrdersEvent.Value);
                }
                else if (_productTimerEditorViewModel.ShouldDisplay(selectedOrdersEvent.Value.SelectedItem.Ticket, _selectedOrders.ToList()))
                {
                    DisplayProdcutTimerEdior(_selectedOrders.First());
                }
                else
                {
                    EventServiceFactory.EventService.PublishEvent(EventTopicNames.RefreshSelectedTicket);
                }
            }
        }
Exemplo n.º 37
0
        private void OnTicketEventReceived(EventParameters <Ticket> obj)
        {
            if (obj.Topic == EventTopicNames.SetSelectedTicket)
            {
                if (SelectedTicket != null)
                {
                    CloseTicket();
                }
                _applicationStateSetter.SetApplicationLocked(true);
                SelectedTicket = obj.Value;
            }

            if (obj.Topic == EventTopicNames.MoveSelectedOrders)
            {
                var newTicketId = _ticketService.MoveOrders(SelectedTicket, SelectedTicket.ExtractSelectedOrders().ToArray(), 0).TicketId;
                SelectedTicket = null;
                OpenTicket(newTicketId);
                DisplaySingleTicket();
            }
        }
        private void OnTicketEvent(EventParameters <Ticket> obj)
        {
            if (obj.Topic == EventTopicNames.SelectAutomationCommand)
            {
                _automationCommandSelectorViewModel.SelectedTicket = obj.Value;
                DisplayAutomationCommandSelector();
            }

            if (obj.Topic == EventTopicNames.EditTicketNote)
            {
                _ticketNoteEditorViewModel.SelectedTicket = obj.Value;
                DisplayTicketNoteEditor();
            }

            if (obj.Topic == EventTopicNames.DisplayTicketLog)
            {
                _ticketLogViewerViewModel.SelectedTicket = obj.Value;
                DisplayTicketLogViewer();
            }
        }
Exemplo n.º 39
0
        private void OnTicketEvent(EventParameters<Ticket> obj)
        {
            if (obj.Topic == EventTopicNames.SelectAutomationCommand)
            {
                _automationCommandSelectorViewModel.SelectedTicket = obj.Value;
                DisplayAutomationCommandSelector();
            }

            if (obj.Topic == EventTopicNames.EditTicketNote)
            {
                _ticketNoteEditorViewModel.SelectedTicket = obj.Value;
                DisplayTicketNoteEditor();
            }

            if (obj.Topic == EventTopicNames.DisplayTicketLog)
            {
                _ticketLogViewerViewModel.SelectedTicket = obj.Value;
                DisplayTicketLogViewer();
            }
        }
Exemplo n.º 40
0
        protected override void ProcessRecord()
        {
            try
            {
                WriteVerbose(pass);
                WriteVerbose("Query: " + query);

                SplunkConnection con = new SplunkConnection(serverUrl);
                if (login.StartsWith("\\"))
                {
                    login = login.Substring(1);
                }
                string sessionKey = con.Authenticate(login, pass);

                WriteVerbose("SessionKey: " + sessionKey);

                SearchManager searchManager = new SearchManager(con);
//                searchManager.ControlAllJobs(JobAction.CANCEL);

                SearchJob job = searchManager.SyncSearch(query, null);

                WriteVerbose("Job ID: " + job.Id);

                EventParameters ep = new EventParameters();

                if (fields != null && fields.Length > 0)
                {
                    ep.FieldList = fields;
                }

                DataTable dt = job.GetEventsTable(ep);

                WriteObject(dt);

                job.Cancel();
            }
            catch (Exception e)
            {
                WriteObject(e.Message);
            }
        }
Exemplo n.º 41
0
 /// <summary>Initializes a blank Briefing</summary>
 public Briefing()
 {
     //initialize
     _eventParameters = new EventParameters();
     _platform = MissionFile.Platform.TIE;
     Length = 0x21C;	//default 45 seconds
     _events = new short[0x190];
     _briefingTags = new string[0x20];
     _briefingStrings = new string[0x20];
     for (int i=0;i<0x20;i++)
     {
         _briefingTags[i] = "";
         _briefingStrings[i] = "";
     }
     _events[1] = (short)EventType.MoveMap;
     _events[5] = (short)EventType.ZoomMap;
     _events[6] = 0x30;
     _events[7] = 0x30;
     _events[8] = 9999;
     _events[9] = (short)EventType.EndBriefing;
 }
Exemplo n.º 42
0
 /// <summary>Initializes a blank Briefing</summary>
 public Briefing()
 {               //initialize
     _eventParameters = new EventParameters();
     _platform        = MissionFile.Platform.XvT;
     Length           = 0x384;   // default to 45 seconds
     _events          = new short[0x190];
     _briefingTags    = new string[0x20];
     _briefingStrings = new string[0x20];
     for (int i = 0; i < 0x20; i++)
     {
         _briefingTags[i]    = "";
         _briefingStrings[i] = "";
     }
     _events[1] = (short)EventType.MoveMap;
     _events[5] = (short)EventType.ZoomMap;
     _events[6] = 0x30;
     _events[7] = 0x30;
     _events[8] = 9999;
     _events[9] = (short)EventType.EndBriefing;
     //[JB] Moved team visibility to BriefingCollection to fix a bug where the team[0] would see "every" briefing (the last team to be flagged?)
 }
Exemplo n.º 43
0
        /// <summary>
        /// Gets events by filter by name, lovation and date.
        /// </summary>
        /// <param name="eventParameters">The event parameters.</param>
        /// <returns></returns>
        public async Task <PagedList <Entity> > GetEventsByCondition(EventParameters eventParameters)
        {
            var getEventsParams = new object[] {
                new MySqlParameter("@limit", eventParameters.PageSize),
                new MySqlParameter("@offset", (eventParameters.PageNumber - 1) * eventParameters.PageSize),
                new MySqlParameter("@fromDate", eventParameters.FromDate),
                new MySqlParameter("@toDate", eventParameters.ToDate),
                new MySqlParameter("@eventName", eventParameters.EventName),
                new MySqlParameter("@eventLocation", eventParameters.Location),
                new MySqlParameter("@ReviewType", eventParameters.ReviewType),
                new MySqlParameter("@ApprovalStatusId", eventParameters.ApprovalStatus)
            };

            var events = await FindAll("CALL SpSearchActiveEvents(@limit, @offset, @ReviewType, @ApprovalStatusId, @eventName, @eventLocation, @fromDate, @toDate)", getEventsParams).ToListAsync();

            var mappedevents = events.AsQueryable().ProjectTo <EventResponse>(mapper.ConfigurationProvider);
            var sortedevents = sortHelper.ApplySort(mappedevents, eventParameters.OrderBy);
            var shapedevents = dataShaper.ShapeData(sortedevents, eventParameters.Fields);

            return(await PagedList <Entity> .ToPagedList(shapedevents, eventParameters.PageNumber, eventParameters.PageSize));
        }
Exemplo n.º 44
0
        private void OnSelectedOrdersChanged(EventParameters <OrderViewModel> obj)
        {
            if (obj.Topic == EventTopicNames.SelectedOrdersChanged)
            {
                if (!obj.Value.Selected && !_ticketService.CanDeselectOrder(obj.Value.Model))
                {
                    obj.Value.ToggleSelection();
                    return;
                }

                if (ClearSelection)
                {
                    ClearSelection = false;
                    if (obj.Value != LastSelectedOrder)
                    {
                        ClearSelectedItems();
                        obj.Value.ToggleSelection();
                        return;
                    }
                }

                LastSelectedOrder = obj.Value.Selected ? obj.Value : null;
                if (!SelectedOrders.Any())
                {
                    LastSelectedOrder = null;
                }
                _ticketOrdersViewModel.UpdateLastSelectedOrder(LastSelectedOrder);

                RefreshSelectedItems();

                if (_applicationState.IsLandscape)
                {
                    var so = new SelectedOrdersData {
                        SelectedOrders = SelectedOrders, Ticket = SelectedTicket
                    };
                    OperationRequest <SelectedOrdersData> .Publish(so, EventTopicNames.DisplayTicketOrderDetails, EventTopicNames.ActivatePosView, "");
                }
            }
        }
Exemplo n.º 45
0
 /// <summary>Initializes a blank briefing</summary>
 public Briefing()
 {               //initialize
     _eventParameters = new EventParameters();
     _platform        = MissionFile.Platform.XWA;
     Length           = 0x465;           // default to 45 seconds
     _events          = new short[0x2200];
     _briefingTags    = new string[0x80];
     _briefingStrings = new string[0x80];
     for (int i = 0; i < 0x80; i++)
     {
         _briefingTags[i]    = "";
         _briefingStrings[i] = "";
         _stringsNotes[i]    = "";
     }
     _events[1] = (short)EventType.MoveMap;
     _events[5] = (short)EventType.ZoomMap;
     _events[6] = 0x30;
     _events[7] = 0x30;
     _events[8] = 9999;
     _events[9] = (short)EventType.EndBriefing;
     _team[0]   = true;
 }
Exemplo n.º 46
0
 private void OnResourceSelectedForTicket(EventParameters <EntityOperationRequest <Resource> > eventParameters)
 {
     if (eventParameters.Topic == EventTopicNames.ResourceSelected)
     {
         if (SelectedTicket != null)
         {
             _ticketService.UpdateResource(SelectedTicket, eventParameters.Value.SelectedEntity);
             if (_applicationState.SelectedResourceScreen != null && SelectedTicket.Orders.Count > 0 && eventParameters.Value.SelectedEntity.Id > 0 && eventParameters.Value.SelectedEntity.ResourceTypeId == _applicationState.SelectedResourceScreen.ResourceTypeId)
             {
                 CloseTicket();
             }
             else
             {
                 DisplaySingleTicket();
             }
         }
         else
         {
             var openTickets = _ticketService.GetOpenTicketIds(eventParameters.Value.SelectedEntity.Id).ToList();
             if (!openTickets.Any())
             {
                 OpenTicket(0);
                 _ticketService.UpdateResource(SelectedTicket, eventParameters.Value.SelectedEntity);
             }
             else if (openTickets.Count > 1)
             {
                 _lastSelectedResource = eventParameters.Value.SelectedEntity;
                 _ticketListViewModel.UpdateListByResource(eventParameters.Value.SelectedEntity);
                 DisplayTicketList();
                 return;
             }
             else
             {
                 OpenTicket(openTickets.ElementAt(0));
             }
             EventServiceFactory.EventService.PublishEvent(EventTopicNames.ActivatePosView);
         }
     }
 }
Exemplo n.º 47
0
        private static void OnCommandAdded(EventParameters <ICategoryCommand> result)
        {
            if (result.Topic == EventTopicNames.NavigationCommandAdded)
            {
                NavigationCommandCategories.Add(result.Value);
            }

            if (result.Topic == EventTopicNames.DashboardCommandAdded)
            {
                var cat = DashboardCommandCategories.FirstOrDefault(item => item.Category == result.Value.Category);
                if (cat == null)
                {
                    cat = new DashboardCommandCategory(result.Value.Category);
                    DashboardCommandCategories.Add(cat);
                }
                if (result.Value.Order > cat.Order)
                {
                    cat.Order = result.Value.Order;
                }
                cat.AddCommand(result.Value);
            }
        }
Exemplo n.º 48
0
 private void OnProcessCreditCard(EventParameters <CreditCardProcessingResult> obj)
 {
     if (obj.Topic == EventTopicNames.PaymentProcessed && AppServices.ActiveAppScreen == AppScreens.Payment)
     {
         if (obj.Value.ProcessType == ProcessType.Force)
         {
             SelectedTicket = null;
             Prepare();
             Debug.Assert(SelectedTicket != null);
             PaymentAmount  = SelectedTicket.Model.GetRemainingAmount().ToString("#,#0.00");
             TenderedAmount = obj.Value.Amount.ToString("#,#0.00");
             ProcessPayment(PaymentType.CreditCard);
         }
         if (obj.Value.ProcessType == ProcessType.PreAuth)
         {
             ClosePaymentScreen();
         }
         if (obj.Value.ProcessType == ProcessType.Cancel)
         {
             AppServices.MainDataContext.SelectedTicket.PublishEvent(EventTopicNames.MakePayment);
         }
     }
 }
        private void OnDepartmentChanged(EventParameters <Department> department)
        {
            if (department.Topic == EventTopicNames.SelectedDepartmentChanged)
            {
                _currentScreenMenu = department.Value != null
                    ? _cacheService.GetScreenMenu(department.Value.ScreenMenuId)
                    : null;

                Categories            = CreateCategoryButtons(_currentScreenMenu);
                MostUsedItemsCategory = null;
                MostUsedMenuItems     = CreateMostUsedMenuItems(_currentScreenMenu);

                if (Categories != null && Categories.Count == 1)
                {
                    OnCategoryCommandExecute(Categories[0].Category);
                    Categories.Clear();
                }
                RaisePropertyChanged(() => Categories);
                RaisePropertyChanged(() => CategoriesVerticalAlignment);
                RaisePropertyChanged(() => MostUsedMenuItems);
                RaisePropertyChanged(() => MostUsedItemsCategory);
            }
        }
Exemplo n.º 50
0
        internal EventLoggerEventArgs(ref EventParameters pEventParams)
        {
            EventType = pEventParams.EventType;
            switch (pEventParams.EventType)
            {
            case EventType.ApplicationModeSwitched:
                Modes = (pEventParams.Modes);
                break;

            case EventType.CommandExecuted:
            case EventType.TooltipShown:
            case EventType.TabActivated:
            case EventType.MenuOpened:
                CopyAndMarshal(ref pEventParams);
                break;

            case EventType.ApplicationMenuOpened:
            case EventType.RibbonExpanded:
            case EventType.RibbonMinimized:
            default:
                break;
            }
        }
Exemplo n.º 51
0
        private void OnOrderTagEvent(EventParameters <OrderTagData> obj)
        {
            if (obj.Topic == EventTopicNames.OrderTagSelected)
            {
                _ticketOrdersViewModel.FixSelectedItems();
                _ticketService.TagOrders(_ticketOrdersViewModel.SelectedOrderModels, obj.Value.OrderTagGroup, obj.Value.SelectedOrderTag);
                _ticketOrdersViewModel.RefreshSelectedOrders();
                if (!string.IsNullOrEmpty(obj.Value.OrderTagGroup.ButtonHeader) && obj.Value.OrderTagGroup.MaxSelectedItems == 1)
                {
                    ClearSelectedItems();
                }
                ClearSelection = true;
                RefreshVisuals();
            }

            if (obj.Topic == EventTopicNames.OrderTagRemoved)
            {
                _ticketService.UntagOrders(_ticketOrdersViewModel.SelectedOrderModels, obj.Value.OrderTagGroup,
                                           obj.Value.SelectedOrderTag);
                _ticketOrdersViewModel.RefreshSelectedOrders();
                RefreshVisuals();
            }
        }
Exemplo n.º 52
0
 /// <summary>Initializes a blank briefing</summary>
 public Briefing()
 {
     //initialize
     _eventParameters = new EventParameters();
     _platform = MissionFile.Platform.XWA;
     Length = 0x465;		// default to 45 seconds
     _events = new short[0x2200];
     _briefingTags = new string[0x80];
     _briefingStrings = new string[0x80];
     for (int i=0;i<0x80;i++)
     {
         _briefingTags[i] = "";
         _briefingStrings[i] = "";
         _stringsNotes[i] = "";
     }
     _events[1] = (short)EventType.MoveMap;
     _events[5] = (short)EventType.ZoomMap;
     _events[6] = 0x30;
     _events[7] = 0x30;
     _events[8] = 9999;
     _events[9] = (short)EventType.EndBriefing;
     _team[0] = true;
 }
Exemplo n.º 53
0
    public void SetPeasants(bool p_isStartBow, float p_peasantIntervals, int p_totalTouchGoal, int p_touchesToBow)
    {
        s_touchCounter = 0;

        m_isStartBow       = p_isStartBow;
        m_peasantIntervals = p_peasantIntervals;
        s_touchGoal        = p_totalTouchGoal;
        m_touchesToBow     = p_touchesToBow;

        m_aPeasantObjs       = new GameObject[m_numOfPeasants];
        m_aPeasantScripts    = new Peasant[m_numOfPeasants];
        m_aPeasantsStartTime = new float[m_numOfPeasants];

        EventParameters param = new EventParameters();

        param.addParam(EventNames.CURRENT_SCORE, PeasantManager.s_touchCounter);
        param.addParam(EventNames.CURRENT_GOAL, PeasantManager.s_touchGoal);
        EventBroadcaster.Instance.notifyObservers(EventNames.ON_SCORE_CHANGED, param);

        InitPeasantsStartTime(m_peasantIntervals);
        RandPeasantsStartTime();
        SetupPeasants();
    }
Exemplo n.º 54
0
        private void OnTicketViewModelEvent(EventParameters <TicketViewModel> obj)
        {
            if (obj.Topic == EventTopicNames.SelectedItemsChanged)
            {
                if (SelectedTicketItemsViewModel.ShouldDisplay(obj.Value))
                {
                    DisplayTicketDetailsScreen();
                }
                else
                {
                    DisplayCategoriesScreen();
                }
            }

            if (obj.Topic == EventTopicNames.SelectVoidReason ||
                obj.Topic == EventTopicNames.SelectGiftReason ||
                obj.Topic == EventTopicNames.SelectExtraProperty ||
                obj.Topic == EventTopicNames.SelectTicketTag ||
                obj.Topic == EventTopicNames.EditTicketNote)
            {
                DisplayTicketDetailsScreen();
            }
        }
Exemplo n.º 55
0
 private void OnWorkperiodStatusChanged(EventParameters <WorkPeriod> obj)
 {
     if (obj.Topic != EventTopicNames.WorkPeriodStatusChanged)
     {
         return;
     }
     using (var ws = WorkspaceFactory.Create())
     {
         if (ws.Count <Recipe>() <= 0)
         {
             return;
         }
         if (!_applicationState.IsCurrentWorkPeriodOpen)
         {
             var pc = GetCurrentPeriodicConsumption(ws);
             if (pc.Id == 0)
             {
                 ws.Add(pc);
             }
             ws.CommitChanges();
         }
         else
         {
             if (_applicationState.PreviousWorkPeriod == null)
             {
                 return;
             }
             var pc = GetPreviousPeriodicConsumption(ws);
             if (pc == null)
             {
                 return;
             }
             CalculateCost(pc, _applicationState.PreviousWorkPeriod);
             ws.CommitChanges();
         }
     }
 }
Exemplo n.º 56
0
        private void OnTicketEvent(EventParameters <EventAggregator> obj)
        {
            switch (obj.Topic)
            {
            case EventTopicNames.CreateTicket:
                CreateTicket();
                EventServiceFactory.EventService.PublishEvent(EventTopicNames.RefreshSelectedTicket);
                break;

            case EventTopicNames.ActivatePosView:
                if (SelectedTicket == null || _ticketService.CanDeselectOrders(SelectedTicket.SelectedOrders))
                {
                    DisplayTickets();
                    DisplayMenuScreen();
                    _ticketViewModel.ResetTicket();
                }
                break;

            case EventTopicNames.RegenerateSelectedTicket:
                if (SelectedTicket != null)
                {
                    _ticketViewModel.ResetTicket();
                    DisplaySingleTicket();
                }
                break;

            case EventTopicNames.RefreshSelectedTicket:
                DisplayMenuScreen();
                DisplaySingleTicket();
                break;

            case EventTopicNames.CloseTicketRequested:
                DisplayMenuScreen();
                CloseTicket();
                break;
            }
        }
Exemplo n.º 57
0
        /// <summary>Initializes a blank Briefing</summary>
        public Briefing()
        {           //initialize
            MaxCoordSet = 2;
            Pages       = new List <BriefingPage>
            {
                new BriefingPage()
            };
            Pages[0].SetDefaultFirstPage();

            WindowSettings = new List <BriefingUIPage>();
            ResetUISettings(2);

            _eventParameters = new EventParameters();
            _platform        = MissionFile.Platform.Xwing;
            _events          = new short[0x190];
            Length           = 0x21C;   //default 45 seconds
            _briefingTags    = new string[0x20];
            _briefingStrings = new string[0x20];
            for (int i = 0; i < 0x20; i++)
            {
                _briefingTags[i]    = "";
                _briefingStrings[i] = "";
            }
        }
Exemplo n.º 58
0
        private void OnSelectedOrdersChanged(EventParameters <OrderViewModel> obj)
        {
            if (obj.Topic == EventTopicNames.SelectedOrdersChanged)
            {
                if (!obj.Value.Selected && !_ticketService.CanDeselectOrder(obj.Value.Model))
                {
                    obj.Value.ToggleSelection();
                    return;
                }

                if (ClearSelection)
                {
                    ClearSelection = false;
                    if (obj.Value != LastSelectedOrder)
                    {
                        ClearSelectedItems();
                        obj.Value.ToggleSelection();
                        return;
                    }
                }

                LastSelectedOrder = obj.Value.Selected ? obj.Value : null;
                if (!SelectedOrders.Any())
                {
                    LastSelectedOrder = null;
                }
                _ticketOrdersViewModel.UpdateLastSelectedOrder(LastSelectedOrder);

                RefreshSelectedItems();

                var so = new SelectedOrdersData {
                    SelectedOrders = SelectedOrders, Ticket = SelectedTicket
                };
                so.PublishEvent(EventTopicNames.SelectedOrdersChanged);
            }
        }
Exemplo n.º 59
0
 private void OnAccountDataEvent(EventParameters<OperationRequest<AccountData>> ep)
 {
     switch (ep.Topic)
     {
         case EventTopicNames.DisplayAccountTransactions: ActivateAccountTransactions(); break;
         case EventTopicNames.ActivateAccountSelector: ActivateAccountSelector(); break;
     }
 }
Exemplo n.º 60
0
 private void OnDocumentCreationData(EventParameters<DocumentCreationData> ep)
 {
     if (ep.Topic == EventTopicNames.AccountTransactionDocumentSelected)
     {
         ActivateDocumentCreator();
     }
 }