private void AddItemToList(FIA_Biosum_Manager.RxItemHarvestCostColumnItem oItem)
        {
            this.lvRxHarvestCostColumns.Items.Add("");
            this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].UseItemStyleForSubItems = false;
            for (int z = 1; z <= this.lvRxHarvestCostColumns.Columns.Count - 1; z++)
            {
                this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems.Add(" ");
            }

            this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems[COLUMN_RX].Text    = oItem.RxId;
            this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems[COLUMN_FIELD].Text = oItem.HarvestCostColumn;
            this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems[COLUMN_DESC].Text  = oItem.Description;


            this.m_oLvAlternateRowColors.AddRow();
            this.m_oLvAlternateRowColors.AddColumns(lvRxHarvestCostColumns.Items.Count - 1, this.lvRxHarvestCostColumns.Columns.Count);


            ReferenceFormRxItem.m_bToolBarButtonEnabled[frmRxItem.UC_HARVESTCOST, frmRxItem.BUTTON_CLEARALL] = true;
            ReferenceFormRxItem.m_bToolBarButtonEnabled[frmRxItem.UC_HARVESTCOST, frmRxItem.BUTTON_DELETE]   = true;
            ReferenceFormRxItem.m_bToolBarButtonEnabled[frmRxItem.UC_HARVESTCOST, frmRxItem.BUTTON_EDIT]     = true;
            ReferenceFormRxItem.SetToolBarButtonsEnabled(frmRxItem.UC_HARVESTCOST);

            this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].Selected = true;
        }
        public void loadvalues()
        {
            int x, y, z;

            m_oQueries.m_oFvs.LoadDatasource       = true;
            m_oQueries.m_oReference.LoadDatasource = true;
            m_oQueries.m_oProcessor.LoadDatasource = true;
            m_oQueries.LoadDatasources(true);
            m_oAdo = new ado_data_access();
            m_oAdo.OpenConnection(m_oAdo.getMDBConnString(m_oQueries.m_strTempDbFile, "", ""));

            this.lvRxHarvestCostColumns.Clear();

            this.m_oLvAlternateRowColors.InitializeRowCollection();
            this.lvRxHarvestCostColumns.Columns.Add("", 2, HorizontalAlignment.Left);
            this.lvRxHarvestCostColumns.Columns.Add("Rx", 80, HorizontalAlignment.Left);
            this.lvRxHarvestCostColumns.Columns.Add("Harvest Cost Component", 200, HorizontalAlignment.Left);
            this.lvRxHarvestCostColumns.Columns.Add("Description", 300, HorizontalAlignment.Left);

            this.m_intError = 0;
            this.m_strError = "";

            if (this.ReferenceFormRxItem.m_oRxItem.ReferenceHarvestCostColumnCollection != null)
            {
                this.lvRxHarvestCostColumns.BeginUpdate();

                for (x = 0; x <= this.ReferenceFormRxItem.m_oRxItem.ReferenceHarvestCostColumnCollection.Count - 1; x++)
                {
                    if (ReferenceFormRxItem.m_oRxItem.ReferenceHarvestCostColumnCollection.Item(x).Delete == false)
                    {
                        FIA_Biosum_Manager.RxItemHarvestCostColumnItem oItem =
                            ReferenceFormRxItem.m_oRxItem.ReferenceHarvestCostColumnCollection.Item(x);
                        this.lvRxHarvestCostColumns.Items.Add("");
                        this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].UseItemStyleForSubItems = false;
                        for (z = 1; z <= this.lvRxHarvestCostColumns.Columns.Count - 1; z++)
                        {
                            this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems.Add(" ");
                        }
                        this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems[COLUMN_RX].Text    = oItem.RxId;
                        this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems[COLUMN_FIELD].Text = oItem.HarvestCostColumn;
                        this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems[COLUMN_DESC].Text  = oItem.Description;

                        this.m_oLvAlternateRowColors.AddRow();
                        this.m_oLvAlternateRowColors.AddColumns(lvRxHarvestCostColumns.Items.Count - 1, this.lvRxHarvestCostColumns.Columns.Count);
                    }
                }
                this.lvRxHarvestCostColumns.EndUpdate();
            }


            this.m_oLvAlternateRowColors.ListView();

            if (this.lvRxHarvestCostColumns.Items.Count > 0)
            {
                this.lvRxHarvestCostColumns.Items[0].Selected = true;
                ReferenceFormRxItem.m_bToolBarButtonEnabled[frmRxItem.UC_HARVESTCOST, frmRxItem.BUTTON_CLEARALL] = true;
                ReferenceFormRxItem.m_bToolBarButtonEnabled[frmRxItem.UC_HARVESTCOST, frmRxItem.BUTTON_DELETE]   = true;
                ReferenceFormRxItem.m_bToolBarButtonEnabled[frmRxItem.UC_HARVESTCOST, frmRxItem.BUTTON_EDIT]     = true;
            }
        }
Exemplo n.º 3
0
        private void AddItemToList(int p_intCycle, FIA_Biosum_Manager.RxItemHarvestCostColumnItem oItem)
        {
            this.lvRxHarvestCostColumns.Items.Add("");
            this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].UseItemStyleForSubItems = false;
            for (int z = 1; z <= this.lvRxHarvestCostColumns.Columns.Count - 1; z++)
            {
                this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems.Add(" ");
            }

            this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems[COLUMN_PACKAGE].Text = this.ReferenceFormRxPackageItem.m_oRxPackageItem.RxPackageId;
            this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems[COLUMN_RX].Text      = oItem.RxId;
            this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems[COLUMN_CYCLE].Text   = p_intCycle.ToString().Trim();
            this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems[COLUMN_FIELD].Text   = oItem.HarvestCostColumn;
            this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].SubItems[COLUMN_DESC].Text    = oItem.Description;


            this.m_oLvAlternateRowColors.AddRow();
            this.m_oLvAlternateRowColors.AddColumns(lvRxHarvestCostColumns.Items.Count - 1, this.lvRxHarvestCostColumns.Columns.Count);


            this.lvRxHarvestCostColumns.Items[lvRxHarvestCostColumns.Items.Count - 1].Selected = true;
        }