public void AddDataStuden(String name, int age, String tell) { ModelStuden lists_t = new ModelStuden(); lists_t.StudenID = Guid.NewGuid().ToString(); lists_t.StudenName = name; lists_t.StudenAge = age; lists_t.StudenPhon = tell; listStuden.Add(lists_t); }
public ModelClass AddDataClassRoomStuden(string idcallroom, string idstuden) { ModelStuden modelS = listStuden.Find(t => t.StudenID == idstuden); ModelClass modelC = listClassRoom.Find(t => t.ClassroomID == idcallroom); modelC.modelStuden = listStuden.Find(t => t.StudenID == idstuden); int index = listClassRoom.FindIndex(t => t.ClassroomID == t.ClassroomID); listClassRoom.RemoveAt(index); listClassRoom.Add(modelC); return(listClassRoom.Find(t => t.ClassroomID == idcallroom)); }
public bool UpdateDataStuden(ModelStuden item) { if (item == null) { throw new ArgumentNullException("item"); } int index = listStuden.FindIndex(t => t.StudenID == t.StudenID); if (index == -1) { return(false); } listStuden.RemoveAt(index); listStuden.Add(item); return(true); }