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