protected void Page_Load(object sender, EventArgs e) { TestTypeManager testTypeManager = new TestTypeManager(); testTypeGridview.DataSource = testTypeManager.GetAllTestTypes(); testTypeGridview.DataBind(); }
private void FillAllType() { TestTypeManager testTypeManager = new TestTypeManager(); List <TestType> testTypeList = testTypeManager.GetAllTypesList(); testTypeShowGridView.DataSource = testTypeList; testTypeShowGridView.DataBind(); }
public void LoadAllTestTypes() { TestTypeManager testTypeManager = new TestTypeManager(); List <TestType> testTypeList = testTypeManager.GetAllTestList(); GridView1.DataSource = testTypeList; GridView1.DataBind(); }
private void LoadTestTypeDropdown() { TestTypeManager testTypeManager = new TestTypeManager(); List <TestType> testTypes = testTypeManager.GetAllTestTypes(); testTypeDropDownList.DataSource = testTypes; testTypeDropDownList.DataTextField = "Name"; testTypeDropDownList.DataValueField = "Id"; testTypeDropDownList.DataBind(); }
public void LoadTestTypeDropDownList() { TestTypeManager testTypeManager = new TestTypeManager(); List <TestType> testTypeList = testTypeManager.GetAllTypesList(); testTypeSelectDropDownList.DataSource = testTypeList; testTypeSelectDropDownList.DataTextField = "Name"; testTypeSelectDropDownList.DataValueField = "Id"; testTypeSelectDropDownList.DataBind(); }
public void LoadAllTestTypes() { TestTypeManager testTypeManager = new TestTypeManager(); List <TestType> testTypes = testTypeManager.GetAllTestList(); TestTypeDropDownList.DataSource = testTypes; TestTypeDropDownList.DataTextField = "TestTypeName"; TestTypeDropDownList.DataValueField = "TestTypeId"; TestTypeDropDownList.DataBind(); TestTypeDropDownList.Items.Insert(0, "< Select >"); }
public void ITypeManagerTest() { TestTypeManager testTypeManager = new TestTypeManager(); List <ATypeRepresentation> myRoots = new List <ATypeRepresentation>(); List <ATypeRepresentation> myChildren = new List <ATypeRepresentation>(); testTypeManager.children = myChildren; testTypeManager.roots = myRoots; Assert.AreEqual(testTypeManager.children, myChildren); Assert.AreEqual(testTypeManager.roots, myRoots); }
protected void reportShowButton_Click(object sender, EventArgs e) { DateTime lowerDate = DateTime.Parse(lowerDateTextBox.Value.ToString()); DateTime upperDate = DateTime.Parse(upperDateTextBox.Value.ToString()); TestTypeManager testTypeManager = new TestTypeManager(); List <ViewTypeWithTotalTest> viewTypeWithTotalTestslList = testTypeManager.GetTypeReportByDate(lowerDate, upperDate); typeShowGridView.DataSource = viewTypeWithTotalTestslList; typeShowGridView.DataBind(); double totalAmount = 0; foreach (ViewTypeWithTotalTest viewTypeWithTotalTest in viewTypeWithTotalTestslList) { totalAmount += viewTypeWithTotalTest.TotalAmount; } totalAmountTextBox.Value = totalAmount.ToString(); }
protected void testTypeSaveButton_Click(object sender, EventArgs e) { TestTypeManager testTypeManager = new TestTypeManager(); string name = testTypeNameTextBox.Value.Trim(); if (name != "") { TestType testType = new TestType(name); if (!testTypeManager.IsTestTypeExist(testType)) { int rowAffected = testTypeManager.Save(testType); if (rowAffected > 0) { testTypeSuccessfullAlartLabel.Text = "Test testType succesfully saved."; testTypeDangerDiv.Visible = false; testTypeSuccessfullDiv.Visible = true; FillAllType(); } else { testTypeDangerAlartLabel.Text = "Test Type Name not saved!"; testTypeDangerDiv.Visible = true; testTypeSuccessfullDiv.Visible = false; } } else { testTypeDangerAlartLabel.Text = "Test Type already exist"; testTypeDangerDiv.Visible = true; testTypeSuccessfullDiv.Visible = false; } } else { testTypeDangerAlartLabel.Text = "Please, give type name."; testTypeDangerDiv.Visible = true; testTypeSuccessfullDiv.Visible = false; } }
protected void SaveButton_Click(object sender, EventArgs e) { try { if (testTypeTextBox.Text == string.Empty) { messageLabel.Text = "Please Insert TestType"; messageLabel.ForeColor = Color.Red; } else { TestType testType = new TestType(); testType.TestTypeName = testTypeTextBox.Text; TestTypeManager testTypeManager = new TestTypeManager(); if (testTypeManager.IsTestTypeExist(testType)) { messageLabel.Text = "Type Exist"; messageLabel.ForeColor = Color.Red; } else if (testTypeManager.SaveTestType(testType)) { messageLabel.Text = "Save Successfully"; messageLabel.ForeColor = Color.Green; testTypeGridview.DataSource = testTypeManager.GetAllTestTypes(); testTypeGridview.DataBind(); } } } catch (Exception exception) { messageLabel.Text = exception.Message; } }