public bool Delete(int Id) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { VideoCatalogEntity _VideoCatalogEntity = new VideoCatalogEntity(Id); if (adapter.FetchEntity(_VideoCatalogEntity)) { adapter.DeleteEntity(_VideoCatalogEntity); toReturn = true; } } return toReturn; }
public bool Update(int Id, string TextId, string CatName, int ParentId) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { VideoCatalogEntity _VideoCatalogEntity = new VideoCatalogEntity(Id); if (adapter.FetchEntity(_VideoCatalogEntity)) { _VideoCatalogEntity.TextId = TextId; _VideoCatalogEntity.CatName = CatName; _VideoCatalogEntity.ParentId = ParentId; adapter.SaveEntity(_VideoCatalogEntity, true); toReturn = true; } } return toReturn; }
public bool Update(VideoCatalogEntity _VideoCatalogEntity, RelationPredicateBucket filter) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { adapter.UpdateEntitiesDirectly(_VideoCatalogEntity, filter); toReturn = true; } return toReturn; }
public bool Update(VideoCatalogEntity _VideoCatalogEntity) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { RelationPredicateBucket filter = new RelationPredicateBucket(); IPredicateExpression _PredicateExpression = new PredicateExpression(); _PredicateExpression.Add(VideoCatalogFields.Id == _VideoCatalogEntity.Id); filter.PredicateExpression.Add(_PredicateExpression); adapter.UpdateEntitiesDirectly(_VideoCatalogEntity, filter); toReturn = true; } return toReturn; }
public VideoCatalogEntity SelectOne(int Id) { VideoCatalogEntity toReturn = null; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { VideoCatalogEntity _VideoCatalogEntity = new VideoCatalogEntity(Id); if (adapter.FetchEntity(_VideoCatalogEntity)) { toReturn = _VideoCatalogEntity; } } return toReturn; }
public VideoCatalogEntity Insert(string TextId, string CatName, int ParentId) { VideoCatalogEntity _VideoCatalogEntity = new VideoCatalogEntity(); using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { _VideoCatalogEntity.TextId = TextId; _VideoCatalogEntity.CatName = CatName; _VideoCatalogEntity.ParentId = ParentId; adapter.SaveEntity(_VideoCatalogEntity, true); } return _VideoCatalogEntity; }
public VideoCatalogEntity Insert(VideoCatalogEntity _VideoCatalogEntity) { using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { adapter.SaveEntity(_VideoCatalogEntity, true); } return _VideoCatalogEntity; }
VideoCatalogEntity getCatalog() { VideoCatalogEntity ob = new VideoCatalogEntity(); ob.CatName = txtCatName.Text.Trim(); return ob; }