public BindingList <TestForGrid> LoadTestsToCheckBox(BindingList <TestForGrid> testsFromGrid) { var dtoTest = new DtoTest1() { Code = string.Empty, Name = string.Empty }; var tests = new TestServiceClient().FindTests(dtoTest); var query = from testForCheckBox in testsFromGrid join test in tests on testForCheckBox.Code equals test.Code select new TestForGrid() { Code = test.Code, Name = test.Name, ConcreteCode = testForCheckBox.ConcreteCode }; var testsForCheckBox = new BindingList <TestForGrid>(); foreach (var testForGrid in query) { testsForCheckBox.Add(testForGrid); } return(testsForCheckBox); }
public string EditTest(string code, string name, string cost, string specimenCode, string sexes, bool isEdit) { if (Validation.Instance.ValidateCode(code) && !string.IsNullOrEmpty(sexes)) { double newTestEditCost; if (double.TryParse(cost, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out newTestEditCost)) { var dtoTest = new DtoTest() { Code = code, Name = name, Cost = newTestEditCost, DefaultSpecimen = new TestService.DtoSpecimen() { Code = specimenCode }, IsEdit = isEdit }; return(TestService.EditTest(dtoTest)); } else { return("Error Cost Value!"); } } else { return("Fill all mandatory fields"); } }
public string EditTest(string code, string name, string cost, string specimenCode, string sexes, bool isEdit) { if (Validation.Instance.ValidateCode(code) && !string.IsNullOrEmpty(sexes)) { double newTestEditCost; if (double.TryParse(cost, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out newTestEditCost)) { var dtoTest = new DtoTest() { Code = code, Name = name, Cost = newTestEditCost, DefaultSpecimen = new TestService.DtoSpecimen() { Code = specimenCode }, IsEdit = isEdit }; return TestService.EditTest(dtoTest); } else { return "Error Cost Value!"; } } else { return "Fill all mandatory fields"; } }
public BindingList<TestForGrid> LoadTestsToCheckBox(BindingList<TestForGrid> testsFromGrid) { var dtoTest = new DtoTest1() { Code = string.Empty, Name = string.Empty }; var tests = new TestServiceClient().FindTests(dtoTest); var query = from testForCheckBox in testsFromGrid join test in tests on testForCheckBox.Code equals test.Code select new TestForGrid() { Code = test.Code, Name = test.Name, ConcreteCode =testForCheckBox.ConcreteCode }; var testsForCheckBox = new BindingList<TestForGrid>(); foreach (var testForGrid in query) { testsForCheckBox.Add(testForGrid); } return testsForCheckBox; }