Ejemplo n.º 1
0
 public AddorEdit(ObservableCollection <CompanyData> existingCompanies, CompanyData company, ListView list)
 {
     InitializeComponent();
     this.newCompanyCollection = existingCompanies;
     this.newCompany           = company;
     this.addOrEditListView    = list;
     this.DataContext          = newCompanyCollection;
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 6
0
 public void save(CompanyData company)
 {
     company1 = company;
 }
Ejemplo n.º 7
0
 private void entryValueChanged(CompanyData data)
 {
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 9
0
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     CompanyData data = new CompanyData(1, companyNameTxtBox.Text, false, null, null);
 }
Ejemplo n.º 10
0
 public EditCompany(CompanyData company)
 {
     InitializeComponent();
     companyToBeEdited = company;
     this.DataContext  = companyToBeEdited;
 }