public void DataBind()
        {
            IList <Course> list = dal.CourseFindAll();

            string Pram = txtfind.Text.Trim();

            if (!string.IsNullOrEmpty(Pram))
            {
                list = list.Where(o => o.CourseName.Contains(Pram)).ToList();
            }

            this.gridControl1.DataSource = new BindingList <Course>(list);;
            lblcount.Text = "共 " + list.Count + " 条";
        }
Beispiel #2
0
        public CourseCatalogControl()
        {
            InitializeComponent();
            SetCol();
            IsRefresh = true;

            CourseSqlMapDao dal = new CourseSqlMapDao();


            IList <Course> list = dal.CourseFindAll();


            txt_CourseID.Properties.ValueMember   = "CourseID";
            txt_CourseID.Properties.DisplayMember = "CourseName";
            txt_CourseID.Properties.DataSource    = list.ToList();


            txt_CourseID.EditValue = list[0].CourseID;
        }