C# Only allowing qr code to be scanned once - c#

We use QR codes on our products. Each QR code is virtually identical except for a unique serial number.
I'm writing a C# Win Form program for building product KITS. They then scan off each product within that KIT to complete the Order. Some KITS contain multiples of the same product. I want to prevent the user from simply scanning the same QR code for a product with multiples in a KIT.
I will be creating a database for this Win App to store which qr codes have been scanned off the total amount needed for the KIT.
To ensure that the same QR code isn't scanned, would I be correct in assuming I'd simply need to run a check against the serial numbers previously scanned in the database? If so, how is the most efficient way to do this?
Thanks

It depends how the QR Code is stored in your database and how each QR code differs. Is it stored as data/an image? What exact data is being encoded onto the QR code?
You mention that the QR codes are virtually identical, but they have a unique serial number. Is this serial number stored in the QR Code? If so then after decoding you can simply search for the serial number in the database.

As far as efficiency goes, use the unique serial number as the identifier column in your table. Then, either query for that serial number, and only approve the scan if the query does not return anything. It is not completely safe though, as once you're trying to write the value to the table, it may already have been written by a different caller.
On the other hand, if you have a unique constraint on the column, you can just attempt to insert the scanned serial number - and let it fail if it already exists.

If you have a single user/computer being used for scanning each kit, and the process of scanning each kit has a definitive beginning or ending, and the data being stored isn't massive, and each kit scanned will be scanned in a single session, I would store each item scanned in an in-memory collection until the entire kit is scanned, then write the completed kit to the database asynchronously.
You can check the each new code against the in-memory collection.
This helps to make sure you don't have partial collections (orphaned data) in the database.
Makes it much more efficient to remove erroneously scanned items.

Related

How to plot strings to corresponding coordinates for printing?

My company gave me a project to automate the distribution of OR (Official Receipt).
My task is to create an application where the user will encode the OR information and the application will then print the OR (via printer). My problem is, the paper they'll print it on already has the layout. All I need to do is embed the encoded values from my application into that layout with the correct coordinates.
How can I achieve this using .NET Framework?
I already tried searching for Graphic.DrawString, but my major problem is plotting the correct coordinates for each value.
Thank You.
Is the layout the users have the same for all users or can it change?
i.e.
If "Receipt#" is at location 20,20 on one clients receipt will it be at the same location on the rest?
If the same location - use trial and error as Tomek suggests, if it is not then you will need to have a program to scan the receipt to an image and then parse the image for the words you are after.
Are the data headings the same for all users or can that change too?
i.e.
Do all clients have Receipt# on their receipts or can another client have ReceptNo instead?
If this is the case you not only need to parse for the easy headings but you now need to parse for the text and understand it via mappings.
Unless you are really good with image manipulation/parsing you will need to load the receipts into an OCR tool, or better yet convert into a PDF. The PDF will hold the names of the text as well as the locations of the text as meta data and can be parsed into your mapping file.

How to store fingerprint scans on my computer instead of inside the scanner?

