示例#1
0
 public bool Delete(Guid Id)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         ReviewsEntity _ReviewsEntity = new ReviewsEntity(Id);
         if (adapter.FetchEntity(_ReviewsEntity))
         {
             adapter.DeleteEntity(_ReviewsEntity);
             toReturn = true;
         }
     }
     return toReturn;
 }
示例#2
0
        public bool Update(Guid Id, Guid ReferId, string ReviewContent, string CreatedBy, DateTime CreatedDate, byte[] UpdatedBy, DateTime UpdatedDate, bool IsVisible)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                ReviewsEntity _ReviewsEntity = new ReviewsEntity(Id);
                if (adapter.FetchEntity(_ReviewsEntity))
                {

                    _ReviewsEntity.ReferId = ReferId;
                    _ReviewsEntity.ReviewContent = ReviewContent;
                    _ReviewsEntity.CreatedBy = CreatedBy;
                    _ReviewsEntity.CreatedDate = CreatedDate;
                    _ReviewsEntity.UpdatedBy = UpdatedBy;
                    _ReviewsEntity.UpdatedDate = UpdatedDate;
                    _ReviewsEntity.IsVisible = IsVisible;
                    adapter.SaveEntity(_ReviewsEntity, true);
                    toReturn = true;
                }
            }
            return toReturn;
        }
示例#3
0
 public bool Update(ReviewsEntity _ReviewsEntity, RelationPredicateBucket filter)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.UpdateEntitiesDirectly(_ReviewsEntity, filter);
         toReturn = true;
     }
     return toReturn;
 }
示例#4
0
        public bool Update(ReviewsEntity _ReviewsEntity)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                RelationPredicateBucket filter = new RelationPredicateBucket();
                IPredicateExpression _PredicateExpression = new PredicateExpression();
                _PredicateExpression.Add(ReviewsFields.Id == _ReviewsEntity.Id);

                filter.PredicateExpression.Add(_PredicateExpression);

                adapter.UpdateEntitiesDirectly(_ReviewsEntity, filter);
                toReturn = true;
            }
            return toReturn;
        }
示例#5
0
 public ReviewsEntity SelectOne(Guid Id)
 {
     ReviewsEntity toReturn = null;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         ReviewsEntity _ReviewsEntity = new ReviewsEntity(Id);
         if (adapter.FetchEntity(_ReviewsEntity))
         {
             toReturn = _ReviewsEntity;
         }
     }
     return toReturn;
 }
示例#6
0
        public ReviewsEntity Insert(Guid ReferId, string ReviewContent, string CreatedBy, DateTime CreatedDate, byte[] UpdatedBy, DateTime UpdatedDate, bool IsVisible)
        {
            ReviewsEntity _ReviewsEntity = new ReviewsEntity();
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {

                _ReviewsEntity.ReferId = ReferId;
                _ReviewsEntity.ReviewContent = ReviewContent;
                _ReviewsEntity.CreatedBy = CreatedBy;
                _ReviewsEntity.CreatedDate = CreatedDate;
                _ReviewsEntity.UpdatedBy = UpdatedBy;
                _ReviewsEntity.UpdatedDate = UpdatedDate;
                _ReviewsEntity.IsVisible = IsVisible;
                adapter.SaveEntity(_ReviewsEntity, true);
            }
            return _ReviewsEntity;
        }
示例#7
0
 public ReviewsEntity Insert(ReviewsEntity _ReviewsEntity)
 {
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.SaveEntity(_ReviewsEntity, true);
     }
     return _ReviewsEntity;
 }