Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. function addbarcode() {
  2. debugger
  3. var artno = $("#scanner").val();
  4. $.ajax({
  5. url: '@Url.Action("Addbarcode", "Home")',
  6. type: 'POST',
  7. datatype: 'json',
  8. data: { "text": artno },
  9. success: function (data) {
  10.  
  11. $("#msg").html(data);
  12.  
  13. },
  14. error: function (err) {
  15.  
  16. document.getElementById('msg').innerHTML = err;
  17. }
  18. });
  19. }
  20.  
  21. List<Barcode> getListBarcode=new List<Barcode>();
  22. public string Addbarcode(string text) {
  23. Barcode barcode = new Barcode();
  24. barcode.original = text;
  25. barcode.Article= text.Substring(10, 5);
  26. barcode.serial= text.Substring(text.Length - 14);
  27. if (getListBarcode.Contains(barcode)==false)
  28. {
  29. getListBarcode.Add(barcode);
  30. Session["barcodelist"] = getListBarcode;
  31. string total= "Total of :" + getListBarcode.Count;
  32. return total;
  33. }
  34. else
  35. {
  36. return "Duplicates";
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement