Exemplo n.º 1
0
 public void Add(ReportItemState reportItemState, string message, string elaboration = null)
 {
     ReportItems.Add(new ReportItem
     {
         State       = reportItemState,
         Header      = message,
         Elaboration = elaboration
     });
 }
Exemplo n.º 2
0
        public ReportItem Create(string message)
        {
            var item = new ReportItem
            {
                Header = message
            };

            ReportItems.Add(item);
            return(item);
        }
Exemplo n.º 3
0
            protected override MachineState RunCode(MachineState machineState, Byte[] instructionBytes)
            {
                for (UInt32 i = 0; i < actualReportItemCount; i++)
                {
                    ReportItems.Add(new ReportItem(i, false));
                }

                machineState.InstructionPointer += (UInt32)instructionBytes.Length;

                return(machineState);
            }
Exemplo n.º 4
0
        public async void Load()
        {
            var dialogs = UserDialogs.Instance;

            dialogs.ShowLoading();
            await Task.Delay(500);

            ReportItems.Clear();
            List <ReportItem> items = ReportItemDatabase.ListReportsOrdered(DateControl.Month, DateControl.Year);

            foreach (var item in items)
            {
                ReportItems.Add(item);
            }
            dialogs.HideLoading();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Добавление контента, доступного всем, который задаётся спецификациями плагинов.
        /// </summary>
        protected void AddContentFromPlugins(List <PluginSpec> pluginSpecs)
        {
            if (pluginSpecs != null)
            {
                foreach (PluginSpec pluginSpec in pluginSpecs)
                {
                    // добавление общедоступных элементов отчётов
                    if (pluginSpec.ReportSpecs != null)
                    {
                        foreach (ReportSpec reportSpec in pluginSpec.ReportSpecs)
                        {
                            if (reportSpec.ForEveryone)
                            {
                                ReportItems.Add(new ReportItem()
                                {
                                    Text       = reportSpec.Name,
                                    Url        = reportSpec.Url,
                                    ReportSpec = reportSpec
                                });
                            }
                        }
                    }

                    // добавление общедоступных элементов окон данных
                    if (pluginSpec.DataWndSpecs != null)
                    {
                        foreach (DataWndSpec dataWndSpec in pluginSpec.DataWndSpecs)
                        {
                            if (dataWndSpec.ForEveryone)
                            {
                                DataWndItems.Add(new DataWndItem()
                                {
                                    Text        = dataWndSpec.Name,
                                    Url         = dataWndSpec.Url,
                                    DataWndSpec = dataWndSpec
                                });
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 6
0
        private async Task setItemsAsync()
        {
            IsBusy = true;
            ReportItems.Clear();
            ObservableCollection <ReportItem> allReports = null;

            try
            {
                // if select groupid, get reports referensed group
                if (!string.IsNullOrWhiteSpace(TargetGroupId))
                {
                    //allReports = await CustomFunction.Get<ObservableCollection<ReportItem>>
                    //    ($"api/values/reportsbygroup/{TargetGroupId}/{this.CurrentDate.Year}/{this.CurrentDate.Month}");
                    allReports = await ReportGroupManager.DefaultManager.GetReportsByGroup
                                     (TargetGroupId, CurrentDate.Year, CurrentDate.Month);
                }
                // default
                else
                {
                    allReports = await ReportManager.DefaultManager.GetItemsAsync(this.CurrentDate.Year, this.CurrentDate.Month);
                }
            }
            catch (Exception e)
            {
                DebugUtil.WriteLine("UserReportListViewModel > " + e.Message);
            }
            if (allReports != null)
            {
                foreach (var item in allReports)
                {
                    ReportItems.Add(item);
                }
            }

            IsBusy = false;
        }
Exemplo n.º 7
0
        /// <summary>
        /// Добавление контента, прописанного в базе конфигурации.
        /// </summary>
        protected void AddContentFromBase(UserRights userRights, Dictionary <string, UiObjSpec> uiObjSpecs,
                                          DataAccess dataAccess)
        {
            if (userRights != null && uiObjSpecs != null)
            {
                List <UiObjProps> uiObjPropsList = dataAccess.GetUiObjPropsList(
                    UiObjProps.BaseUiTypes.Report | UiObjProps.BaseUiTypes.DataWnd);

                foreach (UiObjProps uiObjProps in uiObjPropsList)
                {
                    int uiObjID = uiObjProps.UiObjID;

                    if (!uiObjProps.Hidden && userRights.GetUiObjRights(uiObjID).ViewRight)
                    {
                        uiObjSpecs.TryGetValue(uiObjProps.TypeCode, out UiObjSpec uiObjSpec);

                        if (uiObjProps.BaseUiType == UiObjProps.BaseUiTypes.Report)
                        {
                            // добавление элемента отчёта
                            ReportItem reportItem = new ReportItem()
                            {
                                UiObjID = uiObjID,
                                Text    = uiObjProps.Title,
                                Path    = uiObjProps.Path
                            };

                            if (uiObjSpec is ReportSpec reportSpec)
                            {
                                if (string.IsNullOrEmpty(reportItem.Text))
                                {
                                    reportItem.Text = reportSpec.Name;
                                }
                                reportItem.Url        = uiObjSpec.GetUrl(uiObjID);
                                reportItem.ReportSpec = reportSpec;
                            }

                            if (!string.IsNullOrEmpty(reportItem.Text))
                            {
                                ReportItems.Add(reportItem);
                                reportItemDict[uiObjID] = reportItem;
                            }
                        }
                        else if (uiObjProps.BaseUiType == UiObjProps.BaseUiTypes.DataWnd)
                        {
                            // добавление элемента окна данных
                            DataWndItem dataWndItem = new DataWndItem()
                            {
                                UiObjID = uiObjID,
                                Text    = uiObjProps.Title,
                                Path    = uiObjProps.Path
                            };

                            if (uiObjSpec is DataWndSpec dataWndSpec)
                            {
                                if (string.IsNullOrEmpty(dataWndItem.Text))
                                {
                                    dataWndItem.Text = dataWndSpec.Name;
                                }
                                dataWndItem.Url         = uiObjSpec.GetUrl(uiObjID);
                                dataWndItem.DataWndSpec = dataWndSpec;
                            }

                            if (!string.IsNullOrEmpty(dataWndItem.Text))
                            {
                                DataWndItems.Add(dataWndItem);
                                dataWndItemDict[uiObjID] = dataWndItem;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 8
0
 public void Add(ReportItem item)
 {
     ReportItems.Add(item);
 }
Exemplo n.º 9
0
        /**
         * This method handle the message send from the ok page or not ok page
         */
        public async Task HandleAsync(InspectionCompleteMessage message, CancellationToken cancellationToken)
        {
            sLogger.FeedbackMessageSended();
            UserDialogs.Instance.ShowLoading("opslaan...");
            var device = DevicesToInspect.FirstOrDefault(x => x.Equipment.EquipmentId == message.EquipmentId);

            if (device == null)
            {
                device = DevicesInspected.FirstOrDefault(x => x.Equipment.EquipmentId == message.EquipmentId);
                if (device == null)
                {
                    await UserDialogs.Instance.AlertAsync("Dit toestel is niet gevonden", "save error", "ok");

                    return;
                }
                device.Equipment.DateVisualInspection = DateTime.Now;
                if (device.Status == StatusTypes.Ok)
                {
                    DevicesOk.Remove(device);
                    device.Color  = Color.Red;
                    device.Status = StatusTypes.Not_Ok;
                    DevicesNotOk.Add(device);
                    await UpdateToDatabase(device, message.Result, message.Vera, message.Photos, message.Weight, message.FeedbackType.FeedbackTypeId, message.Remarks);
                }
                else
                {
                    DevicesNotOk.Remove(device);
                    device.Status = StatusTypes.Ok;
                    device.Color  = Color.Green;
                    DevicesOk.Add(device);
                    await UpdateToDatabase(device, message.Result, message.Vera, message.Photos, message.Weight);
                }
                Filter();
            }
            else
            {
                if (message.Result == InspectionResult.Ok)
                {
                    device.Status = StatusTypes.Ok;
                    device.Color  = Color.Green;
                    DevicesOk.Add(device);
                    await RefreshOverviewAsync(device);
                    await SaveToDatabase(device, message.Result, message.Vera, message.Photos, message.Weight);
                }
                if (message.Result == InspectionResult.NotOk)
                {
                    device.Color  = Color.Red;
                    device.Status = StatusTypes.Not_Ok;
                    DevicesNotOk.Add(device);
                    var equipmentRaportItem = new EquipmentReportItemModel();
                    equipmentRaportItem.Equipment           = device.Equipment.EquipmentLocation.Name;
                    equipmentRaportItem.LocationDescription = device.Equipment.EquipmentLocation.Description;
                    equipmentRaportItem.QRCode   = device.Equipment.EquipmentIdentifications[0].Value;
                    equipmentRaportItem.FeedBack = message.FeedbackType.Description;
                    equipmentRaportItem.Remark   = message.Remarks;
                    equipmentRaportItem.Vera     = message.Vera;
                    ReportItems.Add(equipmentRaportItem);
                    await RefreshOverviewAsync(device);
                    await SaveToDatabase(device, message.Result, message.Vera, message.Photos, message.Weight, message.FeedbackType.FeedbackTypeId, message.Remarks);
                }
            }

            UserDialogs.Instance.HideLoading();
        }