コード例 #1
0
        public EventTypeMD AddEventType(EventTypeMD mod)
        {
            try
            {
                var entity = mod.Translate();
                _EventTypeRepo.Insert(entity);
                _EventTypeRepo.CommitAllChanges();
                mod.AddSuccessMessage(string.Format(AppConstants.CRUD_ADD, "EventType"));
                mod.Id = entity.Id;
            }
            catch (Exception ex)
            {
                mod.AddErrorMessage(string.Format(AppConstants.CRUD_ADD_ERROR, "EventType"));
            }

            return(mod);
        }
コード例 #2
0
        public EventTypeMD DeleteEventType(long id)
        {
            var mod = new EventTypeMD();

            try
            {
                var EventType = _EventTypeRepo.Fetch(x => x.IsActive);
                EventType.IsActive = false;
                _EventTypeRepo.Update(EventType);
                _EventTypeRepo.CommitAllChanges();

                mod.AddSuccessMessage(string.Format(AppConstants.CRUD_DELETE, "EventType"));
            }
            catch (Exception ex)
            {
                mod.AddErrorMessage(string.Format(AppConstants.CRUD_DELETE_ERROR, "EventType"));
            }
            return(mod);
        }