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); }
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; }
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; }
public bool Update(HistoryProductEntity _HistoryProductEntity, RelationPredicateBucket filter) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { adapter.UpdateEntitiesDirectly(_HistoryProductEntity, filter); toReturn = true; } return toReturn; }
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; }
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; }
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; }
public HistoryProductEntity Insert(HistoryProductEntity _HistoryProductEntity) { using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { adapter.SaveEntity(_HistoryProductEntity, true); } return _HistoryProductEntity; }