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

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

            return(_model.Id);
        }
Ejemplo n.º 3
0
        public async Task <bool> Modify(int _id, StockReceiveDocketTypeModel _model)
        {
            StockReceiveDocketType entity = await svcStockReceiveDocketType.GetDetail(_id);

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

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

            return(true);
        }
Ejemplo n.º 5
0
        public async Task <int> Add(StockReceiveDocketTypeModel _model)
        {
            StockReceiveDocketType entity = iMapper.Map <StockReceiveDocketType>(_model);

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