public studentgroup_teacher(StudentGroup_TeacherSerialized sg_ts) { if (sg_ts != null) { this.ObjectId = sg_ts.ObjectId; School s = new School(); if (sg_ts.SchoolSerialized != null) { s.ObjectId = sg_ts.SchoolSerialized.ObjectId; } this.School = s; StudentGroup sg = new StudentGroup(); if (sg_ts.StudentGroupSerialized != null) { sg.ObjectId = sg_ts.StudentGroupSerialized.ObjectId; } this.StudentGroup = sg; Teacher t = new Teacher(); if (sg_ts.TeacherSerialized != null) { t.ObjectId = sg_ts.TeacherSerialized.ObjectId; } this.Teacher = t; } }
public void Add() { dt = DateTime.Now; int value = int.Parse(Qtde.text); if (popup.value == "School") { for (int i = 0; i < value; i++) { school = new SchoolSerialized("1234", "Escola Marota", "1234", "1234"); schooldao.SaveOrUpdate(school); } print(school + GetTimeWated()); } else if (popup.value == "Teacher") { for (int i = 0; i < value; i++) { ts = new TeacherSerialized("a", "*****@*****.**", true, "Sordi", "Rodrigo", "1234", "", "a", school); tsdao.SaveOrUpdate(ts); } print(ts + GetTimeWated()); } else if (popup.value == "StudentGroup_Teacher") { for (int i = 0; i < value; i++) { sg_ts = new StudentGroup_TeacherSerialized(school, ts, sgs); sg_tsdao.SaveOrUpdate(sg_ts); } print(sg_ts + GetTimeWated()); } else if (popup.value == "StudentGroup") { for (int i = 0; i < value; i++) { sgs = new StudentGroupSerialized("Group", "Manha", school, "Serie 1"); sgsdao.SaveOrUpdate(sgs); } print(sgs + GetTimeWated()); } else if (popup.value == "Student") { for (int i = 0; i < value; i++) { ss = new StudentSerialized(999999, 1l, 1000l, "", "", "", "Rodrigo", school, sgs, "Sordi"); ssdao.SaveOrUpdate(ss); } print(ss + GetTimeWated()); } }
public void LoadLast() { dt = DateTime.Now; if (popup.value == "School") { school = schooldao.LoadLast(); print(school + GetTimeWated()); } else if (popup.value == "Teacher") { ts = tsdao.LoadLast(); print(ts + GetTimeWated()); } else if (popup.value == "StudentGroup_Teacher") { sg_ts = sg_tsdao.LoadLast(); print(sg_ts + GetTimeWated()); } else if (popup.value == "StudentGroup") { sgs = sgsdao.LoadLast(); print(sgs + GetTimeWated()); } else if (popup.value == "Student") { ss = ssdao.LoadLast(); print(ss + GetTimeWated()); } /*dt = DateTime.Now; * int value = int.Parse (Index.text); * ss = dao.LoadById (value); * print (ss + GetTimeWated ()); * * * /*TeacherSerialized ts = new TeacherSerialized ("a", "*****@*****.**", true, "Sordi", "Rodrigo", "1234", "", "a", ss); * tdao.SaveOrUpdate (ts); * * foreach (TeacherSerialized aux in tdao.LoadAll ()) * Debug.Log (aux);*/ }