Esempio n. 1
0
        private void AddPart_Click(object sender, RoutedEventArgs e)
        {
            noError = true;
            string[] Data = new string[4];
            Data[0] = SerialNumberText.GetLineText(0);
            Data[1] = VINText.GetLineText(0);
            Data[2] = NameText.GetLineText(0);
            Data[3] = ManufacturerText.GetLineText(0);

            MakePart P = new MakePart(Data, cn);

            try
            {
                P.CreatePart();
            }
            catch (OleDbException ex)
            {
                noError = false;
                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
            }
            if (noError)
            {
                this.Close();
            }
        }
Esempio n. 2
0
        private void AddCustomerSubmit_Click(object sender, RoutedEventArgs e)
        {
            string[] Data = new string[7];
            Data[0] = IDText.GetLineText(0);
            Data[1] = NameText.GetLineText(0);
            Data[2] = PhoneText.GetLineText(0);
            Data[3] = AddressText.GetLineText(0);
            Data[4] = SexText.GetLineText(0);
            Data[5] = Data[0];
            Data[6] = TypeText.GetLineText(0);

            acc.createCustomer(Data).ShowDialog();

            this.Close();
        }
Esempio n. 3
0
        private void AddEngine_Click(object sender, RoutedEventArgs e)
        {
            noError = true;
            string[] Data = new string[4];
            Data[0] = SerialNumberText.GetLineText(0);
            Data[1] = VINText.GetLineText(0);
            Data[2] = NameText.GetLineText(0);
            Data[3] = ManufacturerText.GetLineText(0);
            string SerialNumber = Data[0];
            string HorsePower   = HorsePowerText.GetLineText(0);
            string Cylinders    = CylindersText.GetLineText(0);

            MakePart   P = new MakePart(Data, cn);
            MakeEngine E = new MakeEngine(SerialNumber, HorsePower, Cylinders, cn);

            try
            {
                P.CreatePart();
            }
            catch (OleDbException ex)
            {
                noError = false;
                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
            }

            try
            {
                E.CreateEngine();
            }
            catch (OleDbException ex)
            {
                try
                {
                    P.DeletePart();
                }
                catch (OleDbException ex2) { }

                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
                return;
            }
            if (noError)
            {
                this.Close();
            }
        }
Esempio n. 4
0
        private void AddEmployeeSubmit_Click(object sender, RoutedEventArgs e)
        {
            string[] Data = new string[5];
            Data[0] = IDText.GetLineText(0);
            Data[1] = NameText.GetLineText(0);
            Data[2] = PhoneText.GetLineText(0);
            Data[3] = AddressText.GetLineText(0);
            Data[4] = SexText.GetLineText(0);
            string EID       = Data[0];
            string Salary    = SalaryText.GetLineText(0);
            string StartDate = StartDateText.GetLineText(0);
            string ManagerID = ManagerText.GetLineText(0);

            MakePerson   P = new MakePerson(Data, cn);
            MakeEmployee E = new MakeEmployee(EID, Salary, StartDate, ManagerID, cn);

            try
            {
                P.CreatePerson();
            }
            catch (OleDbException ex)
            {
                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
                return;
            }

            try
            {
                E.CreateEmployee();
            }
            catch (OleDbException ex)
            {
                try
                {
                    P.DeletePerson();
                }
                catch (OleDbException ex2) { }

                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
                return;
            }

            this.Close();
        }
Esempio n. 5
0
        private void AddEmployeeSubmit_Click(object sender, RoutedEventArgs e)
        {
            string[] Data = new string[9];
            Data[0] = IDText.GetLineText(0);
            Data[1] = NameText.GetLineText(0);
            Data[2] = PhoneText.GetLineText(0);
            Data[3] = AddressText.GetLineText(0);
            Data[4] = SexText.GetLineText(0);
            Data[5] = Data[0];
            Data[6] = SalaryText.GetLineText(0);
            Data[7] = StartDateText.GetLineText(0);
            Data[8] = ManagerText.GetLineText(0);

            aec.createEmployee(Data).ShowDialog();

            this.Close();
        }
Esempio n. 6
0
        private void AddTire_Click(object sender, RoutedEventArgs e)
        {
            noError = true;
            string[] Data = new string[4];
            Data[0] = SerialNumberText.GetLineText(0);
            Data[1] = VINText.GetLineText(0);
            Data[2] = NameText.GetLineText(0);
            Data[3] = ManufacturerText.GetLineText(0);
            string SerialNumber = Data[0];
            string Type         = TypeText.GetLineText(0);
            string Size         = SizeText.GetLineText(0);

            MakePart  P = new MakePart(Data, cn);
            MakeTires T = new MakeTires(SerialNumber, Type, Size, cn);

            try
            {
                P.CreatePart();
            }
            catch (OleDbException ex)
            {
                noError = false;
                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
            }
            try
            {
                T.CreateTires();
            }
            catch (OleDbException ex)
            {
                try
                {
                    P.DeletePart();
                }
                catch (OleDbException ex2) { }

                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
                return;
            }
            if (noError)
            {
                this.Close();
            }
        }
Esempio n. 7
0
        private void AddCustomerSubmit_Click(object sender, RoutedEventArgs e)
        {
            string[] Data = new string[5];
            Data[0] = IDText.GetLineText(0);
            Data[1] = NameText.GetLineText(0);
            Data[2] = PhoneText.GetLineText(0);
            Data[3] = AddressText.GetLineText(0);
            Data[4] = SexText.GetLineText(0);
            string EID  = Data[0];
            string Type = TypeText.GetLineText(0);

            MakePerson   P = new MakePerson(Data, cn);
            MakeCustomer E = new MakeCustomer(EID, Type, cn);

            try
            {
                P.CreatePerson();
            }
            catch (OleDbException ex)
            {
                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
                return;
            }

            try
            {
                E.CreateCustomer();
            }
            catch (OleDbException ex)
            {
                try
                {
                    P.DeletePerson();
                }
                catch (OleDbException ex2) { }

                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
                return;
            }

            this.Close();
        }