public bool Delete(int Id) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { ProductInCatalogEntity _ProductInCatalogEntity = new ProductInCatalogEntity(Id); if (adapter.FetchEntity(_ProductInCatalogEntity)) { adapter.DeleteEntity(_ProductInCatalogEntity); toReturn = true; } } return toReturn; }
EntityCollection<ProductInCatalogEntity> getGetListCat(ProductsEntity product) { EntityCollection<ProductInCatalogEntity> items = new EntityCollection<ProductInCatalogEntity>(); int[] cats = ucCatalogs.getListCatId(); for (int i = 0; i < cats.Length; i++) { ProductInCatalogEntity item = new ProductInCatalogEntity(); item.ProductId = product.Id; item.CatId = cats[i]; item.OrderIndex = i; items.Add(item); } return items; }
public bool Update(int Id, int CatId, Guid ProductId, int OrderIndex) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { ProductInCatalogEntity _ProductInCatalogEntity = new ProductInCatalogEntity(Id); if (adapter.FetchEntity(_ProductInCatalogEntity)) { _ProductInCatalogEntity.CatId = CatId; _ProductInCatalogEntity.ProductId = ProductId; _ProductInCatalogEntity.OrderIndex = OrderIndex; adapter.SaveEntity(_ProductInCatalogEntity, true); toReturn = true; } } return toReturn; }
public bool Update(ProductInCatalogEntity _ProductInCatalogEntity, RelationPredicateBucket filter) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { adapter.UpdateEntitiesDirectly(_ProductInCatalogEntity, filter); toReturn = true; } return toReturn; }
public bool Update(ProductInCatalogEntity _ProductInCatalogEntity) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { RelationPredicateBucket filter = new RelationPredicateBucket(); IPredicateExpression _PredicateExpression = new PredicateExpression(); _PredicateExpression.Add(ProductInCatalogFields.Id == _ProductInCatalogEntity.Id); filter.PredicateExpression.Add(_PredicateExpression); adapter.UpdateEntitiesDirectly(_ProductInCatalogEntity, filter); toReturn = true; } return toReturn; }
public ProductInCatalogEntity SelectOne(int Id) { ProductInCatalogEntity toReturn = null; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { ProductInCatalogEntity _ProductInCatalogEntity = new ProductInCatalogEntity(Id); if (adapter.FetchEntity(_ProductInCatalogEntity)) { toReturn = _ProductInCatalogEntity; } } return toReturn; }
public ProductInCatalogEntity Insert(int CatId, Guid ProductId, int OrderIndex) { ProductInCatalogEntity _ProductInCatalogEntity = new ProductInCatalogEntity(); using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { _ProductInCatalogEntity.CatId = CatId; _ProductInCatalogEntity.ProductId = ProductId; _ProductInCatalogEntity.OrderIndex = OrderIndex; adapter.SaveEntity(_ProductInCatalogEntity, true); } return _ProductInCatalogEntity; }
public ProductInCatalogEntity Insert(ProductInCatalogEntity _ProductInCatalogEntity) { using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { adapter.SaveEntity(_ProductInCatalogEntity, true); } return _ProductInCatalogEntity; }