Ejemplo n.º 1
0
        public async Task <bool> Modify(SupplierBranch _model)
        {
            _model.UpdatedUser = scopeContext.UserCode;
            _model.UpdatedDate = DateTime.Now;
            context.Update(_model);
            await context.SaveChangesAsync();

            return(true);
        }
Ejemplo n.º 2
0
        public async Task <int> Add(SupplierBranch _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, SupplierBranchModel _model)
        {
            SupplierBranch entity = await svcSupplierBranch.GetDetail(_id);

            if (entity == null)
            {
                return(false);
            }
            entity = iMapper.Map(_model, entity);
            return(await svcSupplierBranch.Modify(entity));
        }
Ejemplo n.º 4
0
        public async Task <bool> Remove(int _id)
        {
            SupplierBranch item = await context.SupplierBranch.Where(i => i.Id == _id).FirstOrDefaultAsync();

            if (item == default(SupplierBranch))
            {
                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(SupplierBranchModel _model)
        {
            SupplierBranch entity = iMapper.Map <SupplierBranch>(_model);

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