Example #1
0
        public SaveResult DeleteEventCost(EventCost eventCost)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.EventCosts.DeleteObject(eventCost);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error deleting EventCost";
            }

            return result;
        }
Example #2
0
        public SaveResult UpdateEventCost(EventCost eventCost)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.EventCosts.Attach(eventCost);

            db.ObjectStateManager.ChangeObjectState(eventCost, System.Data.EntityState.Modified);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error updating EventCost";
            }

            return result;
        }
Example #3
0
        public EventCost CreateEventCost(EventCost eventCost)
        {
            db.EventCosts.AddObject(eventCost);

            SaveChanges();

            return eventCost;
        }