Ejemplo n.º 1
0
        public static Key ExtractKey(this Localhost localhost, Bundle.EntryComponent entry)
        {
            Uri uri     = new Uri(entry.Request.Url, UriKind.RelativeOrAbsolute);
            Key compare = ExtractKey(uri);             // This fails!! ResourceIdentity does not work in this case.

            return(localhost.LocalUriToKey(uri));
        }
        public HALResponse Index()
        {
            var listRepresentation = new RepositoyListRepresentation
            {
                Repositories =
                    RepositoryService
                    .Get
                    .Select(_ =>
                            new HALResponse(
                                new RepositoryRepresentation
                {
                    Name = _.Name
                })
                            .AddLinks(new[]
                {
                    new Link("item", Localhost.Url($"/repositories/{_.Name}"))
                })
                            )
            };

            return(new HALResponse(listRepresentation)
                   .AddLinks(new[]
            {
                new Link(Link.RelForSelf, Localhost.Url("/repositories"), "Repositories")
            }));
        }
Ejemplo n.º 3
0
        protected async System.Threading.Tasks.Task Grid0RowCreate(dynamic args)
        {
            var localhostCreateCardResult = await Localhost.CreateCard(args);

            await grid0.Reload();

            await InvokeAsync(() => { StateHasChanged(); });
        }
Ejemplo n.º 4
0
        private IEnumerable <Link> GetLinks(string repoName)
        {
            yield return(new Link(Link.RelForSelf, Localhost.Url($"/repositories/{repoName}")));

            if (this.User.Identity.IsAuthenticated)
            {
                yield return(new Link("delete", Localhost.Url($"/repositories/{repoName}"), "Delete", "DELETE"));
            }
        }
Ejemplo n.º 5
0
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        //[TestMethod]
        public void TestSearch()
        {
            IFhirModel _fhirModel = new FhirModel(ModelInfo.SearchParameters);
            ILocalhost _localhost = new Localhost(new Uri("http://localhost"));
//            MongoIndexStore _indexStore =
            //
            // TODO: Add test logic here
            //
        }
Ejemplo n.º 6
0
        protected async System.Threading.Tasks.Task Load()
        {
            var localhostGetClientsResult = await Localhost.GetClients();

            getClientsForclientIdResult = localhostGetClientsResult;

            brief = new Flashcardgenerator.Models.Localhost.Brief()
            {
            };
        }
        protected async System.Threading.Tasks.Task Load()
        {
            var localhostGetClientsResult = await Localhost.GetClients();

            getClientsResult = localhostGetClientsResult;

            var localhostGetBriefsResult = await Localhost.GetBriefs();

            getBriefsResult = localhostGetBriefsResult;
        }
Ejemplo n.º 8
0
        public static Localhost GetLocalhost()
        {
            var localhost = new Localhost();

            localhost.Add(Settings.Endpoint, _default: true);
            localhost.Add("http://hl7.org/fhir/");
            localhost.Add("localhost");
            localhost.Add("localhost.");
            return(localhost);
        }
        protected async System.Threading.Tasks.Task Load()
        {
            hasChanges = false;

            canEdit = true;

            var localhostGetClientByclientIdResult = await Localhost.GetClientByclientId(clientId);

            client = localhostGetClientByclientIdResult;
        }
Ejemplo n.º 10
0
        protected async System.Threading.Tasks.Task Load()
        {
            hasChanges = false;

            canEdit = true;

            var localhostGetCategoryBycategoryIdResult = await Localhost.GetCategoryBycategoryId(categoryId);

            category = localhostGetCategoryBycategoryIdResult;
        }
        protected async System.Threading.Tasks.Task Load()
        {
            var localhostGetBriefsResult = await Localhost.GetBriefs(new Query()
            {
                Expand = "Client,Brief($expand=Client)"
            });

            getBriefsResult = localhostGetBriefsResult;

            sentence = new Flashcardgenerator.Models.Localhost.Sentence()
            {
            };
        }
