public int CapNhat(Bai obj) { if (!InMemoryDatabase.BaiTable.ContainsKey(obj.ID)) return 0; InMemoryDatabase.BaiTable[obj.ID] = obj; return 1; }
public Test(int id, Bai bai, int diem, string moTa) { ID = id; bai.ID = bai.ID; Diem = diem; MoTa = moTa; }
public Test(int id, Bai bai, int diem, string input, string output) { ID = id; bai.ID = bai.ID; Diem = diem; Input = input; Output = output; }
public int Luu(Bai obj) { if (LayTheoMa(obj.ID) == null) { return Them(obj); } else return CapNhat(obj); }
public int Xoa(Bai obj) { throw new NotImplementedException(); }
public int CapNhat(Bai obj) { throw new NotImplementedException(); }
public Test(int id, Bai bai, int diem) { ID = id; IDBai = bai.ID; }
public Test(int id, Bai bai) { ID = id; IDBai = bai.ID; }
public int Xoa(Bai obj) { return Xoa(obj.ID); }
public int Them(Bai obj) { InMemoryDatabase.BaiTable.Add(obj.ID, obj); InMemoryDatabase.BaiNextID++; return obj.ID; }