示例#1
0
        private async Task Upload(Item item)
        {
            _fileUpload.Container = "item" + item.Id;
            await _fileUpload.Upload("item" + item.Id + DateTime.Now.ToString("ddMMyyyyHHmmss"));

            await Clear();
        }
        protected async Task Upload()
        {
            if (await _fileUpload.Upload("item" + Id + DateTime.Now.ToString("ddMMyyyyHHmmss")))
            {
                await Clear();

                Telemetry.TrackEvent("ItemImageUpload");
                await _blobsComponent.RefreshBlobs();
            }
        }
        private async Task <bool> HandleReturn(ADUser stockUser)
        {
            if (_item.ItemStatus != ItemStatus.OUTSTOCK)
            {
                Telemetry.TrackEvent("InvalidIn");
                ToastService.ShowWarning("Item kan niet geretourneerd worden met status: " + _item.ItemStatus.ToString());
                return(false);
            }

            _item.ReturnToStock(stockUser);
            if (_isDefective)
            {
                _item.ItemStatus = ItemStatus.DEFECTIVE;
            }
            _item.Comment = _comment;
            try
            {
                Repository.Save(_item);
                _comment = null;
                ToastService.ShowSuccess("Item in stock geplaatst, er zijn " + _item.Product.Items.Where(i => i.ItemStatus == ItemStatus.INSTOCK).Count() + " items van dit product.");
                if (!await _fileUpload.IsEmpty())
                {
                    try
                    {
                        await _fileUpload.Upload("item" + _item?.Id, "item" + _item.Id + DateTime.Now.ToString("ddMMyyyyHHmmss"));
                    }
                    catch (Exception ex)
                    {
                        Telemetry.TrackException(ex);
                        ToastService.ShowWarning("Kon bestand niet uploaden.");
                        return(false);
                    }
                }
            } catch (Exception ex)
            {
                Telemetry.TrackException(ex);
                ToastService.ShowError("Kon item niet in stock plaatsen.");
                return(false);
            }
            return(true);
        }