コード例 #1
0
        private void AddNewVehicleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmMaintainVehicles vehicle = new frmMaintainVehicles();
            frmParent           parent  = this;

            vehicle.setMode("add");
            vehicle.clearForm();
            vehicle.MdiParent = parent;
            vehicle.Show();
        }
コード例 #2
0
        private void BtnUpdate_Click(object sender, EventArgs e)
        {
            frmMaintainVehicles maintainVehicles = new frmMaintainVehicles();

            maintainVehicles.setMode("update");
            maintainVehicles.clearForm();
            maintainVehicles.setRegNo(dgVehicles.Rows[rowIndex].Cells[1].Value.ToString());
            try { maintainVehicles.setVehicleID(dgVehicles.Rows[rowIndex].Cells[0].Value.ToString()); } catch (ArgumentOutOfRangeException m) { Console.WriteLine(m.Message); }

            maintainVehicles.Show();
        }