Ejemplo n.º 12
0
        protected async System.Threading.Tasks.Task Load()
        {
            var localhostGetBriefsResult = await Localhost.GetBriefs(new Query()
            {
                Expand = "Client"
            });

            getBriefs = localhostGetBriefsResult;

            Globals.selectedBriefId = 0;

            Globals.progressBarVal = 0;
        }
        protected async System.Threading.Tasks.Task Grid0RowExpand(Flashcardgenerator.Models.Localhost.Brief args)
        {
            master = args;

            var localhostGetCardsResult = await Localhost.GetCards(new Query()
            {
                Filter = $@"i => i.briefId == {args.briefId}"
            });

            if (localhostGetCardsResult != null)
            {
                args.Cards = localhostGetCardsResult.ToList();
            }
        }
        protected async System.Threading.Tasks.Task Load()
        {
            if (string.IsNullOrEmpty(search))
            {
                search = "";
            }

            var localhostGetBriefsResult = await Localhost.GetBriefs(new Query()
            {
                Filter = $@"i => i.briefType.Contains(@0) || i.opposingParty.Contains(@1)", FilterParameters = new object[] { search, search }, Expand = "Client"
            });

            getBriefsResult = localhostGetBriefsResult;
        }
        protected async System.Threading.Tasks.Task Load()
        {
            if (string.IsNullOrEmpty(search))
            {
                search = "";
            }

            var localhostGetCardsResult = await Localhost.GetCards(new Query()
            {
                Filter = $@"briefId eq ""{Globals.selectedBriefId}""", Expand = "Brief,Category,Sentence,Client"
            });

            getCardsResult = localhostGetCardsResult;
        }
Ejemplo n.º 16
0
        protected async System.Threading.Tasks.Task Load()
        {
            if (string.IsNullOrEmpty(search))
            {
                search = "";
            }

            var localhostGetClientsResult = await Localhost.GetClients(new Query()
            {
                Filter = $@"i => i.longName.Contains(@0) || i.shortName.Contains(@1)", FilterParameters = new object[] { search, search }, Expand = ""
            });

            getClientsResult = localhostGetClientsResult;
        }
Ejemplo n.º 17
0
        protected async System.Threading.Tasks.Task Load()
        {
            hasChanges = false;

            canEdit = true;

            var localhostGetBriefBybriefIdResult = await Localhost.GetBriefBybriefId(briefId);

            brief = localhostGetBriefBybriefIdResult;

            var localhostGetClientsResult = await Localhost.GetClients();

            getClientsForclientIdResult = localhostGetClientsResult;
        }
        protected async System.Threading.Tasks.Task Load()
        {
            if (string.IsNullOrEmpty(search))
            {
                search = "";
            }

            var localhostGetCategoriesResult = await Localhost.GetCategories(new Query()
            {
                Filter = $@"i => i.name.Contains(@0)", FilterParameters = new object[] { search }
            });

            getCategoriesResult = localhostGetCategoriesResult;
        }
Ejemplo n.º 19
0
        public async Task CreateSentencesFromLastUpload()
        {
            DocProcessing newDoc = new DocProcessing();

            try {
                newDoc.Process(UploadController.cGlobals.lastUploadDir);
            }
            catch (System.Exception ArgumentException)
            {
                NotificationService.Notify(new NotificationMessage()
                {
                    Severity = NotificationSeverity.Error, Summary = $"Error", Detail = $"Please upload a file."
                });
            }
            IList <string> strings = (IList <string>)Segmenter.Segment(newDoc.getAllText());

            int listCount = (strings).Count;

            int count = 0;

            try
            {
                {
                    foreach (string iter in strings)
                    {
                        Globals.progressBarVal = (int)(count);

                        Card c = new Card();
                        c.Answer = iter;

                        {
                            c.briefId = (int)Globals.selectedBriefId;
                        }
                        ;

                        await Localhost.CreateCard(c);

                        count++;
                    }
                }
            }
            catch (System.Exception ArgumentException)
            {
                NotificationService.Notify(new NotificationMessage()
                {
                    Severity = NotificationSeverity.Error, Summary = $"Error", Detail = $"Processing failed."
                });
            }
        }
