private void createPrintFile() { string finaltextfile = ""; string temptemplate = ""; string epc = ""; EpcTools epctool = new EpcTools(); foreach (TagPrint tag in tprint) { if (tag.count > 0) { for (int i = 0; i < tag.count; i++) { temptemplate = ttemplate; epc = epctool.getNewEPC(48, 1, 5, tag.upc, tsequence[tag.upc].Sequence); temptemplate = temptemplate.Replace("<<EPC>>", epc); temptemplate = temptemplate.Replace("<<UPC>>", tag.upc); temptemplate = temptemplate.Replace("<<NAME>>", tag.name); temptemplate = temptemplate.Replace("<<BARCODEEPC>>", tag.upc); finaltextfile = finaltextfile + temptemplate; temptemplate = ""; tsequence[tag.upc].Sequence++; } } } setSequence(rconfig.SequenceFilePath); File.WriteAllText(AssemblyDirectory + "\\printfile.txt", finaltextfile); }
public List <UpcInventory> fillUPCsInventory(AssetsList productlist) { String upc = ""; UpcInventory UpcObject; List <UpcInventory> UpcList = new List <UpcInventory>(); List <UpcInventory> UpcFinalList = new List <UpcInventory>(); Dictionary <String, int> UpcIndex = new Dictionary <string, int>(); foreach (Asset prod in productlist.getAll()) { UpcObject = new UpcInventory(prod.upc, prod.name, prod.place_id); UpcIndex.Add(prod.upc, UpcList.Count); UpcList.Add(UpcObject); } foreach (DictionaryEntry item in m_TagTable) { upc = EpcTools.getUpc(item.Value.ToString()); UpcList[UpcIndex[upc]].total++; } foreach (UpcInventory UpcO in UpcList) { if (UpcO.total != 0) { UpcFinalList.Add(UpcO); } } return(UpcFinalList); }
private void OrderWarehouseForm_GotFocus(object sender, EventArgs e) { if (messageForm == null) { messageForm = new MessageComparison(menu); } 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; WarehouseBox.Items.Clear(); ComboboxItem item; foreach (Warehouse entry in menu.warehouses.collection) { item = new ComboboxItem(); item.Text = entry.name; item.Value = entry.id; WarehouseBox.Items.Add(item); } }
//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); }
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()); }
/// <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; }
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"); }
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; }