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 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); }