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

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