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(); }
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(); }
public void GetAliquotsRecordCountTest() { var condition = new AggregatedConditionDto(); var count = _service.GetAliquotsRecordCount(condition).Result; Assert.IsTrue(count > 0); Console.WriteLine($"Total Aliquots: {count}"); Assert.Pass(); }
public void GetTestsTest() { var condition = new AggregatedConditionDto(); var items = _service.GetTests(condition).Result.ToList(); Assert.IsNotEmpty(items); Console.WriteLine(items[0]); Assert.Pass(); }
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); }
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); }
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)); }
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); }
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); }
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); } }
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); } }
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)); }
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)); }
public async Task <IEnumerable <AliquotCatalogDto> > GetAliquots(AggregatedConditionDto condition) { return(await GetCatalogItems <AliquotCatalogDto>(condition, "dbo.spVial_QS")); }
public async Task <IEnumerable <MaterialCatalogDto> > GetMaterials(AggregatedConditionDto condition) { return(await GetCatalogItems <MaterialCatalogDto>(condition, "dbo.spStrain_QS")); }
public async Task <IEnumerable <TestCatalogDto> > GetTests([FromBody] AggregatedConditionDto condition) { return(await _dbService.GetTests(condition)); }
public void SetSearchPanelCondition(AggregatedConditionDto cond) { _lastSearchPanelCondition = cond; }
public async Task <int> GetTestsRecordCount(AggregatedConditionDto condition) { return(await GetCatalogRecordCount(condition, "dbo.spTest_QS_RecordsCount")); }
public async Task <int> GetMaterialsRecordCount(AggregatedConditionDto condition) { return(await GetCatalogRecordCount(condition, "dbo.spStrain_QS_RecordCount")); }
public async Task <IEnumerable <SourceCatalogDto> > GetSources([FromBody] AggregatedConditionDto condition) { _logger.LogInformation("test"); return(await _dbService.GetSources(condition)); }
public async Task <IEnumerable <TestCatalogDto> > GetTests(AggregatedConditionDto condition) { return(await GetCatalogItems <TestCatalogDto>(condition, "dbo.spTest_QS")); }
public async Task <int> GetTestsRecordCount([FromBody] AggregatedConditionDto condition) { return(await _dbService.GetTestsRecordCount(condition)); }
public async Task <IEnumerable <SourceCatalogDto> > GetSources(AggregatedConditionDto condition) { return(await GetCatalogItems <SourceCatalogDto>(condition, "dbo.spSource_QS")); }