예제 #1
0
        public InventoryForm(MenuForm form)
        {
            InitializeComponent();
            menu = form;
            setColors(menu.configData);
            switch ((Global.Version)menu.configData.version)
            {
            case Global.Version.ISCAM:
            case Global.Version.INVENTORY_PLACE:
                break;

            case Global.Version.INVENTORY:
                WarehouseBox.Visible = false;
                break;
            }
            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);
            }
            messageForm = new MessageComparison(menu);
            folioForm   = new ListAssetsForm(menu);
        }
예제 #2
0
        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;
            }
        }