private void LoadWorlds() { _dictionworld.Clear(); _dictionentity.Clear(); if (StoreId > 0) { List <StoreToWorld> lst = _service.FindAllForStore(StoreId); if (lst != null) { foreach (StoreToWorld sw in lst) { _dictionworld[sw.WorldID] = sw; _dictionentity[sw.ID] = sw; } } } }
private long LoadByStore(long storeid, long worldid) { List <StoreToWorld> lst = _service.FindAllForStore(storeid); StoreToWorld entity = null; Dictionary <long, StoreToWorld> newitem = new Dictionary <long, StoreToWorld>(); if (lst != null) { foreach (StoreToWorld sw in lst) { newitem[sw.WorldID] = sw; _dictionentity[sw.ID] = sw; if (sw.WorldID == worldid) { entity = sw; } } } _dictionbyStore[storeid] = newitem; return((entity != null) ? 0 : entity.ID); }