Ejemplo n.º 20
0
        public HALResponse Index()
        {
            return
                (new HALResponse(null)
                 .AddLinks(new[]
            {
                new Link(Link.RelForSelf, Localhost.Url("/"), "Home"),

                new Link("repositories", Localhost.Url("/repositories"), "Repositories"),

                new Link("users", Localhost.Url("/users"), "Users"),

                new Link("settings", Localhost.Url("/settings"), "Settings"),
            }));
        }
        protected async System.Threading.Tasks.Task Form0Submit(Flashcardgenerator.Models.Localhost.Category args)
        {
            try
            {
                var localhostCreateCategoryResult = await Localhost.CreateCategory(category);

                DialogService.Close(category);
            }
            catch (System.Exception localhostCreateCategoryException)
            {
                NotificationService.Notify(new NotificationMessage()
                {
                    Severity = NotificationSeverity.Error, Summary = $"Error", Detail = $"Unable to create new Category!"
                });
            }
        }
Ejemplo n.º 22
0
        protected async System.Threading.Tasks.Task Load()
        {
            hasChanges = false;

            canEdit = true;

            var localhostGetSentenceBysentenceIdResult = await Localhost.GetSentenceBysentenceId(sentenceId);

            sentence = localhostGetSentenceBysentenceIdResult;

            var localhostGetBriefsResult = await Localhost.GetBriefs(new Query()
            {
                Expand = "Client"
            });

            getBriefsForbriefIdResult = localhostGetBriefsResult;
        }
Ejemplo n.º 23
0
        protected async System.Threading.Tasks.Task Load()
        {
            var localhostGetBriefsResult = await Localhost.GetBriefs();

            getBriefsForbriefIdResult = localhostGetBriefsResult;

            var localhostGetCategoriesResult = await Localhost.GetCategories();

            getCategoriesForcategoryIdResult = localhostGetCategoriesResult;

            var localhostGetSentencesResult = await Localhost.GetSentences();

            getSentencesForsentenceIdResult = localhostGetSentencesResult;

            card = new Flashcardgenerator.Models.Localhost.Card()
            {
            };
        }
        protected async System.Threading.Tasks.Task Form0Submit(Flashcardgenerator.Models.Localhost.Client args)
        {
            try
            {
                var localhostUpdateClientResult = await Localhost.UpdateClient(clientId, client);

                DialogService.Close(client);
            }
            catch (System.Exception localhostUpdateClientException)
            {
                NotificationService.Notify(new NotificationMessage()
                {
                    Severity = NotificationSeverity.Error, Summary = $"Error", Detail = $"Unable to update Client"
                });

                hasChanges = localhostUpdateClientException is DbUpdateConcurrencyException;
            }
        }
