Beispiel #1
0
        public async Task <int> SaveFlowEntityType(FlowEntityType flowEntityType)
        {
            this._logger.Info(flowEntityType.FlowName);
            try
            {
                var item = await this._flowEntityTypeRepository.GetAsync(flowEntityType.Id);

                _flowEntityTypeRepository.EF.Entry(item).State = EntityState.Detached;

                if (item != null && item.Id != null)
                {
                    return(await this._flowEntityTypeRepository.UpdateAsync(flowEntityType));
                }
                else
                {
                    var result = await this._flowEntityTypeRepository.InsertAsync(flowEntityType);

                    return((result.Id != null) ? 1 : 0);
                }
            }
            catch (Exception error)
            {
                this._logger.Error(error, error.Message);
                this._logger.Error(error, error.Message);
                return(-1);
            }
        }
Beispiel #2
0
        public async Task <int> UpdateFlowEntityType(FlowEntityType flowEntityType)
        {
            var item = await this._flowEntityTypeRepository.GetAsync(flowEntityType.Id);

            _flowEntityTypeRepository.EF.Entry(item).State = EntityState.Detached;

            if (item != null && item.Id != null)
            {
                return(await this._flowEntityTypeRepository.UpdateAsync(flowEntityType));
            }
            return(-1);
        }
Beispiel #3
0
        public async Task <int> AddFlowEntityType(FlowEntityType flowEntityType)
        {
            this._logger.Info(flowEntityType.FlowName);
            try
            {
                var result = await this._flowEntityTypeRepository.InsertAsync(flowEntityType);

                return((result.Id != null) ? 1 : 0);
            }
            catch (Exception error)
            {
                this._logger.Error(error, error.Message);
                this._logger.Error(error, error.Message);
                return(-1);
            }
        }