Пример #1
0
        private void FillCampaignCombo()
        {
            IManager camp_bso = new CampaignBSO();

            _campaigns                = (ArrayList)camp_bso.GetAll();
            cboCampaign.DataSource    = _campaigns;
            cboCampaign.DisplayMember = "CampaignName";
        }
Пример #2
0
        bool IForm.Refresh()
        {
            ArrayList    campaigns;
            IManager     bso                = new CampaignBSO();
            DisplayTheme theme              = _app.Theme;
            int          row                = 1;
            int          rows               = 0;
            int          col                = 1;
            int          y_offset           = 50;
            int          first_column_width = 0;
            Graphics     g = Graphics.FromHwnd(this.Handle);

            //clear out the old links
            foreach (AfniLink link in _links)
            {
                this.Controls.Remove(link);
            }

            _links.Clear();

            campaigns = (ArrayList)bso.GetAll();
            rows      = campaigns.Count / 2;
            foreach (Campaign campaign in campaigns)
            {
                AfniLink link = new AfniLink();
                link.Text   = campaign.CampaignName;
                link.Height = 20;
                link.Width  = (int)g.MeasureString(link.Text, link.Font).Width + 50;
                if (link.Width > first_column_width)
                {
                    first_column_width = link.Width;
                }
                link.Tag             = campaign;
                link.Icon            = VLoopIcons.Next;
                link.ForeColor       = theme.SpecialFormFontColor;
                link.LinkColor       = theme.SpecialFormFontColor;
                link.ActiveLinkColor = theme.SpecialFormFontColor;
                link.Left            = (col == 1 ? 20 : first_column_width + 50);
                link.Top             = y_offset + (row * (link.Height + 10));
                link.LinkClicked    += new EventHandler(this.OnCampaignClick);
                this.Controls.Add(link);
                _links.Add(link);

                if (row == rows)
                {
                    col = 2;
                    row = 1;
                }
                else
                {
                    row++;
                }
            }


            return(true);
        }
Пример #3
0
        private void PopulateTreeView()
        {
            CampaignBSO bso = new CampaignBSO();
            TreeNode    node;

            _campaigns = bso.GetAll();
            foreach (Campaign campaign in _campaigns)
            {
                node     = _tvwMaint.Nodes[0].Nodes.Add(campaign.CampaignName);
                node.Tag = campaign;
            }
        }