private void Fetch(string pdNumber) { var rlce = RaiseListChangedEvents; RaiseListChangedEvents = false; IsReadOnly = false; using (var dalManager = DalFactory.GetManager(DalManagerTypes.DalManagerDb)) { IComponentDal dal = dalManager.GetProvider <IComponentDal>(); IList <ComponentDto> data = null; if (string.IsNullOrEmpty(pdNumber)) { data = dal.Fetch(); } else { data = dal.FetchAllWSamePDNumber(pdNumber); } if (data != null) { foreach (var item in data) { Add(DataPortal.FetchChild <ComponentInfo>(item)); } } RaiseListChangedEvents = rlce; IsReadOnly = true; } }
private void DataPortal_Fetch() { var rlce = RaiseListChangedEvents; RaiseListChangedEvents = false; IsReadOnly = false; using (var dalManager = DalFactory.GetManager()) { IComponentDal dal = dalManager.GetProvider <IComponentDal>(); IList <ComponentDto> data = dal.Fetch(); if (data != null) { foreach (var item in data) { Add(DataPortal.FetchChild <ComponentInfo>(item)); } } } }