public EventTypeMD ModifyEventType(EventTypeMD mod) { var entity = mod.Translate(); try { _EventTypeRepo.Update(entity); _EventTypeRepo.CommitAllChanges(); mod.AddSuccessMessage(string.Format(AppConstants.CRUD_UPDATE, "EventType")); } catch (Exception) { mod.AddSuccessMessage(string.Format(AppConstants.CRUD_UPDATE_ERROR, "EventType")); } return(mod); }
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); }
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); }