示例#1
0
    public NoteSerialized(Note n)
    {
        base.ObjectId  = n.ObjectId;
        base.CreatedAt = n.CreatedAt;
        base.UpdatedAt = n.UpdatedAt;
        //base.Id = 0;

        this.NoteText  = n.NoteText;
        this.WrittenAt = n.WrittenAt;

        if (n.School != null)
        {
            SchoolSerialized ss = new SchoolSerializedDAO().LoadByObjectId(n.School.ObjectId);
            if (ss != null)
            {
                this.SchoolSerialized = ss;
            }
            else
            {
                //Debug.Log ("Serialized: There is no relationship saved");
            }
        }

        if (n.Student != null)
        {
            StudentSerialized ss = new StudentSerializedDAO().LoadByObjectId(n.Student.ObjectId);
            if (ss != null)
            {
                this.StudentSerialized = ss;
            }
            else
            {
                //Debug.Log ("Serialized: There is no relationship saved");
            }
        }

        if (n.Teacher != null)
        {
            TeacherSerialized ts = new TeacherSerializedDAO().LoadByObjectId(n.Teacher.ObjectId);
            if (ts != null)
            {
                this.TeacherSerialized = ts;
            }
            else
            {
                Debug.Log("Serialized: There is no relationship saved");
            }
        }
    }
示例#2
0
    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");
            }
        }
    }