示例#1
0
        // 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;
        }
示例#2
0
        internal void CopyValues(ContactoEmpresa source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source._base.Record);
        }
示例#3
0
            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);
            }
示例#4
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;
        }
示例#5
0
        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);
            }
        }
示例#6
0
 public static string SELECT()
 {
     return(ContactoEmpresa.SELECT(new QueryConditions(), false));
 }