コード例 #1
0
        private void FrmAnbarGroup_Load(object sender, EventArgs e)
        {
            Set_Data();
            var accounts = AnbarGroupBussines.GetAll().ToList();
            AutoCompleteStringCollection _source = new AutoCompleteStringCollection();

            foreach (var item in accounts)
            {
                _source.Add(item.Name);
            }

            txtName.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
            txtName.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txtName.AutoCompleteCustomSource = _source;
        }
コード例 #2
0
        public void LoadData(string search = "")
        {
            try
            {
                if (search == "")
                {
                    var lst = AnbarGroupBussines.GetAll().Where(q => q.Status).OrderBy(q => q.Name).ToList();
                    AnbarGroupBindingSource.DataSource = lst.ToList();
                }
                else
                {
                    var list = AnbarGroupBussines.Search(search).Where(q => q.Status).OrderBy(q => q.Name).ToList();
                    AnbarGroupBindingSource.DataSource = list;
                }

                lblCounter.Text = AnbarGroupBindingSource.Count.ToString();
            }
            catch (Exception exception)
            {
                frmMessage frm = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, exception.Message);
                frm.ShowDialog();
            }
        }
コード例 #3
0
        private void LoadGroups()
        {
            var lst = AnbarGroupBussines.GetAll().OrderBy(q => q.Name).ToList();

            cmbGroup.DataSource = lst;
        }