Beispiel #1
0
 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;
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
 public bool Update(VideoCatalogEntity _VideoCatalogEntity, RelationPredicateBucket filter)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.UpdateEntitiesDirectly(_VideoCatalogEntity, filter);
         toReturn = true;
     }
     return toReturn;
 }
Beispiel #4
0
        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;
        }
Beispiel #5
0
 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;
 }
Beispiel #6
0
        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;
        }
Beispiel #7
0
 public VideoCatalogEntity Insert(VideoCatalogEntity _VideoCatalogEntity)
 {
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.SaveEntity(_VideoCatalogEntity, true);
     }
     return _VideoCatalogEntity;
 }
Beispiel #8
0
 VideoCatalogEntity getCatalog()
 {
     VideoCatalogEntity ob = new VideoCatalogEntity();
     ob.CatName = txtCatName.Text.Trim();
     return ob;
 }