public AddorEdit(ObservableCollection <CompanyData> existingCompanies, CompanyData company, ListView list) { InitializeComponent(); this.newCompanyCollection = existingCompanies; this.newCompany = company; this.addOrEditListView = list; this.DataContext = newCompanyCollection; }
private void UpdateButton_Click(object sender, RoutedEventArgs e) { CompanyData data = newCompany; data.CompanyName = companyNameAddOrEditTxtBox.Text; data.Id = int.Parse(iDAddOrEditTxtBox.Text); data.Address = null; data.Cars = null; }
public void TestConnectionToDB() { //Arrange CompanyData cd = new CompanyData(); List <Company> companyList = new List <Company>(); //Act companyList = cd.GetAllCompanies(); //Assert Assert.IsTrue(companyList.Count > 0); }
private void SaveButton_Click(object sender, RoutedEventArgs e) { CompanyAddress newAdd = new CompanyAddress(txtStreet.Text, int.Parse(txtnumber.Text)); CompanyData data = new CompanyData(int.Parse(idTextBox.Text), saveNowTextBox.Text, false, newAdd, null); if (isMainCompanyCheckBox.IsChecked == true) { data.IsMainCompany = true; } else { data.IsMainCompany = false; } companyData.Add(data); }
public Companies() { InitializeComponent(); List <CompanyCar> cars = new List <CompanyCar>(); cars.Add(new CompanyCar("Audi A1")); cars.Add(new CompanyCar("BMW1")); cars.Add(new CompanyCar("VW")); company1 = new CompanyData("Hanseaticsoft GmbH", true, new CompanyAddress("Frankenstraße", 12), cars); List <CompanyData> companyList = new List <CompanyData>(); companyList.Add(company1); listViewCompany.Items.Add(companyList); EditCompany entry = new EditCompany(company1, this); entry.ValueChanged += new EditCompany.ValueChangedHandler(entryValueChanged); }
public void save(CompanyData company) { company1 = company; }
private void entryValueChanged(CompanyData data) { }
private void AddButton_Click(object sender, RoutedEventArgs e) { CompanyData data = new CompanyData(int.Parse(iDAddOrEditTxtBox.Text), companyNameAddOrEditTxtBox.Text, true, null, null); newCompanyCollection.Add(data); }
private void Save_Click(object sender, RoutedEventArgs e) { CompanyData data = new CompanyData(1, companyNameTxtBox.Text, false, null, null); }
public EditCompany(CompanyData company) { InitializeComponent(); companyToBeEdited = company; this.DataContext = companyToBeEdited; }