internal void DeleteSelf(IncidenciaCronograma 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 <IncidenciaSesionCronogramaRecord>(Oid));
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

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

            // update (thus deleting) any deleted child objects
            foreach (IncidenciaSesionCronograma 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 (IncidenciaSesionCronograma obj in this)
            {
                if (obj.IsNew)
                {
                    obj.Insert(parent);
                }
                else
                {
                    obj.Update(parent);
                }
            }

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

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

            OidIncidencia = parent.Oid;

            try
            {
                ValidationRules.CheckRules();

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

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

            MarkOld();
        }
        public void CopyValues(IncidenciaCronograma source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);
        }
        //  private IncidenciaCronogramaList() { }

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

            criteria.Childs = childs;
            criteria.Query  = IncidenciaCronogramaList.SELECT();
            //No criteria. Retrieve all de List
            IncidenciaCronogramaList list = DataPortal.Fetch <IncidenciaCronogramaList>(criteria);

            CloseSession(criteria.SessionCode);

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

            IncidenciaSesionCronograma obj = new IncidenciaSesionCronograma();

            obj.OidIncidencia = parent.Oid;
            return(obj);
        }
 public IncidenciaSesionCronograma NewItem(IncidenciaCronograma parent)
 {
     this.AddItem(IncidenciaSesionCronograma.NewChild(parent));
     return(this[Count - 1]);
 }
 public static string SELECT()
 {
     return(IncidenciaCronograma.SELECT(0));
 }
 public void CopyFrom(IncidenciaCronograma source)
 {
     _base.CopyValues(source);
 }