// called to retrieve data from database protected override void Fetch(CriteriaEx criteria) { this.RaiseListChangedEvents = false; SessionCode = criteria.SessionCode; try { if (nHMng.UseDirectSQL) { ContactoEmpresa.DoLOCK("COMMON", Session()); IDataReader reader = nHManager.Instance.SQLNativeSelect(criteria.Query, Session());; IsReadOnly = false; while (reader.Read()) { this.AddItem(ContactoEmpresaInfo.Get(reader, Childs)); } IsReadOnly = true; } } catch (Exception ex) { throw new iQPersistentException(iQExceptionHandler.GetAllMessages(ex)); } this.RaiseListChangedEvents = true; }
internal void CopyValues(ContactoEmpresa source) { if (source == null) { return; } _record.CopyValues(source._base.Record); }
protected override void DataPortal_Execute() { // Buscar por Oid CriteriaEx criteria = ContactoEmpresa.GetCriteria(ContactoEmpresa.OpenSession()); criteria.AddOidSearch(_codigo); ContactoEmpresaList list = ContactoEmpresaList.GetList(criteria); _exists = (list.Count > 0); }
// called to load data from list private void Fetch(IDataReader reader) { this.RaiseListChangedEvents = false; IsReadOnly = false; while (reader.Read()) { this.AddItem(ContactoEmpresa.GetChild(reader).GetInfo()); } IsReadOnly = true; this.RaiseListChangedEvents = true; }
private void DataPortal_Fetch(CriteriaEx criteria) { try { _base.Record.Oid = 0; SessionCode = criteria.SessionCode; Childs = criteria.Childs; if (nHMng.UseDirectSQL) { //Empresa.DoLOCK(Session()); IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session()); if (reader.Read()) { _base.CopyValues(reader); } if (Childs) { //ContactoEmpresa.DoLOCK(Session()); string query = ContactoEmpresa.SELECT(this);; reader = nHManager.Instance.SQLNativeSelect(query, Session()); _contactos = ContactoEmpresas.GetChildList(reader); } } } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } }
public static string SELECT() { return(ContactoEmpresa.SELECT(new QueryConditions(), false)); }