コード例 #1
0
        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);
                    }
                }
            }
        }