示例#1
0
        protected override async Task OnInitializedAsync()
        {
            Logger.LogInformation($"Now loading... /SentinelEntry/{(IsEdit()?"Edit":"Create")}");

            Title         = IsEdit() ? "Bearbeiten" : "Neu anlegen";
            PrimaryAction = IsEdit() ? "Speichern" : "Anlegen";

            AllBreakpoints = await ClinicalBreakpointService.List().ConfigureAwait(true);

            if (Id.HasValue)
            {
                var response = await SentinelEntryService.GetById(Id.Value).ConfigureAwait(true);

                LaboratoryNumber = response.LaboratoryNumber;
                if (response.CryoDate.HasValue)
                {
                    CryoBox = response.CryoBox;
                }
                SentinelEntry = response;
            }
            else
            {
                SentinelEntry = new SentinelEntryRequest();
            }

            await base.OnInitializedAsync().ConfigureAwait(true);
        }
示例#2
0
        internal async Task SubmitClick()
        {
            LastError = string.Empty;

            try
            {
                if (IsEdit())
                {
                    await SentinelEntryService.Update(SentinelEntry).ConfigureAwait(true);
                }
                else
                {
                    await SentinelEntryService.Create(SentinelEntry).ConfigureAwait(true);
                }
            }
            catch (Exception e)
            {
                Logger.LogError(e, "Storing failed");
                LastError = e.Message;
            }

            if (!SaveFailed)
            {
                await BackToList().ConfigureAwait(true);
            }
        }
示例#3
0
        protected override async Task OnInitializedAsync()
        {
            Logger.LogInformation("Now loading... /SentinelEntries/Details/{Id}", Id);

            SentinelEntry = await SentinelEntryService.GetById(Id).ConfigureAwait(true);

            await base.OnInitializedAsync().ConfigureAwait(true);
        }
示例#4
0
        protected override async Task OnInitializedAsync()
        {
            Logger.LogInformation("Now loading... /Catalog/Delete/{Id}", Id);

            SentinelEntry = Mapper.Map <SentinelEntryRequest>(await SentinelEntryService.GetById(Id).ConfigureAwait(true));

            await base.OnInitializedAsync().ConfigureAwait(true);
        }
示例#5
0
        protected async Task DownloadFile()
        {
            DownloadInProgress = true;
            var fileData = await SentinelEntryService.Export().ConfigureAwait(true);

            var fileName = $"Sentinel-Export_{DateTime.Now:yyyyMMdd}.xlsx";
            await JsRuntime.InvokeAsync <object>("saveAsFile", new object[] { fileName, fileData }).ConfigureAwait(true);

            DownloadInProgress = false;
        }
示例#6
0
        internal async Task DeleteClick()
        {
            try
            {
                await SentinelEntryService.Delete(Id).ConfigureAwait(true);

                DeleteFailed = false;
            }
            catch (Exception e)
            {
                Logger.LogError(e, "Deleting failed");
                DeleteFailed = true;
            }

            if (!DeleteFailed)
            {
                await OnCloseClick.InvokeAsync(null).ConfigureAwait(true);
            }
        }