internal void Update(Convocatoria_Curso parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } OidConvocatoria = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } AlumnoCursoRecord obj = parent.Session().Get <AlumnoCursoRecord>(Oid); obj.CopyValues(this.Base.Record); parent.Session().Update(obj); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
internal void DeleteSelf(Convocatoria_Curso 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 { parent.Session().Delete(parent.Session().Get <AlumnoCursoRecord>(Oid)); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkNew(); }
internal void Update(Convocatoria_Curso parent) { this.RaiseListChangedEvents = false; // update (thus deleting) any deleted child objects foreach (AlumnoCurso 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 (AlumnoCurso obj in this) { if (obj.IsNew) { obj.Insert(parent); } else { obj.Update(parent); } } this.RaiseListChangedEvents = true; }
public void CopyValues(Convocatoria_Curso source) { if (source == null) { return; } _record.CopyValues(source.Base.Record); }
protected override void DataPortal_Execute() { // Buscar por codigo CriteriaEx criteria = Convocatoria_Curso.GetCriteria(Convocatoria_Curso.OpenSession()); criteria.AddCodeSearch(_codigo); Convocatoria_CursoList list = Convocatoria_CursoList.GetList(criteria); _exists = !(list.Count == 0); }
// private Convocatoria_CursoList() { } /// <summary> /// Retrieve the complete list from db /// </summary> /// <returns>Convocatoria_CursoList</returns> public static Convocatoria_CursoList GetList(bool childs) { CriteriaEx criteria = Convocatoria_Curso.GetCriteria(Convocatoria_Curso.OpenSession()); criteria.Childs = childs; //No criteria. Retrieve all de List Convocatoria_CursoList list = DataPortal.Fetch <Convocatoria_CursoList>(criteria); CloseSession(criteria.SessionCode); return(list); }
public static AlumnoCurso NewChild(Convocatoria_Curso parent) { if (!CanAddObject()) { throw new System.Security.SecurityException( moleQule.Library.Resources.Messages.USER_NOT_ALLOWED); } AlumnoCurso obj = new AlumnoCurso(); obj.OidConvocatoria = parent.Oid; return(obj); }
private void DataPortal_Fetch(CriteriaEx criteria) { try { SessionCode = criteria.SessionCode; Childs = criteria.Childs; if (nHMng.UseDirectSQL) { Curso.DoLOCK(Session()); IDataReader reader = nHMng.SQLNativeSelect(criteria.Query); if (reader.Read()) { _base.CopyValues(reader); } if (Childs) { string query = string.Empty; Curso_Instructor.DoLOCK(Session()); query = Curso_Instructors.SELECT_BY_CURSO(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _c_profesores = Curso_Instructors.GetChildList(reader); Convocatoria_Curso.DoLOCK(Session()); query = Convocatoria_Cursos.SELECT_BY_CURSO(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _convocatorias = Convocatoria_Cursos.GetChildList(criteria.SessionCode, reader); MaterialDocente.DoLOCK(Session()); query = MaterialDocentes.SELECT_BY_CURSO(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _materiales = MaterialDocentes.GetChildList(criteria.SessionCode, reader); } } } catch (Exception exception) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(exception); } }
public static Alumno_Convocatoria NewChild(Convocatoria_Curso parent, AlumnoClienteInfo source) { if (!CanAddObject()) { throw new System.Security.SecurityException( moleQule.Library.Resources.Messages.USER_NOT_ALLOWED); } Alumno_Convocatoria obj = new Alumno_Convocatoria(); obj.OidConvocatoria = parent.Oid; obj.OidAlumno = source.OidAlumno; obj.Nombre = source.Alumno; obj.Cliente = source.Cliente; obj.OidCliente = source.OidCliente; return(obj); }
public static Alumno_Convocatoria NewChild(Convocatoria_Curso parent, AlumnoInfo alumno, ClienteInfo cliente) { if (!CanAddObject()) { throw new System.Security.SecurityException( moleQule.Library.Resources.Messages.USER_NOT_ALLOWED); } Alumno_Convocatoria obj = new Alumno_Convocatoria(); obj.OidConvocatoria = parent.Oid; obj.OidAlumno = alumno.Oid; obj.Nombre = alumno.Nombre + " " + alumno.Apellidos; obj.Cliente = cliente.Nombre; obj.OidCliente = cliente.Oid; return(obj); }
public void CopyFrom(Convocatoria_Curso source) { _base.CopyValues(source); }
public AlumnoCurso NewItem(Convocatoria_Curso parent) { this.AddItem(AlumnoCurso.NewChild(parent)); return(this[Count - 1]); }
public Alumno_Convocatoria NewItem(Convocatoria_Curso parent, AlumnoClienteInfo source) { this.AddItem(Alumno_Convocatoria.NewChild(parent, source)); return(this[Count - 1]); }
public Alumno_Convocatoria NewItem(Convocatoria_Curso parent, AlumnoInfo alumno, ClienteInfo cliente) { this.AddItem(Alumno_Convocatoria.NewChild(parent, alumno, cliente)); return(this[Count - 1]); }