I would like to know if there are fingerprint scanners which doesn't save locally their fingerprint data, but they just send raw data to he attached computer.
If yes, which type of scanner should I use? I would prefer to use c# as programming language of the handling application, but as long as handling fingerprints on pc is possible I will learn any language you'll raccomand me
All the fingerprint scanners that I have seen, allow you to save the fingerprint data (locally). Without doing adverts for any readers, the following "desktop" device groups work for a fact, as I have them:
digitalpersona (4000, 4500, 5100), Futronic devices (FS80h, FS88,..), UPEK EikonTouch (I can't locate the model number of the one that I am using.). There are larger, more expensive devices such as the Cross Match L SCAN Patrol, Suprema RealScan-G10, etc. from which iamges can also be read and saved.
The important thing is that SDKs are provided that allow you to interact with the readers: capture fingerprint image data which you can then save to a file or to a database. I am not sure about C# though: my exposure to SDKs is limited to C and Java.

Can barcode Misread code?

in my asp.net mvc application on Register Form when users are using barcode scanner to insert data to textbox ,they say that it misses some portion of code like if they scan 02501603566 they get 02501602566 or 01301103564 can be 01301403564 after register.can barcode misread some data? i tested on my barcode and everything works fine.customers have big amount of data so they cant check every time what they have scanned in input.this can happen 1 times in 100..
Yes its not only possible that a scanner misreads are barcode, it definitely happens. 1D barcodes are the worst, but also cheap readers and readers configured improperly for the type of barcode being read can also be a problem.
If you are in control of the code, use a barcode with the appropriate error checking (and there are many).
Also check your barcode reader settings (they all have them).
If all else fails check the barcode with a different scanner or barcode reader app and check if its the fault tolerance of the scanner itself.
Misreads in the form of a perfectly scanning but wrong barcode can be
caused by scanner number substitution
Somehow the printed barcode image is wrongly decoded by the scanner. A poor quality printed barcode can contribute to this, but barcode structure also contributes. UPC is notoriously vulnerable to number substitution of 1 and 7, and 2 and 8 characters
Low ISO Decodability scores can contribute to barcode misreads,
especially when they are caused by pixel rounding in the print process
This is most common in a thermal or thermal transfer printing but it can also occur in ink jet, DOD and other digital printing systems
Scanners can also misread otherwise acceptable barcodes. Most often
the cause can be traced to damaged or dirty optics, but faulty decode
algorithms area known cause, albeit a rare one
Older, high-mileage scanners such as lasers tend to be more prone to misreads than newer, more sophisticated digital area imager scanners.
If a calibrated, ISO compliant verifier decodes and assigns an acceptable grade to a misreading barcode, one can be confident the cause lies with the scanner and not the barcode itself. This is yet another example of how a scanner cannot effectively serve as a verifier

How 3rd party finger print device is working with C#

I am very new to this topic:-
Suppose If I am using 3rd party finger print sdk,
The sdk will provide API's to read data?
After scan what data format the device will return, thumb image or
some index value?
Suppose if it is index value where it is stored the thumb images ,
how the device will identify the image after second scan?
The device itself using separate DB for storing the thumb images?
Can I expect above queries should be solved by device developer
manual?
Thanks,
Hemu
Three major operations need to be followed:
Capture : Captures the finger
Merge : Merges the three finger templates into one (to be used for recording the fingerprint first time)
Verify : Compare two fingerprint templates (merged one vs newly captured one) and return the score
Scanner doesn't return the index. It should be handled at your software during the capture. More workflow informations can be found at http://camsunit.com/application/html-based-fingerprint-scanner-for-website-authentication-and-attendance.html

ASP.net C# image processing

I am designing a website for PUBLIC TRANSPORT TICKETING SYSTEM using ASP.NET c# and MSSQL..So when a customer registers in the site, I want to send SMS with a barcode to him to use that in the bus to validate him..
so in the bus there is KIOSK and also a barcode reader..When he get into the bus first he has to validate himself..
So i want to implement this : when the passenger shows the image of the barcode in his mobile the barcode should compare it with the database and if it's validated proceed if not give an error message..
plz consider my question and kind be enough to reply..
Thank alot..
Usually barcodes are compared as strings, not as images. Note that it's not recommended to store the barcode as image in the database. You simply can store the barcode value (string) in the database and compare it with the barcode recognition result.
We currently generate barcodes (Code 93) using a 3rd party toolkit named leadtools. This toolkit gives you the ability to read\write common barcodes. For more information, see the following link:
http://www.leadtools.com/help/leadtools/v175/dh/to/leadtools.topics.barcode~ba.topics.programmingwithleadtoolsbarcode.html
Barcodes are NOT generally implemented by image comparison.
Rather, the barcode evaluates to a string or number, which is then a PK into a backend database somewhere.
(Eg, check on any product in your kitchen pantry. The barcode will often have a human-readable version of the number that the barcode represents, written below the barcode).
You've specified there's a barcode reader in place... This will do the "heavy lifting" of reading the barcode and passing the resultant string/number into the system.

Categories

Resources