Example #1
0
        public async Task <ActionResultResponse> Insert(CategoryInvolveMeta categoryInvolveMeta)
        {
            var categoryInvolve = new CategoryInvolve
            {
                CategoryId        = categoryInvolveMeta.CategoryId,
                CategoryInvolveId = categoryInvolveMeta.CategoryInvolveId,
            };

            var result = await _categoryInvolveRepository.Insert(categoryInvolve);

            if (result <= 0)
            {
                return(new ActionResultResponse(result, _sharedResourceService.GetString("Something went wrong. Please contact with administrator.")));
            }

            return(new ActionResultResponse(-1, _resourceService.GetString("Can not insert new CategoryInvolve. Please contact with administrator.")));
        }
Example #2
0
        public async Task <ActionResultResponse> Update(CategoryInvolveMeta categoryInvolveMeta)
        {
            var checkExists = await _categoryInvolveRepository.CheckExists(categoryInvolveMeta.CategoryId, categoryInvolveMeta.CategoryInvolveId);

            if (!checkExists)
            {
                return(new ActionResultResponse(-2, _resourceService.GetString("CategoryInvolve does not exists.")));
            }

            var categoryInvolveInfo = new CategoryInvolve()
            {
                CategoryId        = categoryInvolveMeta.CategoryId,
                CategoryInvolveId = categoryInvolveMeta.CategoryInvolveId,
            };

            await _categoryInvolveRepository.Update(categoryInvolveInfo);

            return(new ActionResultResponse(1, _resourceService.GetString("Update CategoryInvolve successful.")));
        }
Example #3
0
 public async Task <int> Update(CategoryInvolve categoryInvolve)
 {
     return(await Context.SaveChangesAsync());
 }
Example #4
0
 public async Task <int> Insert(CategoryInvolve categoryInvolve)
 {
     _categoryInvolveRepository.Create(categoryInvolve);
     return(await Context.SaveChangesAsync());
 }