Пример #1
0
        public Spike3Form()
        {
            InitializeComponent();
            Vehicle v1 = VehicleControl.FindVehicle("0");

            pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
        }
Пример #2
0
        /// <summary>
        /// VehiclewasAdded method will confirm if the vehicle could be added
        /// to the database.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        private bool VehicleWasAdded(int id)
        {
            Vehicle v1        = VehicleControl.FindVehicle(id.ToString());
            string  vehicleID = v1.PrimaryKey.ToString();

            return(id.ToString() == vehicleID);
        }
Пример #3
0
        public void FindVehicleTest()
        {
            string  id = "1";
            Vehicle v  = VehicleControl.FindVehicle(id);
            Vehicle v2 = new Vehicle("test", "test", 1, "test", "test", false, false, 1, "Madison");

            Assert.AreEqual(v2.Make, v.Make);
            Assert.AreEqual(v.Model, v2.Model);
            Assert.AreEqual(v.VehicleYear, v2.VehicleYear);
            Assert.AreEqual(v.Color, v2.Color);
        }
Пример #4
0
        /// <summary>
        /// The sendButton once pressed will generate and send a vehicle issue
        /// to the database.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void sendButton_Click(object sender, System.EventArgs e)
        {
            Vehicle  v1        = VehicleControl.FindVehicle(r1.VehicleID.ToString());
            DateTime issueDate = problemDate.Value.Date;
            string   Issue     = descriptionTextBox.Text;

            try
            {
                VehicleIssue vehicleIssue = new VehicleIssue(issueDate.Date, Issue, v1);
                if (VehicleIssueControl.AddIssue(vehicleIssue))
                {
                    messageLabel.Text = "The report has been sent. Thank you for your patience.";
                    descriptionTextBox.Clear();
                    messageLabel.Visible = true;
                }
            }
            catch (Exception)
            {
            }
        }