Ejemplo n.º 1
0
        public IResult Insert(Role_Feature item, Guid userId)
        {
            item.StatusId = ActiveStatus.Active;
            item.CreatedUserId = userId;
            item.ModifiedUserId = userId;

            var entityError = new List<EntityError>();
            try
            {

                Role_FeatureDb.Insert(
                item.Role_Id,
                item.Feature_Id,
                (int?)item.StatusId,
                item.CreatedUserId,
                item.UtcCreatedDate,
                item.ModifiedUserId,
                item.UtcModifiedDate);

                return new InsertResult();
            }
            catch (Exception ex)
            {
                entityError.Add(new EntityError("Role_Feature", "Insert", ex.Message.ToString()));
                return new InsertResult(entityError);
            }
        }
Ejemplo n.º 2
0
        public IResult Update(Role_Feature item, Guid userId)
        {
            try
            {
                Role_FeatureDb.Update(
                item.Role_Id,
                item.Feature_Id,
                (int?)item.StatusId,
                item.CreatedUserId,
                item.UtcCreatedDate,
                item.ModifiedUserId,
                item.UtcModifiedDate);

                return new UpdateResult();
            }
            catch (SqlException ex)
            {
                var entityError = new List<EntityError>();
                entityError.Add(new EntityError("Role_Feature", "Update", ex.InnerException.ToString()));
                return new UpdateResult(entityError);
            }
        }