示例#1
0
        public static void Run(clsVehicle prBrandName)

        {
            Console.WriteLine("ssss {0}", prBrandName.VehicleRegNo);
            FrmVehicle lcBrandForm;

            if (string.IsNullOrEmpty(prBrandName.VehicleRegNo) ||

                !_BrandFormList.TryGetValue(prBrandName.VehicleRegNo, out lcBrandForm))

            {
                lcBrandForm = new FrmVehicle();

                if (string.IsNullOrEmpty(prBrandName.VehicleRegNo))
                {
                    lcBrandForm.SetDetails(new clsVehicle());
                }

                else

                {
                    _BrandFormList.Add(prBrandName.VehicleRegNo, lcBrandForm);

                    lcBrandForm.refreshFormFromDB(prBrandName.VehicleRegNo);
                }
            }

            else

            {
                lcBrandForm.Show();

                lcBrandForm.Activate();
            }
        }
示例#2
0
        private void lstVehicle_DoubleClick(object sender, EventArgs e)
        {
            string lcKey;

            lcKey = Convert.ToString(lstVehicle.SelectedItem);
            if (lcKey != null)
            {
                try
                {
                    FrmVehicle.Run(lstVehicle.SelectedItem as clsVehicle);
                    //frmBrand.Run(_ArtistList[lcKey]);
                }
                catch (Exception ex)
                {
                    //MessageBox.Show(ex.Message, "This should never occur");
                }
            }
        }