Esempio n. 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtBrand.Text == "" || txtModel.Text == "" || txtPlate.Text == "" || txtClass.Text == "")
            {
                lblBlanks.Text = "Please fill in the blanks";
            }
            else
            {
                int    len1, len2;
                string a, b;
                len1 = txtBrand.Text.Length;
                len2 = txtModel.Text.Length;
                a    = txtBrand.Text.Substring(0, 1);
                b    = txtModel.Text.Substring(0, 1);

                Vehicle vehicle = new Vehicle();
                vehicle.Brand = a.ToUpper() + txtBrand.Text.Substring(1, len1 - 1);
                vehicle.Model = b.ToUpper() + txtModel.Text.Substring(1, len2 - 1);
                vehicle.Plate = txtPlate.Text;
                vehicle.Grade = txtClass.Text;

                Costumer costumer = CostumerProcess.GetCostumer(userName, password);
                vehicle.CID = costumer.ID;

                VehicleProcess.AddVehicle(vehicle);
                Questioning questioning = new Questioning();
                questioning.userName = userName;
                questioning.password = password;
                questioning.Show();
                this.Hide();
            }
        }
Esempio n. 2
0
        private void llblTurn_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Questioning questioning = new Questioning();

            questioning.userName = userName;
            questioning.password = password;
            questioning.Show();
            this.Hide();
        }
Esempio n. 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            Questioning questioning = new Questioning();

            questioning.userName = userName;
            questioning.password = password;
            questioning.Show();
            this.Hide();
        }
Esempio n. 4
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            Costumer costumer = CostumerProcess.GetCostumer(txtUsername.Text, txtPassword.Text);

            if (costumer == null)
            {
                label5.Text = "There is no costumer! Please try again!";
            }
            else
            {
                Questioning questioning = new Questioning();
                questioning.userName = txtUsername.Text;
                questioning.password = txtPassword.Text;
                questioning.Show();
                this.Hide();
            }
        }