コード例 #1
0
        private void StockManagerForm_Load(object sender, System.EventArgs e)
        {
            SuspendLayout();
            {
                //Fejléc
                Item item = Global.Database.SelectOne <Item>("item", new Dictionary <string, object>()
                {
                    { "ID", _stockItemID }
                });
                if (item != null)
                {
                    this.Text = "Készlet - \"" + item.Name + "\"";
                }

                //Adat
                DataGridManager.AddDataGridEntries <WarehouseStock>(gridStock, ComplexQueries.GetItemStock(_stockItemID));

                gridStock.Focus();
            }
            ResumeLayout();
        }
コード例 #2
0
        private void LoadStockTab()
        {
            int selectedEntryID = -1;

            if (gridStock.SelectedRows.Count > 0)
            {
                selectedEntryID = ((StockSummary)gridStock.SelectedRows[0].Tag).ItemID;
            }

            DataGridManager.AddDataGridEntries <StockSummary>(gridStock, ComplexQueries.GetStockSummary(), true, new Action <DataGridViewRow>(
                                                                  (DataGridViewRow row) =>
            {
                StockSummary sum = (StockSummary)row.Tag;

                if (selectedEntryID != -1 && sum.ItemID == selectedEntryID)
                {
                    row.Selected = true;
                }
            }
                                                                  ));
        }
コード例 #3
0
        private void LoadWarehouseTab()
        {
            int selectedEntryID = -1;

            if (gridWarehouse.SelectedRows.Count > 0)
            {
                selectedEntryID = ((Warehouse)gridWarehouse.SelectedRows[0].Tag).ID;
            }

            DataGridManager.AddDataGridEntries <Warehouse>(gridWarehouse, Global.Database.SelectAll <Warehouse>("warehouse"), true, new Action <DataGridViewRow>(
                                                               (DataGridViewRow row) =>
            {
                Warehouse sum = (Warehouse)row.Tag;

                if (selectedEntryID != -1 && sum.ID == selectedEntryID)
                {
                    row.Selected = true;
                }
            }
                                                               ));
        }
コード例 #4
0
        private void LoadPartnersTab()
        {
            int selectedEntryID = -1;

            if (gridPartners.SelectedRows.Count > 0)
            {
                selectedEntryID = ((Partner)gridPartners.SelectedRows[0].Tag).ID;
            }

            DataGridManager.AddDataGridEntries <Partner>(gridPartners, Global.Database.SelectAll <Partner>("partner"), true, new Action <DataGridViewRow>(
                                                             (DataGridViewRow row) =>
            {
                Partner sum = (Partner)row.Tag;

                if (selectedEntryID != -1 && sum.ID == selectedEntryID)
                {
                    row.Selected = true;
                }
            }
                                                             ));
        }
コード例 #5
0
        private void LoadItemsTab()
        {
            int selectedEntryID = -1;

            if (gridItems.SelectedRows.Count > 0)
            {
                selectedEntryID = ((ItemWithCategory)gridItems.SelectedRows[0].Tag).ID;
            }

            DataGridManager.AddDataGridEntries <ItemWithCategory>(gridItems, ComplexQueries.GetItemsWithCategories(), true, new Action <DataGridViewRow>(
                                                                      (DataGridViewRow row) =>
            {
                ItemWithCategory sum = (ItemWithCategory)row.Tag;

                if (selectedEntryID != -1 && sum.ID == selectedEntryID)
                {
                    row.Selected = true;
                }
            }
                                                                      ));
        }
コード例 #6
0
        private void LoadPartnerShipmentTab()
        {
            PartnerShipmentSummary selectedEntry = null;

            if (gridPartnerShipment.SelectedRows.Count > 0)
            {
                selectedEntry = ((PartnerShipmentSummary)gridPartnerShipment.SelectedRows[0].Tag);
            }

            DataGridManager.AddDataGridEntries <PartnerShipmentSummary>(gridPartnerShipment, ComplexQueries.GetPartnerShipmentSummary(), true, new Action <DataGridViewRow>(
                                                                            (DataGridViewRow row) =>
            {
                PartnerShipmentSummary sum = (PartnerShipmentSummary)row.Tag;

                if (selectedEntry != null && sum.ItemID == selectedEntry.ItemID && sum.PartnerID == selectedEntry.PartnerID && sum.WarehouseID == selectedEntry.WarehouseID && sum.Date == selectedEntry.Date)
                {
                    row.Selected = true;
                }
            }
                                                                            ));

            gridPartnerShipment.Sort(gridPartnerShipment.Columns["colPartnerDate"], ListSortDirection.Ascending);
        }
コード例 #7
0
 private void btnStat3_Click(object sender, EventArgs e)
 {
     DataGridManager.AddDataGridEntries <WarehouseStockStatistics>(gridStat3, ComplexQueries.GetWarehouseStatistics());
 }
コード例 #8
0
 private void btnStat2_Click(object sender, EventArgs e)
 {
     DataGridManager.AddDataGridEntries <PartnerBuyStatistics>(gridStat2, ComplexQueries.GetPartnerBuyStatistics());
 }