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