Beispiel #1
0
        public async override void Init(object initData)
        {
            base.Init(initData);

            Cellar        = (CellarsListModel)initData;
            ReferencePlan = new DocumentMindurry();

            IEnumerable <DocumentMindurry> docs = await StoreManager.DocumentMindurryStore.GetItemsByKindAndReferenceIdAsync(Cellar.Cellar.Id, ReferenceKind.Cellar.ToString().ToLower());

            if (docs != null && docs.Any())
            {
                IEnumerable <DocumentMindurry> referencePlanList = docs.Where(x => x.DocumentType == DocumentType.Initial.ToString().ToLower());
                if (referencePlanList != null && referencePlanList.Any())
                {
                    ReferencePlan = (referencePlanList.ToList())[0];
                }
            }
        }
        public async override void Init(object initData)
        {
            base.Init(initData);

            documentToDisplay = (DocumentMindurry)initData;

            Title = documentToDisplay.Name;
            var docDownloaded = await PclStorage.LoadFileLocal(documentToDisplay.InternalName + ".pdf", documentToDisplay.ReferenceKind, documentToDisplay.ReferenceId);

            if (docDownloaded != null)
            {
                PdfDocumentStream = new MemoryStream(docDownloaded);
                Visibility        = true;
            }
            else
            {
                Message    = "Une erreur est survenue, Merci de réessayer.";
                Visibility = false;
            }
        }