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

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