private async void SyncEntranceOperations(object sender, EventArgs e) { if (EntranceGateOpened) { tm1.Stop(); CloseGate(GateSide.Entrance); } else { LicenseBitmap = (Bitmap)FeedBox.Image; if (LicenseBitmap == null) { DetectedLicense.Text = "NULL"; } else { DetectedLicense.Text = "LOADING"; pictureBox1.Image = FeedBox.Image; OCR ocr = new OCR(); DetectedLicense.Text = ocr.GetLicense(Get24bppRgb(LicenseBitmap)); if (!DetectedLicense.Text.Equals("INVALID")) { DetectedLicenseNumber = DetectedLicense.Text; tm1.Stop(); ufunctions = new UserFunctions(); UserFunctions uf = new UserFunctions(); int y = await uf.RegisterCar(DetectedLicense.Text); CarID = y; Enroller en = new Enroller(this); en.ShowDialog(); bool t = await ufunctions.GetParking(23, y, en.UserID); ProcessTicket(23, y); } } } }
private async void SyncExitOperations(object sender, EventArgs e) { if (ExitGateOpened) { tm2.Stop(); CloseGate(GateSide.Exit); } else { LicenseBitmap = (Bitmap)FeedBox.Image; if (LicenseBitmap == null) { DetectedLicense.Text = "NULL"; } else { DetectedLicense.Text = "LOADING"; pictureBox1.Image = FeedBox.Image; OCR ocr = new OCR(); DetectedLicense.Text = ocr.GetLicense(Get24bppRgb(LicenseBitmap)); if (!DetectedLicense.Text.Equals("INVALID")) { DetectedLicenseNumber = DetectedLicense.Text; tm2.Stop(); ufunctions = new UserFunctions(); UserFunctions uf = new UserFunctions(); int y = await uf.RegisterCar(DetectedLicense.Text); CarID = y; Enroller en = new Enroller(this); en.ShowDialog(); } } //Capture Image from here and process it } }
private void EnrollButton_Click(object sender, EventArgs e) { ExchangeData(true); // transfer values from the main form to the data object Enroller.ShowDialog(); // process enrollment }