static void Simulate_Capture(ref Inventory_System_API x, int Cicles) { int LastCounter = x.GetLastCounter(); Random r = new Random(); int counter = 0; TicketTag z = new TicketTag(); string[] Contadores = { "AC", "AB", "AC", "JL", "GV", "GH" }; Console.WriteLine("Start Simulate Capture"); while (counter < Cicles) { int rTag = r.Next(LastCounter); z = x.LoadTag(rTag); try { if (!z.Verified) { int max = Convert.ToInt32(z.InventoryQuantity); z.CountQTY = r.Next(max + r.Next(5)); z.ReCountQTY = r.Next(max + r.Next(5)); z.Verified = true; z.CounterInitials = Contadores[r.Next(Contadores.Count())]; z.CountedDate = DateTime.Now; x.UpdateTag(z); counter++; Console.WriteLine("Ticket Tag Captured: " + rTag.ToString()); } } catch { } } Console.WriteLine("Finish Simulate Capture # of Captured Tags: " + Cicles.ToString()); }
private void NextTag() { Loading_data = true; _tagNo++; if (_tagNo <= x.GetLastCounter()) { tb_TagNo.Text = _tagNo.ToString(); LoadTagInfo(x.LoadTag(_tagNo)); } else { tb_TagNo.Text = x.GetLastCounter().ToString(); _tagNo = x.GetLastCounter(); LoadTagInfo(x.LoadTag(x.GetLastCounter())); } Loading_data = false; }