Example #1
0
 public AddorEdit(ObservableCollection <CompanyData> existingCompanies, CompanyData company, ListView list)
 {
     InitializeComponent();
     this.newCompanyCollection = existingCompanies;
     this.newCompany           = company;
     this.addOrEditListView    = list;
     this.DataContext          = newCompanyCollection;
 }
Example #2
0
        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;
        }
Example #3
0
        public void TestConnectionToDB()
        {
            //Arrange
            CompanyData    cd          = new CompanyData();
            List <Company> companyList = new List <Company>();

            //Act
            companyList = cd.GetAllCompanies();
            //Assert
            Assert.IsTrue(companyList.Count > 0);
        }
Example #4
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);
        }
Example #5
0
        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);
        }
Example #6
0
 public void save(CompanyData company)
 {
     company1 = company;
 }
Example #7
0
 private void entryValueChanged(CompanyData data)
 {
 }
Example #8
0
        private void AddButton_Click(object sender, RoutedEventArgs e)
        {
            CompanyData data = new CompanyData(int.Parse(iDAddOrEditTxtBox.Text), companyNameAddOrEditTxtBox.Text, true, null, null);

            newCompanyCollection.Add(data);
        }
Example #9
0
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     CompanyData data = new CompanyData(1, companyNameTxtBox.Text, false, null, null);
 }
Example #10
0
 public EditCompany(CompanyData company)
 {
     InitializeComponent();
     companyToBeEdited = company;
     this.DataContext  = companyToBeEdited;
 }