Пример #1
0
        private void Refresh()
        {//refetch current records...
            long   selectedAutoID = SelectedCompanyCode.AutoID;
            string autoIDs        = "";

            //bool isFirstItem = true;
            foreach (CompanyCode item in CompanyCodeList)
            {//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);
                CompanyCodeList     = new BindingList <CompanyCode>(_serviceAgent.RefreshCompanyCode(autoIDs).ToList());
                SelectedCompanyCode = (from q in CompanyCodeList
                                       where q.AutoID == selectedAutoID
                                       select q).FirstOrDefault();
                Dirty       = false;
                AllowCommit = false;
            }
        }