Esempio n. 1
0
        //internal void UpdatedDataBase(Hashtable productsRead, List<Product> productlist)
        //{
        //    List<String> productsUnre = ListUPCUnrecognized(productsRead, productlist);
        //    SyncProduct prodResp;
        //    foreach (String product in productsUnre)
        //    {
        //        prodResp = GETProduct(product);
        //        AddProductDataBase(prodResp);
        //    }
        //}

        //private bool AddProductDataBase(SyncProduct product)
        //{
        //    using (CsvFileWriter writer = new CsvFileWriter(pathFolderName + "productsrfid.csv"))
        //    {
        //        CsvRow row = new CsvRow();
        //        row.Add(product.upc);
        //        row.Add(product.name);
        //        writer.WriteRow(row);
        //    }
        //    var request = new RestRequest("add_product", Method.POST);
        //    request.RequestFormat = DataFormat.Json;
        //    request.AddBody(product);
        //    IRestResponse response = client.Execute(request);
        //    if (!requestError(response.StatusCode.ToString()))
        //        return false;
        //    if (!response.Content.Equals("yes save"))
        //        return false;
        //    return true;
        //}

        private List <String> ListUPCUnrecognized(Hashtable productsRead, List <Product> productlist)
        {
            Boolean       find;
            List <String> productsUnr = new List <String>();
            String        epc;

            foreach (DictionaryEntry productr in productsRead)
            {
                find = false;
                //product.Key, product.Value
                foreach (Product productl in productlist)
                {
                    epc = EpcTools.getUpc(productr.Key.ToString());
                    if (productl.upc == epc)
                    {
                        find = true;  break;
                    }
                }
                if (find == false)
                {
                    productsUnr.Add(productr.Key.ToString());
                }
            }
            return(productsUnr);
        }
Esempio n. 2
0
            public SyncOrdenEsD(String epc, int quantity)
            {
                String datetime = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");

                this.orden_es_m_id = 0;
                this.epc           = epc;
                this.quantity      = quantity;
                this.updated_at    = datetime;
                this.created_at    = datetime;
                this.upc           = EpcTools.getUpc(epc.ToString());
            }
Esempio n. 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="reader"></param>
 /// <param name="folder"></param>
 /// <param name="path"></param>
 /// <param name="asstesDeletes">Names Assets</param>
 public void saveEPCs(SimpleRFID reader, String folder, String path, List <string> asstesDeletes)
 {
     Directory.CreateDirectory(folder);
     using (CsvFileWriter writer = new CsvFileWriter(path))
     {
         foreach (DictionaryEntry item in reader.m_TagTable)
         {
             if (findElemnt(asstesDeletes, EpcTools.getUpc(item.Key.ToString())) == false)
             {
                 CsvRow row = new CsvRow();
                 row.Add(item.Key.ToString());
                 writer.WriteRow(row);
             }
         }
     }
 }
        private void ReaderForm_GotFocus(object sender, EventArgs e)
        {
            if (messageForm == null)
            {
                messageForm = new MessageComparison(menu);
            }
            if (messageForm.saveDiff == true)
            {
                messageForm.saveDiff = false;
                this.Hide();
            }
            if (pushComparison == false)
            {
                menu.rrfid.clear();
                reportGrid.DataSource = null;
            }
            pushComparison = false;

            menu.rrfid.ReadHandler = delegate(String tag)
            {
                labelLog.Invoke(new tdelegate(delegate()
                {
                    labelLog.Text = "Tag: " + menu.rrfid.m_TagTable.Count.ToString();
                }));
            };

            menu.rrfid.ValidTagHandler = delegate(String tag)
            {
                return(menu.products.Exists(EpcTools.getUpc(tag)));
            };

            menu.rrfid.TriggerStopHandler = delegate()
            {
                reportGrid.Invoke(new tdelegate(delegate()
                {
                    RefreshGrid(ref reportGrid);
                }));
            };
            menu.rrfid.isTriggerActive = true;
        }
Esempio n. 5
0
        public Form1()
        {
            InitializeComponent();
            m_ReaderAPI = new RFIDReader("localhost", 5084, 0);
            m_ReaderAPI.Connect();
            m_IsConnected = true;

            m_ReaderAPI.Events.NotifyInventoryStartEvent    = true;
            m_ReaderAPI.Events.NotifyInventoryStopEvent     = true;
            m_ReaderAPI.Events.NotifyAccessStartEvent       = true;
            m_ReaderAPI.Events.NotifyAccessStopEvent        = true;
            m_ReaderAPI.Events.NotifyAntennaEvent           = true;
            m_ReaderAPI.Events.NotifyBufferFullEvent        = true;
            m_ReaderAPI.Events.NotifyBufferFullWarningEvent = true;
            m_ReaderAPI.Events.NotifyReaderExceptionEvent   = true;
            m_ReaderAPI.Events.NotifyReaderDisconnectEvent  = true;
            m_ReaderAPI.Events.StatusNotify += new Events.StatusNotifyHandler(Events_StatusNotify);
            m_ReaderAPI.Events.ReadNotify   += new Events.ReadNotifyHandler(Events_ReadNotify);
            myDelegate = new AddListItem(addTag);

            labelLog.Text = "Probando " + EpcTools.getUpc("E20068060000000000000000");
        }
Esempio n. 6
0
        private void UPCSearchForm_GotFocus(object sender, EventArgs e)
        {
            EPCList.Items.Clear();
            menu.rrfid.ReadHandler = delegate(String tag)
            {
                TagsLabel.Invoke(new tdelegate(delegate()
                {
                    TagsLabel.Text = "Tag: " + menu.rrfid.m_TagTable.Count.ToString();
                    EPCList.Items.Add(tag);
                }));
            };

            menu.rrfid.ValidTagHandler = delegate(String tag)
            {
                return(EpcTools.getUpc(tag) == UPCLabel.Invoke(new tdelegate1(delegate()
                {
                    return UPCLabel.Text;
                })).ToString());

                //return true;
            };

            menu.rrfid.isTriggerActive = true;
        }