Beispiel #1
0
        private async void ServiceCallback_AuthorizedEvent(DeviceModel device)
        {
            await Dispatcher.RunTaskAsync(async() =>
            {
                var d = new MessageDialog("SUCCESS");
                await d.ShowAsync();

                var list = await Proxy.GetAllEmployeesByDevice();
                foreach (var item in list)
                {
                    Employees.Add(item);
                }
            });

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                this.IsEnabled = true;
                DisableLoadingControl();

                if (device.Employee != null)
                {
                    NotificationControl.Show($"Willkommen, {device.Employee.Alias}", 3500);
                    SetCurrentEmployee(device.Employee);
                    Proxy.Device = device;
                }

                if (device.Division != null)
                {
                    SetCurrentDivision(device.Division);
                }
            });
        }
Beispiel #2
0
        private async void ButtonReload_Click(object sender, RoutedEventArgs e)
        {
            if (PlantOrder != null && DivisionComboBox.SelectedItem is DivisionModel division)
            {
                await GetElements(PlantOrder, division);

                NotificationControl.Show($"{PlantOrder.Number} - {PlantOrder.Name} - {PlantOrder.Section} wurde aktualisiert", 3500);
            }
        }
Beispiel #3
0
        private async Task GetElements(PlantOrderModel plantOrder, DivisionModel division)
        {
            PlantOrder = plantOrder;
            List <ElementModel> elements;

            var filters = await Proxy.GetFiltersAsync(plantOrder.Id, CurrentEmployee.EmployeeId);

            FilterCollection.Load(filters);

            if (division.DivisionType.DivisionType == Contracts.Domain.Core.Enums.DivisionType.Profile)
            {
                elements = await Proxy.GetElementProfiles(plantOrder.Id, division.DivisionId);

                DataGridElementView.Columns[2].Header = "Profil";
            }
            else
            {
                elements = await Proxy.GetElements();

                DataGridElementView.Columns[2].Header = "Position";
                foreach (var element in elements)
                {
                    element.Contraction = (element.Count % 2 == 0) ? "Bl" : "Fl";

                    Random rnd = new Random();
                    element.Amount = Math.Round(rnd.NextDouble() * element.Count);
                }
            }

            for (int i = 0; i < DivisionComboBox.Items.Count; i++)
            {
                if (DivisionComboBox.Items[i] is DivisionModel item)
                {
                    if (item.DivisionId == division.DivisionId)
                    {
                        DivisionComboBox.SelectedIndex = i;
                        break;
                    }
                }
            }

            PlantOrderHeaderText.Text = string.Format("{0:s} - {1:s} - {2:s} - {3:s}", plantOrder.Number, plantOrder.Name, plantOrder.Section, plantOrder.Description);
            LastRefreshText.Text      = DateTime.Now.ToString("hh:mm:ss - ddd d MMM", CultureInfo.CreateSpecificCulture("de-DE"));

            var session = new ElementViewSession()
            {
                Divison = division, PlantOder = plantOrder
            };

            if (await ElementViewSession.SaveAsync(session) == false)
            {
                NotificationControl.Show("Die aktuelle Sitzung konnte nicht gespeichert werden", 4000);
            }

            ElementCollection.Load(elements);
        }
Beispiel #4
0
        private async Task ElementAmountChanged(ElementModel element, double newAmount)
        {
            var result = await Proxy.UpdateProfileAmount(element.Id, newAmount);

            if (result > 0)
            {
                element.Amount = result;
                NotificationControl.Show($"Von '{element.Position}' sind nun '{result}' fertiggemeldet", 6000);
            }
            else
            {
                var dialog = new InfoDialog($"Der Vorgang konnte nicht ausgeführt werden.", "Information", InfoDialogType.Error);
                await dialog.ShowAsync();
            }
        }
Beispiel #5
0
        private void ShowNofificationMessage(string message, bool error = false)
        {
            if (error)
            {
                NotificationTextSuccess.Visibility = Visibility.Collapsed;
                NotificationTextFailed.Visibility  = Visibility.Visible;
            }
            else
            {
                NotificationTextFailed.Visibility  = Visibility.Collapsed;
                NotificationTextSuccess.Visibility = Visibility.Visible;
            }

            NotificationText.Text = message;
            NotificationControl.Show(3500);
        }