public IResult Insert(Role item, Guid userId) { item.StatusId = ActiveStatus.Active; item.CreatedUserId = userId; item.ModifiedUserId = userId; var entityError = new List<EntityError>(); try { if (item.Id == Guid.Empty) item.Id = Guid.NewGuid(); Guid? id = item.Id; RoleDb.Insert( id, item.Description, item.IsSystemRole); return new InsertResult(); } catch (Exception ex) { entityError.Add(new EntityError("Role", "Insert", ex.Message.ToString())); return new InsertResult(entityError); } }
public IResult Update(Role item, Guid userId) { try { RoleDb.Update( item.Id, item.Description, item.IsSystemRole); return new UpdateResult(); } catch (SqlException ex) { var entityError = new List<EntityError>(); entityError.Add(new EntityError("Role", "Update", ex.InnerException.ToString())); return new UpdateResult(entityError); } }