internal void Update(ClaseAuditoria parent) { this.RaiseListChangedEvents = false; // update (thus deleting) any deleted child objects foreach (TipoAuditoria 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 (TipoAuditoria obj in this) { if (obj.IsNew) { obj.Insert(parent); } else { obj.Update(parent); } } this.RaiseListChangedEvents = true; }
internal void DeleteSelf(ClaseAuditoria 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 <TipoAuditoriaRecord>(Oid)); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkNew(); }
public void CopyValues(ClaseAuditoria source) { if (source == null) { return; } _record.CopyValues(source.Base.Record); }
public static TipoAuditoria NewChild(ClaseAuditoria parent) { if (!CanAddObject()) { throw new System.Security.SecurityException( moleQule.Library.Resources.Messages.USER_NOT_ALLOWED); } TipoAuditoria obj = new TipoAuditoria(); obj.OidClaseAuditoria = parent.Oid; obj.GetNewCode(parent); return(obj); }
public virtual void GetNewCode(ClaseAuditoria parent) { Serial = SerialInfo.GetNext(typeof(TipoAuditoria)); foreach (TipoAuditoria item in parent.TipoAuditorias) { if (item.Serial >= Serial) { Serial = item.Serial + 1; } } Codigo = Serial.ToString(Resources.Defaults.TIPO_AUDITORIA_CODE_FORMAT); Numero = parent.Numero + "." + Serial.ToString(); }
/// <summary> /// Retrieve the complete list from db /// </summary> /// <param name="get_childs">retrieving the childs</param> /// <returns></returns> public static ClaseAuditoriaList GetList(bool childs) { CriteriaEx criteria = ClaseAuditoria.GetCriteria(ClaseAuditoria.OpenSession()); criteria.Childs = childs; //No criteria. Retrieve all de List if (nHManager.Instance.UseDirectSQL) { criteria.Query = ClaseAuditoriaList.SELECT(); } ClaseAuditoriaList list = DataPortal.Fetch <ClaseAuditoriaList>(criteria); CloseSession(criteria.SessionCode); return(list); }
internal void Update(ClaseAuditoria 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; OidClaseAuditoria = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } TipoAuditoriaRecord obj = parent.Session().Get <TipoAuditoriaRecord>(Oid); obj.CopyValues(this.Base.Record); parent.Session().Update(obj); _criterios.Update(this); _areas.Update(this); _cuestiones.Update(this); _planes_tipos.Update(this); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
public static string SELECT() { return(ClaseAuditoria.SELECT(new QueryConditions(), false)); }
public TipoAuditoria NewItem(ClaseAuditoria parent) { this.AddItem(TipoAuditoria.NewChild(parent)); return(this[Count - 1]); }
public void CopyFrom(ClaseAuditoria source) { _base.CopyValues(source); }