コード例 #1
0
 public bool Delete(string Id)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         VideoTypeEntity _VideoTypeEntity = new VideoTypeEntity(Id);
         if (adapter.FetchEntity(_VideoTypeEntity))
         {
             adapter.DeleteEntity(_VideoTypeEntity);
             toReturn = true;
         }
     }
     return toReturn;
 }
コード例 #2
0
        public bool Update(string Id, string TypeName, string ParentId)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                VideoTypeEntity _VideoTypeEntity = new VideoTypeEntity(Id);
                if (adapter.FetchEntity(_VideoTypeEntity))
                {

                    _VideoTypeEntity.TypeName = TypeName;
                    _VideoTypeEntity.ParentId = ParentId;
                    adapter.SaveEntity(_VideoTypeEntity, true);
                    toReturn = true;
                }
            }
            return toReturn;
        }
コード例 #3
0
 public bool Update(VideoTypeEntity _VideoTypeEntity, RelationPredicateBucket filter)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.UpdateEntitiesDirectly(_VideoTypeEntity, filter);
         toReturn = true;
     }
     return toReturn;
 }
コード例 #4
0
        public bool Update(VideoTypeEntity _VideoTypeEntity)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                RelationPredicateBucket filter = new RelationPredicateBucket();
                IPredicateExpression _PredicateExpression = new PredicateExpression();
                _PredicateExpression.Add(VideoTypeFields.Id == _VideoTypeEntity.Id);

                filter.PredicateExpression.Add(_PredicateExpression);

                adapter.UpdateEntitiesDirectly(_VideoTypeEntity, filter);
                toReturn = true;
            }
            return toReturn;
        }
コード例 #5
0
 public VideoTypeEntity SelectOne(string Id)
 {
     VideoTypeEntity toReturn = null;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         VideoTypeEntity _VideoTypeEntity = new VideoTypeEntity(Id);
         if (adapter.FetchEntity(_VideoTypeEntity))
         {
             toReturn = _VideoTypeEntity;
         }
     }
     return toReturn;
 }
コード例 #6
0
        public VideoTypeEntity Insert(string TypeName, string ParentId)
        {
            VideoTypeEntity _VideoTypeEntity = new VideoTypeEntity();
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {

                _VideoTypeEntity.TypeName = TypeName;
                _VideoTypeEntity.ParentId = ParentId;
                adapter.SaveEntity(_VideoTypeEntity, true);
            }
            return _VideoTypeEntity;
        }
コード例 #7
0
 public VideoTypeEntity Insert(VideoTypeEntity _VideoTypeEntity)
 {
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.SaveEntity(_VideoTypeEntity, true);
     }
     return _VideoTypeEntity;
 }