Exemple #1
0
        public async Task <bool> Modify(StockIssueDocketType _model)
        {
            _model.UpdatedUser = scopeContext.UserCode;
            _model.UpdatedDate = DateTime.Now;
            context.Update(_model);
            await context.SaveChangesAsync();

            return(true);
        }
Exemple #2
0
        public async Task <int> Add(StockIssueDocketType _model)
        {
            _model.CreatedUser = scopeContext.UserCode;
            _model.CreatedDate = DateTime.Now;
            context.Add(_model);
            await context.SaveChangesAsync();

            return(_model.Id);
        }
        public async Task <bool> Modify(int _id, StockIssueDocketTypeModel _model)
        {
            StockIssueDocketType entity = await svcStockIssueDocketType.GetDetail(_id);

            if (entity == null)
            {
                return(false);
            }
            entity = iMapper.Map(_model, entity);
            return(await svcStockIssueDocketType.Modify(entity));
        }
Exemple #4
0
        public async Task <bool> Remove(int _id)
        {
            StockIssueDocketType item = await context.StockIssueDocketType.Where(i => i.Id == _id).FirstOrDefaultAsync();

            if (item == default(StockIssueDocketType))
            {
                return(false);
            }
            item.IsDeleted = true;
            context.Entry(item).Property(x => x.IsDeleted).IsModified = true;
            await context.SaveChangesAsync();

            return(true);
        }
        public async Task <int> Add(StockIssueDocketTypeModel _model)
        {
            StockIssueDocketType entity = iMapper.Map <StockIssueDocketType>(_model);

            return(await svcStockIssueDocketType.Add(entity));
        }