Ejemplo n.º 1
0
        protected override List <object> GetDataSource()
        {
            DeptBll deptBll = new DeptBll(AppSettings.CurrentSetting.ParkConnect);

            depts = deptBll.GetAllDepts().QueryObjects.ToList();
            List <object> source = new List <object>();

            foreach (object o in depts)
            {
                source.Add(o);
            }
            return(source);
        }
Ejemplo n.º 2
0
        public void Init()
        {
            DeptBll bll = new DeptBll(Ralid.Park.BusinessModel.Configuration.AppSettings.CurrentSetting.ParkConnect);
            //this.DataSource = bll.GetAllDepts().QueryObjects;

            List <DeptInfo> items = bll.GetAllDepts().QueryObjects;

            this.Items.Clear();
            this.Items.Add("");
            foreach (var item in items)
            {
                this.Items.Add(item);
            }

            this.DisplayMember = "DeptName";
            this.ValueMember   = "DeptID";
            this.DropDownStyle = ComboBoxStyle.DropDownList;
        }