private void btnQuestioning_Click(object sender, EventArgs e) { lblPlateError.Visible = false; Costumer costumer = CostumerProcess.GetCostumer(userName, password); plate = textBox1.Text; Vehicle vehicle = VehicleProcess.GetVehicle(plate); if (vehicle != null) { if (costumer.ID == vehicle.CID) { lblLabel.Text = Convert.ToString(vehicle.LID); lblPlate.Text = vehicle.Plate; lblClass.Text = Convert.ToString(vehicle.Grade) + ". Class"; lblBalance.Text = Convert.ToString(vehicle.Balance); linkLabel2.Visible = true; } else { lblPlateError.Text = "This vehicle is not your's!"; lblPlateError.Visible = true; } } else { lblPlateError.Text = "There is no vehicle!"; lblPlateError.Visible = true; } }
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(); } }
private void AddVehicle_Load(object sender, EventArgs e) { Costumer costumer = CostumerProcess.GetCostumer(userName, password); pictureBox1.Parent = panel1; pictureBox1.BackColor = Color.Transparent; panel2.Parent = pictureBox1; panel2.BackColor = Color.Transparent; panel3.Parent = pictureBox1; panel3.BackColor = Color.Transparent; }
private void Questioning_Load(object sender, EventArgs e) { Costumer costumer = CostumerProcess.GetCostumer(userName, password); label1.Parent = pictureBox1; label1.BackColor = Color.Transparent; label1.Text = costumer.Name + " " + costumer.Surname; pictureBox1.Parent = panel1; pictureBox1.BackColor = Color.Transparent; panel2.Parent = pictureBox1; panel2.BackColor = Color.Transparent; panel3.Parent = pictureBox1; panel3.BackColor = Color.Transparent; linkLabel1.Parent = panel3; linkLabel1.BackColor = Color.Transparent; }
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(); } }