Exemple #1
0
 public void AddHistory(string Action, string OrderCode, string ActionBy)
 {
     HistoryOrdersEntity history = new HistoryOrdersEntity();
     history.ActionName = Action;
     history.OrderCode = OrderCode;
     history.ActionBy = ActionBy;
     history.ActionDate = DateTime.Now;
     Insert(history);
 }
Exemple #2
0
 public bool Delete(Guid Id)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         HistoryOrdersEntity _HistoryOrdersEntity = new HistoryOrdersEntity(Id);
         if (adapter.FetchEntity(_HistoryOrdersEntity))
         {
             adapter.DeleteEntity(_HistoryOrdersEntity);
             toReturn = true;
         }
     }
     return toReturn;
 }
Exemple #3
0
        public bool Update(Guid Id, string OrderCode, string ActionName, DateTime ActionDate, string ActionBy)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                HistoryOrdersEntity _HistoryOrdersEntity = new HistoryOrdersEntity(Id);
                if (adapter.FetchEntity(_HistoryOrdersEntity))
                {

                    _HistoryOrdersEntity.OrderCode = OrderCode;
                    _HistoryOrdersEntity.ActionName = ActionName;
                    _HistoryOrdersEntity.ActionDate = ActionDate;
                    _HistoryOrdersEntity.ActionBy = ActionBy;
                    adapter.SaveEntity(_HistoryOrdersEntity, true);
                    toReturn = true;
                }
            }
            return toReturn;
        }
Exemple #4
0
 public bool Update(HistoryOrdersEntity _HistoryOrdersEntity, RelationPredicateBucket filter)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.UpdateEntitiesDirectly(_HistoryOrdersEntity, filter);
         toReturn = true;
     }
     return toReturn;
 }
Exemple #5
0
        public bool Update(HistoryOrdersEntity _HistoryOrdersEntity)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                RelationPredicateBucket filter = new RelationPredicateBucket();
                IPredicateExpression _PredicateExpression = new PredicateExpression();
                _PredicateExpression.Add(HistoryOrdersFields.Id == _HistoryOrdersEntity.Id);

                filter.PredicateExpression.Add(_PredicateExpression);

                adapter.UpdateEntitiesDirectly(_HistoryOrdersEntity, filter);
                toReturn = true;
            }
            return toReturn;
        }
Exemple #6
0
 public HistoryOrdersEntity SelectOne(Guid Id)
 {
     HistoryOrdersEntity toReturn = null;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         HistoryOrdersEntity _HistoryOrdersEntity = new HistoryOrdersEntity(Id);
         if (adapter.FetchEntity(_HistoryOrdersEntity))
         {
             toReturn = _HistoryOrdersEntity;
         }
     }
     return toReturn;
 }
Exemple #7
0
        public HistoryOrdersEntity Insert(string OrderCode, string ActionName, DateTime ActionDate, string ActionBy)
        {
            HistoryOrdersEntity _HistoryOrdersEntity = new HistoryOrdersEntity();
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {

                _HistoryOrdersEntity.OrderCode = OrderCode;
                _HistoryOrdersEntity.ActionName = ActionName;
                _HistoryOrdersEntity.ActionDate = ActionDate;
                _HistoryOrdersEntity.ActionBy = ActionBy;
                adapter.SaveEntity(_HistoryOrdersEntity, true);
            }
            return _HistoryOrdersEntity;
        }
Exemple #8
0
 public HistoryOrdersEntity Insert(HistoryOrdersEntity _HistoryOrdersEntity)
 {
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.SaveEntity(_HistoryOrdersEntity, true);
     }
     return _HistoryOrdersEntity;
 }