public void deleteSV(int mssv) { foreach (SV i in ListSV) { if (i.MSSV == mssv) { ListSV.Remove(i); return; } } }
public int findIndexByMSSV(int mssv) { foreach (SV i in ListSV) { if (i.MSSV == mssv) { return(ListSV.IndexOf(i)); } } return(-1); }
public bool addSV(SV s) { if (findIndexByMSSV(s.MSSV) == -1) { ListSV.Add(s); return(true); } else { return(false); } }
public List <SV> GetAllSV() { if (ListSV != null) { ListSV.Clear(); } else { ListSV = new List <SV>(); } foreach (DataRow item in CSDL.Instance.DTSV.Rows) { SV s = new SV(); s.MSSV = item["MSSV"].ToString(); s.NameSV = item["NameSV"].ToString(); s.NS = Convert.ToDateTime(item["NS"]); s.Gender = Convert.ToBoolean(item["Gender"]); s.ID_Lop = (int)(item["ID_Lop"]); ListSV.Add(s); } return(ListSV); }