Esempio n. 1
0
        internal void DeleteSelf(TipoAuditoria parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            // if we're new then don't update the database
            if (this.IsNew)
            {
                return;
            }

            try
            {
                SessionCode = parent.SessionCode;
                Session().Delete(Session().Get <CriterioRecord>(Oid));
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkNew();
        }
        internal void Update(TipoAuditoria parent)
        {
            this.RaiseListChangedEvents = false;

            // update (thus deleting) any deleted child objects
            foreach (Criterio obj in DeletedList)
            {
                obj.DeleteSelf(parent);
            }

            // now that they are deleted, remove them from memory too
            DeletedList.Clear();

            // AddItem/update any current child objects
            foreach (Criterio obj in this)
            {
                if (obj.IsNew)
                {
                    obj.Insert(parent);
                }
                else
                {
                    obj.Update(parent);
                }
            }

            this.RaiseListChangedEvents = true;
        }
        internal void Update(TipoAuditoria parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            //Debe obtener la sesion del padre pq el objeto es padre a su vez
            SessionCode = parent.SessionCode;

            OidTipoAuditoria = parent.Oid;

            try
            {
                ValidationRules.CheckRules();

                if (!IsValid)
                {
                    throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR);
                }

                CuestionRecord obj = parent.Session().Get <CuestionRecord>(Oid);
                obj.CopyValues(this.Base.Record);
                parent.Session().Update(obj);

                _cuestiones.Update(this);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Esempio n. 4
0
        public void CopyValues(TipoAuditoria source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);
        }
Esempio n. 5
0
        //  private TipoAuditoriaList() { }

        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <returns>TipoAuditoriaList</returns>
        public static TipoAuditoriaList GetList()
        {
            CriteriaEx criteria = TipoAuditoria.GetCriteria(TipoAuditoria.OpenSession());

            //No criteria. Retrieve all de List
            TipoAuditoriaList list = DataPortal.Fetch <TipoAuditoriaList>(criteria);

            CloseSession(criteria.SessionCode);

            return(list);
        }
Esempio n. 6
0
        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <returns>TipoAuditoriaList</returns>
        public static TipoAuditoriaList GetClaseList(long oid_clase)
        {
            CriteriaEx criteria = TipoAuditoria.GetCriteria(TipoAuditoria.OpenSession());

            //No criteria. Retrieve all de List
            criteria.Query = TipoAuditorias.SELECT_BY_CLASE_AUDITORIA(oid_clase);
            TipoAuditoriaList list = DataPortal.Fetch <TipoAuditoriaList>(criteria);

            CloseSession(criteria.SessionCode);

            return(list);
        }
        public static Cuestion NewChild(TipoAuditoria parent)
        {
            if (!CanAddObject())
            {
                throw new System.Security.SecurityException(
                          moleQule.Library.Resources.Messages.USER_NOT_ALLOWED);
            }

            Cuestion obj = new Cuestion();

            obj.OidTipoAuditoria = parent.Oid;
            return(obj);
        }
        internal void Insert(TipoAuditoria parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            try
            {
                parent.Session().Save(this.Base.Record);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Esempio n. 9
0
        internal void Update(TipoAuditoria parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }


            try
            {
                SessionCode = parent.SessionCode;
                CriterioRecord obj = Session().Get <CriterioRecord>(Oid);
                obj.CopyValues(this.Base.Record);
                Session().Update(obj);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            try
            {
                SessionCode = criteria.SessionCode;
                Childs      = criteria.Childs;

                if (nHMng.UseDirectSQL)
                {
                    ClaseAuditoria.DoLOCK(Session());
                    IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session());

                    if (reader.Read())
                    {
                        _base.CopyValues(reader);
                    }

                    if (Childs)
                    {
                        string query = string.Empty;

                        TipoAuditoria.DoLOCK(Session());
                        query           = TipoAuditorias.SELECT_BY_CLASE_AUDITORIA(this.Oid);
                        reader          = nHManager.Instance.SQLNativeSelect(query, Session());
                        _tipoauditorias = TipoAuditorias.GetChildList(criteria.SessionCode, reader);
                    }
                }
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
        }
Esempio n. 11
0
 public Criterio NewItem(TipoAuditoria parent)
 {
     this.AddItem(Criterio.NewChild(parent));
     return(this[Count - 1]);
 }
Esempio n. 12
0
 public Plan_Tipo NewItem(TipoAuditoria parent)
 {
     this.AddItem(Plan_Tipo.NewChild(parent));
     return(this[Count - 1]);
 }
Esempio n. 13
0
 public Cuestion NewItem(TipoAuditoria parent)
 {
     this.AddItem(Cuestion.NewChild(parent));
     return(this[Count - 1]);
 }
 public void CopyFrom(TipoAuditoria source)
 {
     _base.CopyValues(source);
 }
 public Auditoria NewItem(TipoAuditoria parent)
 {
     this.AddItem(Auditoria.NewChild(parent));
     return(this[Count - 1]);
 }