Beispiel #1
0
 private void ListAssetsForm_GotFocus(object sender, EventArgs e)
 {
     if (firstFocus)
     {
         firstFocus = false;
         ProductTable table     = new ProductTable();
         FolioOrder   folio     = new FolioOrder(menu);
         RespFolio    respFolio = folio.getFolioFtp(menu.ftpConfig.server_name,
                                                    menu.ftpConfig.user_name, menu.ftpConfig.user_password, this.folio);
         if (respFolio != null)
         {
             foreach (RespFolio.Products prod in respFolio.products)
             {
                 table.addRow(prod.upc, prod.name, prod.quantity.ToString());
             }
             DataView view = new DataView(table);
             reportGrid.DataSource = view;
             reportGrid.TableStyles.Clear();
             reportGrid.TableStyles.Add(table.getStyle());
         }
         else
         {
             MessageBox.Show("No se encontro el archivo");
         }
     }
 }
        private void ReportBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            //ProductTable table = new ProductTable();
            //String path = (ReportBox.SelectedItem as ComboboxItem).Value.ToString();
            ProductTable table = new ProductTable();

            if (ReportBox.SelectedIndex == -1)
            {
                return;
            }
            String path = upcFiles[ReportBox.SelectedIndex];


            using (CsvFileReader reader = new CsvFileReader(path))
            {
                CsvRow rowcsv = new CsvRow();
                while (reader.ReadRow(rowcsv))
                {
                    table.addRow(rowcsv[0], rowcsv[1], rowcsv[2]);
                }
            }

            DataView view = new DataView(table);

            reportGrid.DataSource = view;
            reportGrid.TableStyles.Clear();
            reportGrid.TableStyles.Add(table.getStyle());
        }
Beispiel #3
0
        private void ListAssetsForm_GotFocus(object sender, EventArgs e)
        {
            ProductTable  table     = new ProductTable(false, true);
            Inventory     folio     = new Inventory(menu.configData.url, menu.pathFolderName);
            RespInventory respFolio = folio.GETInventoryFile();

            foreach (RespInventory.Assets asset in respFolio.assets)
            {
                table.addRow(asset.upc, asset.name, asset.place_name);
            }
            DataView view = new DataView(table);

            reportGrid.DataSource = view;
            reportGrid.TableStyles.Clear();
            reportGrid.TableStyles.Add(table.getStyle());
        }
Beispiel #4
0
        private void reportBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ProductTable table = new ProductTable(false, false);

            if (menu.configInvent.version == 2)
            {
                table = new ProductTable(false, true);
            }
            else if (menu.configInvent.version == 3)
            {
                table = new ProductTable(true, false);
            }
            //String path=@"\rfiddata\iupc"+DateTime.Parse(reportBox.Items[reportBox.SelectedIndex].ToString()).ToFileTime().ToString()+".csv";
            if (reportBox.SelectedIndex < 0)
            {
                return;
            }
            String path = upcFiles[reportBox.SelectedIndex];

            using (CsvFileReader reader = new CsvFileReader(path))
            {
                CsvRow rowcsv = new CsvRow();
                while (reader.ReadRow(rowcsv))
                {
                    if (menu.configInvent.version == 2)
                    {
                        table.addRow(rowcsv[0], rowcsv[1],
                                     getNameWarehouse(int.Parse(rowcsv[2]), menu.warehouses.collection));
                    }
                    else if (menu.configInvent.version == 3)
                    {
                        table.addRow(rowcsv[0], rowcsv[1], int.Parse(rowcsv[2]));
                    }
                }
            }
            DataView view = new DataView(table);

            reportGrid.DataSource = view;
            reportGrid.TableStyles.Clear();
            reportGrid.TableStyles.Add(table.getStyle());
        }
 private void reportGrid_MouseDown(object sender, MouseEventArgs e)
 {
     ProductTable.sortGrid(sender, e);
 }