예제 #1
0
        private void Refresh()
        {   //refetch current records...
            long   selectedAutoID = SelectedCompany.AutoID;
            string autoIDs        = "";

            foreach (Company item in CompanyList)
            {//auto seeded starts at 1 any records at 0 or less or not valid records...
                if (item.AutoID > 0)
                {
                    autoIDs = autoIDs + item.AutoID.ToString() + ",";
                }
            }
            if (autoIDs.Length > 0)
            {//ditch the extra comma...
                autoIDs         = autoIDs.Remove(autoIDs.Length - 1, 1);
                CompanyList     = new BindingList <Company>(_serviceAgent.RefreshCompany(autoIDs).ToList());
                SelectedCompany = (from q in CompanyList
                                   where q.AutoID == selectedAutoID
                                   select q).FirstOrDefault();
                Dirty       = false;
                AllowCommit = false;
            }
        }