Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addbarcode() {
- debugger
- var artno = $("#scanner").val();
- $.ajax({
- url: '@Url.Action("Addbarcode", "Home")',
- type: 'POST',
- datatype: 'json',
- data: { "text": artno },
- success: function (data) {
- $("#msg").html(data);
- },
- error: function (err) {
- document.getElementById('msg').innerHTML = err;
- }
- });
- }
- List<Barcode> getListBarcode=new List<Barcode>();
- public string Addbarcode(string text) {
- Barcode barcode = new Barcode();
- barcode.original = text;
- barcode.Article= text.Substring(10, 5);
- barcode.serial= text.Substring(text.Length - 14);
- if (getListBarcode.Contains(barcode)==false)
- {
- getListBarcode.Add(barcode);
- Session["barcodelist"] = getListBarcode;
- string total= "Total of :" + getListBarcode.Count;
- return total;
- }
- else
- {
- return "Duplicates";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement