Exemplo n.º 1
0
 public void AddHistory(string Action, Guid ProductId, string ActionBy)
 {
     HistoryProductEntity history = new HistoryProductEntity();
     history.ActionName = Action;
     history.ProductId = ProductId;
     history.ActionBy = ActionBy;
     history.ActionDate = DateTime.Now;
     Insert(history);
 }
Exemplo n.º 2
0
 public bool Delete(Guid Id)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         HistoryProductEntity _HistoryProductEntity = new HistoryProductEntity(Id);
         if (adapter.FetchEntity(_HistoryProductEntity))
         {
             adapter.DeleteEntity(_HistoryProductEntity);
             toReturn = true;
         }
     }
     return toReturn;
 }
Exemplo n.º 3
0
        public bool Update(Guid Id, Guid ProductId, string ActionName, DateTime ActionDate, string ActionBy)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                HistoryProductEntity _HistoryProductEntity = new HistoryProductEntity(Id);
                if (adapter.FetchEntity(_HistoryProductEntity))
                {

                    _HistoryProductEntity.ProductId = ProductId;
                    _HistoryProductEntity.ActionName = ActionName;
                    _HistoryProductEntity.ActionDate = ActionDate;
                    _HistoryProductEntity.ActionBy = ActionBy;
                    adapter.SaveEntity(_HistoryProductEntity, true);
                    toReturn = true;
                }
            }
            return toReturn;
        }
Exemplo n.º 4
0
 public bool Update(HistoryProductEntity _HistoryProductEntity, RelationPredicateBucket filter)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.UpdateEntitiesDirectly(_HistoryProductEntity, filter);
         toReturn = true;
     }
     return toReturn;
 }
Exemplo n.º 5
0
        public bool Update(HistoryProductEntity _HistoryProductEntity)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                RelationPredicateBucket filter = new RelationPredicateBucket();
                IPredicateExpression _PredicateExpression = new PredicateExpression();
                _PredicateExpression.Add(HistoryProductFields.Id == _HistoryProductEntity.Id);

                filter.PredicateExpression.Add(_PredicateExpression);

                adapter.UpdateEntitiesDirectly(_HistoryProductEntity, filter);
                toReturn = true;
            }
            return toReturn;
        }
Exemplo n.º 6
0
 public HistoryProductEntity SelectOne(Guid Id)
 {
     HistoryProductEntity toReturn = null;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         HistoryProductEntity _HistoryProductEntity = new HistoryProductEntity(Id);
         if (adapter.FetchEntity(_HistoryProductEntity))
         {
             toReturn = _HistoryProductEntity;
         }
     }
     return toReturn;
 }
Exemplo n.º 7
0
        public HistoryProductEntity Insert(Guid ProductId, string ActionName, DateTime ActionDate, string ActionBy)
        {
            HistoryProductEntity _HistoryProductEntity = new HistoryProductEntity();
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {

                _HistoryProductEntity.ProductId = ProductId;
                _HistoryProductEntity.ActionName = ActionName;
                _HistoryProductEntity.ActionDate = ActionDate;
                _HistoryProductEntity.ActionBy = ActionBy;
                adapter.SaveEntity(_HistoryProductEntity, true);
            }
            return _HistoryProductEntity;
        }
Exemplo n.º 8
0
 public HistoryProductEntity Insert(HistoryProductEntity _HistoryProductEntity)
 {
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.SaveEntity(_HistoryProductEntity, true);
     }
     return _HistoryProductEntity;
 }