public IOperationResult DeleteEventType(EventType eventType) { Result.Reset(); Result = eventTypeContext.Delete(eventType); if (Result.IsError) { Result = eventTypeContext.Result; Result.CustomMessage = "There was a problem deleting the requested EventType"; } return Result; }
/* ----- Public Methods ----- */ public IOperationResult CreateEventType(EventType eventType) { Result.Reset(); Result = eventTypeContext.Create(eventType); if (Result.IsError) { Result = eventTypeContext.Result; Result.CustomMessage = "There was a problem creating the EventType"; } return Result; }
/* ----- Public Methods ----- */ public IOperationResult Create(EventType eventType) { ResetError(); try { _UnitOfWork.db.Insert("EventType", "TypeID", eventType); _IOperationResult.RecordID = eventType.TypeID; } catch (Exception ex) { Result = new DBOperationResult(ex); } return Result; }
public IOperationResult Delete(EventType eventType) { ResetError(); try { _UnitOfWork.db.Delete(eventType); //_UnitOfWork.db.Execute("DELETE FROM [dbo].[EventType] WHERE TypeID = @0", eventTypeID); } catch (Exception ex) { Result = new DBOperationResult(ex); } return Result; }