Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
 private void UpdateTag()
 {
     BeforeToSave();
     x.UpdateTag(_tag);
     if (x.ErrorOccour)
     {
         MessageBox.Show(x.ErrorMessage);
     }
     LoadTagInfo(_tag);
 }
Ejemplo n.º 3
0
        private void dgv_FilteredTags_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            int TagIndex = e.RowIndex;
            int tagNo    = (int)dgv_FilteredTags.Rows[TagIndex].Cells["Tag Counter"].Value;

            L[TagIndex].Verified = (bool)dgv_FilteredTags.Rows[TagIndex].Cells["Verified"].Value;
            L[TagIndex].VoidTag  = (bool)dgv_FilteredTags.Rows[TagIndex].Cells["Void"].Value;

            if (dgv_FilteredTags.Rows[TagIndex].Cells["Item Number"].Value.ToString() == "" &&
                !(bool)dgv_FilteredTags.Rows[TagIndex].Cells["Void"].Value)
            {
                MessageBox.Show("A blank Tag can not be Verified.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                dgv_FilteredTags.Rows[TagIndex].Cells["Verified"].Value = false;
            }
            else
            {
                x.UpdateTag(L[TagIndex]);
            }
        }