public StudentGroup_TeacherSerialized(studentgroup_teacher sgt) { base.ObjectId = sgt.ObjectId; base.CreatedAt = sgt.CreatedAt; base.UpdatedAt = sgt.UpdatedAt; //base.Id = 0; if (sgt.School != null) { SchoolSerialized ss = new SchoolSerializedDAO().LoadByObjectId(sgt.School.ObjectId); if (ss != null) { this.SchoolSerialized = ss; } else { //Debug.Log ("Serialized: There is no relationship saved"); } } if (sgt.StudentGroup != null) { StudentGroupSerialized sgs = new StudentGroupSerializedDAO().LoadByObjectId(sgt.StudentGroup.ObjectId); if (sgs != null) { this.StudentGroupSerialized = sgs; } else { //Debug.Log ("Serialized: There is no relationship saved"); } } if (sgt.Teacher != null) { TeacherSerialized ts = new TeacherSerializedDAO().LoadByObjectId(sgt.Teacher.ObjectId); if (ts != null) { this.TeacherSerialized = ts; } else { //Debug.Log ("Serialized: There is no relationship saved"); } } }
public StudentSerialized(Student s) { base.ObjectId = s.ObjectId; this.BirthDate = s.BirthDate; this.BuildingsCount = s.BuildingsCount; this.Coins = s.Coins; this.DiagnosisLevel = s.DiagnosisLevel; this.Gender = s.Gender; this.Guardian = s.Guardian; this.Name = s.Name; this.LastName = s.LastName; if (s.School != null) { SchoolSerialized ss = new SchoolSerializedDAO().LoadByObjectId(s.School.ObjectId); if (ss != null) { this.SchoolSerialized = ss; } else { //Debug.Log ("Serialized: There is no relationship saved"); } } if (s.StudentGroup != null) { StudentGroupSerialized sgs = new StudentGroupSerializedDAO().LoadByObjectId(s.StudentGroup.ObjectId); if (sgs != null) { this.StudentGroupSerialized = sgs; } else { //Debug.Log ("[ObjectId: " + s.StudentGroup.ObjectId + "] Serialized: There is no relationship saved"); } } }