private void bunifuFlatButton1_Click(object sender, EventArgs e)
        {
            BookSearch bs = new BookSearch("brwr", "");

            bs.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
 private void timer_Tick(object sender, EventArgs e)
 {
     //BarcodeReader Reader = new BarcodeReader();
     //Result result = Reader.Decode((Bitmap)pb_ScanQR.Image);
     try
     {
         Bitmap        bitmap = new Bitmap(pb_ScanQR.Image);
         BarcodeReader reader = new BarcodeReader {
             AutoRotate = true, TryInverted = true
         };
         Result result = reader.Decode(bitmap);
         decoded = result.ToString().Trim();
         if (decoded != "")
         {
             timer.Stop();
             if (origin == "book")
             {
                 Book bk = new Book(usertype, decoded);
                 bk.Show();
                 this.Close();
             }
             else if (origin == "booksearch")
             {
                 BookSearch bs = new BookSearch(usertype, decoded);
                 bs.Show();
                 this.Close();
             }
             else if (origin == "brwr")
             {
                 Borrower br = new Borrower(usertype, decoded);
                 br.sy = schoolyear;
                 br.bt = brwrtype;
                 br.Show();
                 this.Close();
             }
             else if (origin == "inquiry")
             {
                 Inquiry inq = new Inquiry(decoded);
                 inq.Show();
                 this.Close();
             }
             else if (origin == "attendance")
             {
                 AttendanceMonitoring am = new AttendanceMonitoring(decoded);
                 am.Show();
                 this.Close();
             }
             else
             {
                 MessageBox.Show("Invalid Destination");
             }
         }
     }
     catch (Exception ex)
     {
         timer.Stop();
         MessageBox.Show("No QR code detected.");
     }
 }