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 SyncPicture_Click(object sender, EventArgs e) { frmsync.Show(); products = new AssetsList(pathFolderName + "products.csv"); //products_bar = new ProductsList(@"\rfiddata\products_bar.csv"); warehouses = new Warehouses(pathFolderName + "warehouses.csv"); if (sync.POSTTrans(frmsync, configData.id_user, configData.pwd, configData.id_client)) { MessageBox.Show("Sincronización exitosa", "Sincronización"); } frmsync.Hide(); }
public MenuForm() { InitializeComponent(); //Set Config Data configInvent = ConfigInventory.getConfigInventory(@"\rfiddata\config_inventory.json"); pathFolderName = getNameFolderVersion(configInvent.version); configData = Config.getConfig(pathFolderName + "config.json"); idClient = configData.id_client; //Set Synchronization sync = new Sync(configData.url, idClient, pathFolderName); //sync.GET_Test(); sync.GET(); //Set Reader rrfid = new SimpleRFID(); //Set Catalogs products = new AssetsList(pathFolderName + "products.csv"); warehouses = new Warehouses(pathFolderName + "warehouses.csv"); if (warehouses.collection.Count == 0) { MessageBox.Show("Agregar zona", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); Application.Exit(); } if (configInvent.version == 3) { configData.id_warehouse = warehouses.collection[0].id; } //Set Current Event Data frmInventory = new InventoryForm(this); reports = new InventoryReportFrm(this); search = new SearchForm(this); upcsearch = new UPCSearchForm(this); locate = new LocateForm(this); frmsync = new SyncForm(this); frmListAsset = new ListAssetsForm(this); frmEditText = new EditTextForm(this, pathFolderName + "config.json", @"\rfiddata\config_inventory.json"); this.setColors(configData); /* * Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(@"\rfiddata\img\logo.bmp"); * Image image = new Bitmap(stream); * LogoPicture.Image = image; */ string myDir = Path.GetDirectoryName(Assembly.GetCallingAssembly().GetName().CodeBase); myResDir = Path.Combine(myDir, pathFolderName + "img"); Image image; image = new Bitmap(Path.Combine(myResDir, "logo_hqh_med.bmp")); LogoPicture.Image = image; image = new Bitmap(Path.Combine(myResDir, "menu1.bmp")); ReaderPicture.Image = image; image = new Bitmap(Path.Combine(myResDir, "menu2.bmp")); ReportPicture.Image = image; image = new Bitmap(Path.Combine(myResDir, "menu3.bmp")); SearchPicture.Image = image; image = new Bitmap(Path.Combine(myResDir, "menu4.bmp")); SyncPicture.Image = image; if (configInvent.version == 2) { image = new Bitmap(Path.Combine(myResDir, "InventTotal.png")); InventoryPicture.Image = image; } }