Ejemplo n.º 25
0
        protected async System.Threading.Tasks.Task Splitbutton0Click(RadzenSplitButtonItem args)
        {
            if (args?.Value == "csv")
            {
                await Localhost.ExportClientsToCSV(new Query()
                {
                    Filter = $@"{grid0.Query.Filter}", OrderBy = $"{grid0.Query.OrderBy}", Expand = "", Select = "clientId,isCurrent,longName,shortName"
                }, $"Clients");
            }

            if (args == null || args.Value == "xlsx")
            {
                await Localhost.ExportClientsToExcel(new Query()
                {
                    Filter = $@"{grid0.Query.Filter}", OrderBy = $"{grid0.Query.OrderBy}", Expand = "", Select = "clientId,isCurrent,longName,shortName"
                }, $"Clients");
            }
        }
        protected async System.Threading.Tasks.Task Splitbutton0Click(RadzenSplitButtonItem args)
        {
            if (args?.Value == "csv")
            {
                await Localhost.ExportSentencesToCSV(new Query()
                {
                    Filter = $@"{grid0.Query.Filter}", OrderBy = $"{grid0.Query.OrderBy}", Expand = "Brief", Select = "Brief.briefType,content,sentenceId,verified"
                }, $"Sentences");
            }

            if (args == null || args.Value == "xlsx")
            {
                await Localhost.ExportSentencesToExcel(new Query()
                {
                    Filter = $@"{grid0.Query.Filter}", OrderBy = $"{grid0.Query.OrderBy}", Expand = "Brief", Select = "Brief.briefType,content,sentenceId,verified"
                }, $"Sentences");
            }
        }
        protected async System.Threading.Tasks.Task Splitbutton0Click(RadzenSplitButtonItem args)
        {
            if (args?.Value == "csv")
            {
                await Localhost.ExportCardsToCSV(new Query()
                {
                    Filter = $@"{grid0.Query.Filter}", OrderBy = $"{grid0.Query.OrderBy}", Expand = "Brief,Category,Sentence", Select = "Answer,Brief.briefType,cardId,Category.name,Question,Sentence.content,Verified"
                }, $"Cards");
            }

            if (args == null || args.Value == "xlsx")
            {
                await Localhost.ExportCardsToExcel(new Query()
                {
                    Filter = $@"{grid0.Query.Filter}", OrderBy = $"{grid0.Query.OrderBy}", Expand = "Brief,Category,Sentence", Select = "Answer,Brief.briefType,cardId,Category.name,Question,Sentence.content,Verified"
                }, $"Cards");
            }
        }
        protected async System.Threading.Tasks.Task Splitbutton0Click(RadzenSplitButtonItem args)
        {
            if (args?.Value == "csv")
            {
                await Localhost.ExportBriefsToCSV(new Query()
                {
                    Filter = $@"{grid0.Query.Filter}", OrderBy = $"{grid0.Query.OrderBy}", Expand = "Client", Select = "briefId,briefType,Client.longName,isTestBrief,opposingParty"
                }, $"Brief 2");
            }

            if (args == null || args.Value == "xlsx")
            {
                await Localhost.ExportBriefsToExcel(new Query()
                {
                    Filter = $@"{grid0.Query.Filter}", OrderBy = $"{grid0.Query.OrderBy}", Expand = "Client", Select = "briefId,briefType,Client.longName,isTestBrief,opposingParty"
                }, $"Brief 2");
            }
        }
Ejemplo n.º 29
0
        protected async System.Threading.Tasks.Task Load()
        {
            hasChanges = false;

            canEdit = true;

            var localhostGetCardBycardIdResult = await Localhost.GetCardBycardId(cardId);

            card = localhostGetCardBycardIdResult;

            var localhostGetBriefsResult = await Localhost.GetBriefs();

            getBriefsForbriefIdResult = localhostGetBriefsResult;

            var localhostGetCategoriesResult = await Localhost.GetCategories();

            getCategoriesForcategoryIdResult = localhostGetCategoriesResult;

            var localhostGetSentencesResult = await Localhost.GetSentences();

            getSentencesForsentenceIdResult = localhostGetSentencesResult;
        }
Ejemplo n.º 30
0
        protected async System.Threading.Tasks.Task GridDeleteButtonClick(MouseEventArgs args, dynamic data)
        {
            try
            {
                if (await DialogService.Confirm("Are you sure you want to delete this record?") == true)
                {
                    var localhostDeleteClientResult = await Localhost.DeleteClient(data.clientId);

                    if (localhostDeleteClientResult != null)
                    {
                        await grid0.Reload();
                    }
                }
            }
            catch (System.Exception localhostDeleteClientException)
            {
                NotificationService.Notify(new NotificationMessage()
                {
                    Severity = NotificationSeverity.Error, Summary = $"Error", Detail = $"Unable to delete Client"
                });
            }
        }