示例#1
0
        //load Transaction GLs - lstTransGL
        private void loadLstTransGL()
        {
            ArrayList arrNew = new ArrayList();

            String[] tmpArray = InfoLoader.loadAllGLs().Split('\n');
            for (int i = 0; i < tmpArray.Length; i++)
            {
                String[] cols = tmpArray[i].Split('\t');
                if (cols.Length == 3)
                {
                    arrNew.Add(new ListValues(cols[0], cols[1] + "    " + cols[2], ListValues.FORWARD));
                }
            }

            if (arrNew.Count > 0)
            {
                lstTransGL.DataSource    = arrNew;
                lstTransGL.DisplayMember = "Desc";
                lstTransGL.ValueMember   = "ID";
                lstTransGL.ClearSelected();
            }
            else
            {
                lstTransGL.DataSource = null;
            }
        }
        private void loadLstGLs()
        {
            // Create an instance of a ListView column sorter and assign it
            // to the ListView control.
            lvwColumnSorter = new ListViewColumnSorter();
            this.lstGLs.ListViewItemSorter = lvwColumnSorter;

            ArrayList arrNew = new ArrayList();

            String[] tmpArray = InfoLoader.loadAllGLs().Split('\n'); //
            selectedGLID = "";

            lstGLs.BeginUpdate();
            lstGLs.Clear();
            lstGLs.Columns.Add("GLs", 195, HorizontalAlignment.Left);
            lstGLs.Columns.Add("_SortGLs", 0, HorizontalAlignment.Left);

            //Add "All GLs" option
            ListViewItem listItem = new ListViewItem("ALL GLs");

            listItem.Name = "";
            lstGLs.Items.Add(listItem);

            //Add results from GL query
            for (int i = 0; i < tmpArray.Length; i++)
            {
                String[] cols = tmpArray[i].Split('\t');
                if (cols.Length == 3)
                {
                    listItem      = new ListViewItem(cols[1] + " " + cols[2]);
                    listItem.Name = cols[0];
                    lstGLs.Items.Add(listItem);
                }
            }
            lstGLs.EndUpdate();
        }