Пример #1
0
        public IResult Insert(Feature 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;

                FeatureDb.Insert(
                id,
                item.Module_Id,
                item.Description_Id,
                item.FeatureSection_Id);

                return new InsertResult();
            }
            catch (Exception ex)
            {
                entityError.Add(new EntityError("Feature", "Insert", ex.Message.ToString()));
                return new InsertResult(entityError);
            }
        }
Пример #2
0
        public IResult Update(Feature item, Guid userId)
        {
            try
            {
                FeatureDb.Update(
                item.Id,
                item.Module_Id,
                item.Description_Id,
                item.FeatureSection_Id);

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