title: Best way to capture barcodes using Motorola MC2180 or similar mobile scanner
body: <p>1d/2D Barcodes needs captured using cordless barcode scanner and transferred to Windows PC.
  I looked into Motorola MC2180 mobile computer specifications.
  It seems to have Windows CE 6 with RhoElements Webkit based browser and Datawedge application which  transfers scanned barcodes to keyboard buffers.</p>
  
  <p>Scanning application prototype using ASP.NET MVC4 is below.</p>
  
  <p>This approach has the following issues:</p>
  
  <ol>
  <li><p>After scanning barcode, user must press manually tab to move to next field.
  Is there some barcode APIS which can used ? I havent found any documentations for this 
  for MC2180 .</p></li>
  <li><p>View below looks ugly: it allows to scan fixed number codes, but user may wat to enter 1 .. 200 codes to single order. How to change it so that number of codes in not fixed ?
  Should jQuery Mobile used to improve this or other way ?</p></li>
  <li><p>Controller perfoms manual parsing of http POST buffer. Can this improved using ASP.NET MVC4 features ?</p></li>
  </ol>
  
  <p>Which is best way to scan barcodes in cordless way and transfer them to PC using free 
  or shipped with scanner shoftware ?
  Which device shuld be used ?
  If there is better cheap device than MC2180 it can used. </p>
  
  <p>View:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form method='post' action='SaveOrder'&gt;
  
  Number &lt;input name='orderno' type='text'/&gt;
  Date &lt;input name='orderdate' type='date'/&gt;
  
  &lt;input type="hidden" name="_rowdelimiter" /&gt;
  Product1 &lt;input name='orderno' type='text'/&gt;
  Quantity1 &lt;input name='quantity' type='text'/&gt;
  
  &lt;input type="hidden" name="_rowdelimiter" /&gt;
  Product2 &lt;input name='orderno' type='text'/&gt;
  Quantity2 &lt;input name='quantity' type='text'/&gt;
  
  &lt;input type="hidden" name="_rowdelimiter" /&gt;
  Product3 &lt;input name='orderno' type='text'/&gt;
  Quantity3 &lt;input name='quantity' type='text'/&gt;
  ...
  &lt;input type='submit' value='Save order'/&gt;    
  &lt;/form&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>[AcceptVerbs(HttpVerbs.Post)]
  public ActionResult SaveOrder() {
    var form = ControllerContext.HttpContext.Request.Form;
    var orderDetails = new List&lt;OrderDetails&gt;();
    var order = new Order();
    OrderDetails row = null;
    bool inheader = true;
    foreach (var key in form.AllKeys)
      {
      if (key == "_rowdelimiter")
        {
          if (row != null)
            orderDetails.Add(row);
            row = new OrderDetails();
            inheader = false;
            continue;
            }
          if (inheader)
           {
            SetValue( order, key, HttpUtility.HtmlDecode(form[key]) );
            continue;
            }
         SetValue( row, key, HttpUtility.HtmlDecode(form[key]) );
     }
    orderDetails.Add(row);
    EntityManager.SaveOrder( order, orderDetails );
    return ContentResult() {Content="Order saved" } ;
  }
  
  static void SetValue( object entity, string propertyName, string propertyValue ) {
    PropertyInfo p = entity.GetType().GetProperty(propertyName);
    p.SetValue(this, propertyValue, null);
    }
  </code></pre>