예제 #1
0
        protected override void InitSearchCondition(AggregatedConditionDto cond)
        {
            var dates = new List <DateTime>();

            foreach (var item in cond.ConditionItems)
            {
                switch (item.FieldName)
                {
                case "strBarcode":
                    AliquotBarcode = item.FieldValue;
                    break;


                case "datCreationDate":
                    if (DateTime.TryParse(item.FieldValue, out var date))
                    {
                        dates.Add(date);
                    }

                    break;

                case "idfsCFormTemplateID":
                    Template = Templates?.FirstOrDefault(t => t.Id == item.FieldValue);
                    break;
                }
            }

            if (dates.Count > 0)
            {
                StartDate = dates.Min();
                EndDate   = dates.Max();
            }

            StateHasChanged();
        }
예제 #2
0
        protected override void InitSearchCondition(AggregatedConditionDto cond)
        {
            var dates = new List <DateTime>();

            foreach (var item in cond.ConditionItems)
            {
                switch (item.FieldName)
                {
                case "strSourceBarcode":
                    SourceBarcode = item.FieldValue;
                    break;

                case "datCreationDate":
                    if (DateTime.TryParse(item.FieldValue, out var date))
                    {
                        dates.Add(date);
                    }

                    break;

                case "idfsCFormTemplateID":
                    Template = Templates?.FirstOrDefault(t => t.Id == item.FieldValue);
                    break;

                case "strNote":
                    SourceNotes = item.FieldValue;
                    break;

                case "strMaterialBarcode":
                    MaterialBarcode = item.FieldValue;
                    break;

                case "strContainerBarcode":
                    AliquotBarcode = item.FieldValue;
                    break;

                case "idfsTestStatus":
                    TestStatus = _testStatuses?.FirstOrDefault(t => t.Id == item.FieldValue);
                    break;

                case "idfsTestTypeId":
                    TestType = _testTypes?.FirstOrDefault(t => t.Id == item.FieldValue);
                    break;

                case "idfsTestResultId":
                    TestResult = _testResults?.FirstOrDefault(t => t.Id == item.FieldValue);
                    break;
                }
            }

            if (dates.Count > 0)
            {
                StartDate = dates.Min();
                EndDate   = dates.Max();
                //  SourceBarcode = cond.Serialize();
            }

            StateHasChanged();
        }
예제 #3
0
        public void GetAliquotsRecordCountTest()
        {
            var condition = new AggregatedConditionDto();
            var count     = _service.GetAliquotsRecordCount(condition).Result;

            Assert.IsTrue(count > 0);

            Console.WriteLine($"Total Aliquots: {count}");
            Assert.Pass();
        }
예제 #4
0
        public void GetTestsTest()
        {
            var condition = new AggregatedConditionDto();
            var items     = _service.GetTests(condition).Result.ToList();

            Assert.IsNotEmpty(items);

            Console.WriteLine(items[0]);
            Assert.Pass();
        }
예제 #5
0
        private TestCatalogDto GetTest()
        {
            var condition = new AggregatedConditionDto {
                PageSize = 1
            };
            var items = _catalogService.GetTests(condition).Result.ToList();

            Assert.IsNotEmpty(items);
            var test = items[0];

            Console.WriteLine($"Found Test {test.TestBarcode} with ID {test.TestId}");
            return(test);
        }
예제 #6
0
        private AliquotCatalogDto GetAliquot()
        {
            var condition = new AggregatedConditionDto {
                PageSize = 1
            };
            var items = _catalogService.GetAliquots(condition).Result.ToList();

            Assert.IsNotEmpty(items);
            var aliquot = items[0];

            Console.WriteLine($"Found Aliquot {aliquot.AliquotBarcode} with ID {aliquot.AliquotId}");
            return(aliquot);
        }
