Exemplo n.º 1
0
        private void Refresh()
        {//refetch current records...
            long   selectedAutoID = SelectedMenuItemType.AutoID;
            string autoIDs        = "";

            //bool isFirstItem = true;
            foreach (MenuItemType itemType in MenuItemTypeList)
            {//auto seeded starts at 1 any records at 0 or less or not valid records...
                if (itemType.AutoID > 0)
                {
                    autoIDs = autoIDs + itemType.AutoID.ToString() + ",";
                }
            }
            if (autoIDs.Length > 0)
            {
                //ditch the extra comma...
                autoIDs              = autoIDs.Remove(autoIDs.Length - 1, 1);
                MenuItemTypeList     = new BindingList <MenuItemType>(_serviceAgent.RefreshMenuItemType(autoIDs).ToList());
                SelectedMenuItemType = (from q in MenuItemTypeList
                                        where q.AutoID == selectedAutoID
                                        select q).FirstOrDefault();
                Dirty       = false;
                AllowCommit = false;
            }
        }