public void RoyalFlush()
        {
            int TotalLabel = networkmain.FLTrackingdoc.GetElementsByTagName("ID").Count;

            if (TotalLabel == 0) //if nothing in All Labels array
            {
                MessageBox.Show("Nothing to remove.", "The Royal Flush");
            }
            else
            {
                MessageBoxResult sureanot = System.Windows.MessageBox.Show(
                    "Are you sure you want to remove all Labels?", "The Royal Flush", System.Windows.MessageBoxButton.YesNo);
                if (sureanot == MessageBoxResult.Yes)
                {
                    int flushcount = 1; //to number each FL in log
                    for (int i = 0; i < TotalLabel; i++)
                    {
                        XmlNodeList MyLabelList = networkmain.FLTrackingdoc.GetElementsByTagName("ID");
                        string      XmlFlname   = MyLabelList[0].InnerXml;
                        try
                        {
                            networkmain.Client_sendFG01_FG02_MOVE(XmlFlname, "FG01_FG02_MOVE,Technician Do The Royal Flush");
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.ToString());
                            throw;
                        }

                        // NEED TO SEND ACK MIDDLEWARE R997
                        try
                        {
                            string      RJCODE = "997";
                            XmlDocument doc    = new XmlDocument();
                            doc.Load(@"ConfigEvent.xml");
                            XmlNode node   = doc.SelectSingleNode(@"/EVENT/R" + RJCODE);
                            string  RJName = node.InnerText;

                            networkmain.Client_SendEventMessage("67", RJName, "BOX_ID", XmlFlname);
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.ToString());
                        }


                        networkmain.OperatorLog = flushcount.ToString() + ". " + XmlFlname + " flushed!";
                        flushcount++;
                        Thread.Sleep(10);
                    }
                    AllLabels.Clear();
                    networkmain.OperatorLog = "Royal Flush Complete! (All labels removed from server) " + DateTime.Now.ToString() + "\r\n \r\n \r\n \r\n";
                    networkmain.AllLiveLogs = "Royally Flushed! " + DateTime.Now.ToString() + "\r\n \r\n \r\n \r\n \r\n \r\n \r\n";

                    MessageBox.Show("All labels have been removed, you may run those lots again.", "Flush Complete");

                    RemoveZPLfiles();
                }
            }
        }
Example #2
0
        private void UpdateContent()
        {
            _labelsForCombobox           = new ObservableCollection <models.Label>(AllLabels.Except(ExistingLabels, new LabelComparer()));
            _labelsForListView           = ExistingLabels;
            nullItemsAdapter.ItemsSource = _labelsForCombobox;
            lview.ItemsSource            = _labelsForListView;

            _labelCollectionView = (ListCollectionView)CollectionViewSource.GetDefaultView(_labelsForCombobox);
            _labelCollectionView.SortDescriptions.Add(new SortDescription("LabelId", ListSortDirection.Ascending));
        }
Example #3
0
        private async Task SetTaskDataAsync()
        {
            IsBusy = true;

            try
            {
                var taskRequestResult = await _tasksService.GetTaskAsync(_taskId);

                if (!taskRequestResult.IsSuccess)
                {
                    ShowToast(taskRequestResult.GetFullMessage());
                    return;
                }

                var task = taskRequestResult.Result;

                _version     = task.Version;
                Title        = task.Title;
                Description  = task.Description;
                DueDate      = task.DueDate?.LocalDateTime;
                SelectedList = Lists.FirstOrDefault(l => l.Id == task.ListId);

                if (task.Labels.Any())
                {
                    var labels = AllLabels.Where(l => task.Labels.Any(tl => tl.Id == l.Id));
                    SelectedLabels = new ObservableCollection <object>(labels);
                }

                if (task.Members.Any())
                {
                    var members = AllUsers.Where(u => task.Members.Any(m => m.Id == u.Id));
                    Members = new ObservableCollection <object>(members);
                }
            }
            catch (Exception e)
            {
            }
            finally
            {
                IsBusy = false;
            }
        }
Example #4
0
        public MultiSelector <ISelectable> GetLabelSelector(int teamId)
        {
            var labels = TeamLabels[teamId];

            return(new MultiSelector <ISelectable>()
            {
                Prompt = "Labels:",
                PrimaryFieldName = "LabelId",
                RelatedFieldName = "TeamId",
                PostUrl = "/Update/TeamLabel",
                RelatedId = teamId,
                Items = AllLabels.Select(lbl => new Label()
                {
                    Id = lbl.Id,
                    Name = lbl.Name,
                    Selected = labels.Contains(lbl),
                    ForeColor = lbl.ForeColor,
                    BackColor = lbl.BackColor
                })
            });
        }