예제 #7
0
        protected override async Task DoSearch()
        {
            var cond = new AggregatedConditionDto();

            cond.AddStandardConditionIfNotEmpty("strBarcode", AliquotBarcode, Operators.LikeOperator);

            cond.AddStandardConditionIfNotEmpty("datCreationDate", StartDateText, Operators.MoreOperator);
            cond.AddStandardConditionIfNotEmpty("datCreationDate", EndDateText, Operators.LessOperator);

            cond.AddStandardConditionIfNotEmpty("idfsCFormTemplateID", Template?.Id, Operators.EqualsOperator);
            //todo: implement the rest

            await InvokeAsync(() => OnSearch?.Invoke(cond));
        }
예제 #8
0
        private MaterialCatalogDto GetMaterial()
        {
            var condition = new AggregatedConditionDto {
                PageSize = 1
            };

            condition.AddStandardConditionIfNotEmpty("idfsTestStatus", "ttsInProgress", Operators.EqualsOperator);
            var items = _catalogService.GetMaterials(condition).Result.ToList();

            Assert.IsNotEmpty(items);
            var material = items[0];

            Console.WriteLine($"Found Material {material.MaterialBarcode} with ID {material.MaterialId}");
            return(material);
        }
예제 #9
0
        private SourceCatalogDto GetSourceWithMaterial()
        {
            var condition = new AggregatedConditionDto {
                PageSize = 1
            };

            condition.AddStandardConditionIfNotEmpty("strMaterialBarcode", "m", Operators.LikeOperator);
            var items = _catalogService.GetSources(condition).Result.ToList();

            Assert.IsNotEmpty(items);
            var source = items[0];

            Console.WriteLine($"Found source {source.SourceBarcode} with ID {source.SourceId}");
            return(source);
        }
예제 #10
0
        private async Task <int> GetCatalogRecordCount(AggregatedConditionDto condition, string spName)
        {
            using (var connection = new SqlConnection(ConnectionString))
            {
                var xml = condition.Serialize();

                var result = await connection.ExecuteScalarAsync <int>(spName,
                                                                       new
                {
                    SearchConditionXml = xml,
                    LanguageID         = condition.Language
                },
                                                                       commandType : CommandType.StoredProcedure);

                return(result);
            }
        }
예제 #11
0
        private async Task <IEnumerable <T> > GetCatalogItems <T>(AggregatedConditionDto condition, string spName)
        {
            var xml = condition.Serialize();

            using (var connection = new SqlConnection(ConnectionString))
            {
                var result = await connection.QueryAsync <T>(spName,
                                                             new
                {
                    SearchConditionXml = xml,
                    LanguageID         = condition.Language,
                    intStart           = condition.PageNumber * condition.PageSize,
                    intCount           = condition.PageSize
                },
                                                             commandType : CommandType.StoredProcedure);

                return(result);
            }
        }
예제 #12
0
        protected override async Task DoSearch()
        {
            var cond = new AggregatedConditionDto();

            cond.AddStandardConditionIfNotEmpty("strSourceBarcode", SourceBarcode, Operators.LikeOperator);

            cond.AddStandardConditionIfNotEmpty("strContainerNumber", AliquotBarcode, Operators.LikeOperator);

            cond.AddStandardConditionIfNotEmpty("strBarcode", MaterialBarcode, Operators.LikeOperator);

            cond.AddStandardConditionIfNotEmpty("datCreationDate", StartDateText, Operators.MoreOperator);
            cond.AddStandardConditionIfNotEmpty("datCreationDate", EndDateText, Operators.LessOperator);

            cond.AddStandardConditionIfNotEmpty("idfsCFormTemplateID", Template?.Id, Operators.EqualsOperator);

            cond.AddStandardConditionIfNotEmpty("strNote", MaterialNotes, Operators.LikeOperator);

            //todo: implement the rest
            //    cond.AddStandardConditionIfNotEmpty("strContainerBarcode", "AliquotBarcode",AliquotBarcode, Operators.LikeOperator);
            //  cond.AddStandardConditionIfNotEmpty("idfOwner", "Owner", cbOwner.EditValue,Operators.EqualsOperator);

            await InvokeAsync(() => OnSearch?.Invoke(cond));
        }
