Пример #1
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            VehicleInformationClass vehicleObj = new VehicleInformationClass();

            vehicleObj.ModelYear     = vehicleModelYearTextBox.Text;
            vehicleObj.Department    = departmentCcomboBox.Text;
            vehicleObj.VinNumber     = vehicleVenNumTextBox.Text;
            vehicleObj.VehicleNumber = vehicleNumberTextBox.Text;
            vehicleObj.Colour        = colorComboBox.Text;
            vehicleObj.ModelNumber   = vehicleModelNumberTextBox.Text;
            vehicleObj.EnginNumber   = vehicleEnginNumberYextBox.Text;
            vehicleObj.Transmistion  = vehicleTranansmistionTextBox.Text;
            vehicleObj.TrialSize     = vehicleTrilSizeTextBox.Text;
            vehicleObj.CompanyName   = vehicleCompnyTextBox.Text;
            vehicleObj.AccountNumber = vehicleAccountTextBox.Text;

            VehicleInformationGetway vehicleStObj = new VehicleInformationGetway();

            vehicleStObj.saveVehicleInformation(vehicleObj);

            MessageBox.Show("The information Save ");
        }
Пример #2
0
        private void showListBoxButton_Click(object sender, EventArgs e)
        {
            vehicleListView.Items.Clear();
            List <VehicleInformationClass> vehicleses = new List <VehicleInformationClass>();
            VehicleInformationGetway       vehiclObj  = new VehicleInformationGetway();

            vehicleses = vehiclObj.GetVendorInformation();

            foreach (VehicleInformationClass vehicleOj in vehicleses)
            {
                ListViewItem vehiclList = new ListViewItem(vehicleOj.ModelYear);
                vehiclList.SubItems.Add(vehicleOj.Department);
                vehiclList.SubItems.Add(vehicleOj.VinNumber);
                vehiclList.SubItems.Add(vehicleOj.VehicleNumber);
                vehiclList.SubItems.Add(vehicleOj.Colour);
                vehiclList.SubItems.Add(vehicleOj.ModelNumber);
                vehiclList.SubItems.Add(vehicleOj.EnginNumber);
                vehiclList.SubItems.Add(vehicleOj.Transmistion);
                vehiclList.SubItems.Add(vehicleOj.TrialSize);
                vehiclList.SubItems.Add(vehicleOj.CompanyName);
                vehiclList.SubItems.Add(vehicleOj.AccountNumber);
                vehicleListView.Items.Add(vehiclList);
            }
        }