public bool Contains(Types value) { return(List.Contains(value)); }
public void Remove(Types value) { List.Remove(value); }
public void Insert(int index, Types value) { List.Insert(index, value); }
public int IndexOf(Types value) { return(List.IndexOf(value)); }
public int Add(Types value) { return(List.Add(value)); }
///<summary> /// Lấy tất cả đối tượng /// ///</summary> public TypesCollection Getlist(string sTextSearch) { Data objData; if (objDataAccess == null) { objData = new Data(); } else { objData = objDataAccess; } TypesCollection col = null; try { if (objData.GetConnection() == null || objData.GetConnection().State == ConnectionState.Closed) { objData.Connect(); } objData.CreateNewStoredProcedure("sproc_Types_Getlist"); objData.AddParameter("@TextSearch", sTextSearch); IDataReader reader = objData.ExecStoreToDataReader(); while (reader.Read()) { if (col == null) { col = new TypesCollection(); } Types obj = new Types(); if (!Convert.IsDBNull(reader["TypeID"])) { obj.TypeID = Convert.ToInt32(reader["TypeID"]); } if (!Convert.IsDBNull(reader["TypeName"])) { obj.TypeName = Convert.ToString(reader["TypeName"]); } if (!Convert.IsDBNull(reader["Link"])) { obj.Link = Convert.ToString(reader["Link"]); } if (!Convert.IsDBNull(reader["Sort"])) { obj.Sort = Convert.ToString(reader["Sort"]); } if (!Convert.IsDBNull(reader["Status"])) { obj.IsActived = Convert.ToBoolean(reader["Status"]); } col.Add(obj); } reader.Close(); reader.Dispose(); } catch (Exception objEx) { throw new Exception("Getlist() Error " + objEx.Message.ToString()); } finally { if (objDataAccess == null) { objData.DeConnect(); } } return(col); }