예제 #13
0
        protected override async Task DoSearch()
        {
            var cond = new AggregatedConditionDto();

            cond.AddStandardConditionIfNotEmpty("strSourceBarcode", SourceBarcode, Operators.LikeOperator);

            cond.AddStandardConditionIfNotEmpty("datCreationDate", StartDateText, Operators.MoreOperator);
            cond.AddStandardConditionIfNotEmpty("datCreationDate", EndDateText, Operators.LessOperator);

            cond.AddStandardConditionIfNotEmpty("idfsCFormTemplateID", Template?.Id, Operators.EqualsOperator);

            cond.AddStandardConditionIfNotEmpty("strNote", SourceNotes, Operators.LikeOperator);

            cond.AddStandardConditionIfNotEmpty("strMaterialBarcode", MaterialBarcode, Operators.LikeOperator);

            cond.AddStandardConditionIfNotEmpty("strContainerBarcode", AliquotBarcode, Operators.LikeOperator);

            cond.AddStandardConditionIfNotEmpty("idfsTestStatus", TestStatus?.Id, Operators.EqualsOperator);
            cond.AddStandardConditionIfNotEmpty("idfsTestTypeId", TestType?.Id, Operators.EqualsOperator);
            cond.AddStandardConditionIfNotEmpty("idfsTestResultId", TestResult?.Id, Operators.EqualsOperator);


            await InvokeAsync(() => OnSearch?.Invoke(cond));
        }
예제 #14
0
 public async Task <IEnumerable <AliquotCatalogDto> > GetAliquots(AggregatedConditionDto condition)
 {
     return(await GetCatalogItems <AliquotCatalogDto>(condition, "dbo.spVial_QS"));
 }
예제 #15
0
 public async Task <IEnumerable <MaterialCatalogDto> > GetMaterials(AggregatedConditionDto condition)
 {
     return(await GetCatalogItems <MaterialCatalogDto>(condition, "dbo.spStrain_QS"));
 }
예제 #16
0
 public async Task <IEnumerable <TestCatalogDto> > GetTests([FromBody] AggregatedConditionDto condition)
 {
     return(await _dbService.GetTests(condition));
 }
예제 #17
0
 public void SetSearchPanelCondition(AggregatedConditionDto cond)
 {
     _lastSearchPanelCondition = cond;
 }
예제 #18
0
 public async Task <int> GetTestsRecordCount(AggregatedConditionDto condition)
 {
     return(await GetCatalogRecordCount(condition, "dbo.spTest_QS_RecordsCount"));
 }
예제 #19
0
 public async Task <int> GetMaterialsRecordCount(AggregatedConditionDto condition)
 {
     return(await GetCatalogRecordCount(condition, "dbo.spStrain_QS_RecordCount"));
 }
예제 #20
0
 public async Task <IEnumerable <SourceCatalogDto> > GetSources([FromBody] AggregatedConditionDto condition)
 {
     _logger.LogInformation("test");
     return(await _dbService.GetSources(condition));
 }
예제 #21
0
 public async Task <IEnumerable <TestCatalogDto> > GetTests(AggregatedConditionDto condition)
 {
     return(await GetCatalogItems <TestCatalogDto>(condition, "dbo.spTest_QS"));
 }
예제 #22
0
 public async Task <int> GetTestsRecordCount([FromBody] AggregatedConditionDto condition)
 {
     return(await _dbService.GetTestsRecordCount(condition));
 }
예제 #23
0
 public async Task <IEnumerable <SourceCatalogDto> > GetSources(AggregatedConditionDto condition)
 {
     return(await GetCatalogItems <SourceCatalogDto>(condition, "dbo.spSource_QS"));
 }