Пример #1
0
        public async Task <int> DeleteBasicMemberByIdAsync(int memberNo)
        {
            var deleteMember = await(from a in CreditContext.Member
                                     where a.MemberNo == memberNo
                                     select a).SingleOrDefaultAsync();

            if (deleteMember != null)
            {
                var deleted = CreditContext.Remove(deleteMember);
                if (deleted != null)
                {
                    return(1);
                }
            }

            return(-1);
        }
        public async Task <int> DeleteCategoryByIdAsync(int categoryNo)
        {
            var deleteCategory = await(from a in CreditContext.Category
                                       where a.CategoryNo == categoryNo
                                       select a).SingleOrDefaultAsync();

            if (deleteCategory != null)
            {
                var deleted = CreditContext.Remove(deleteCategory);
                if (deleted != null)
                {
                    return(1);
                }
            }

            return(-1);
        }
        public async Task <int> DeleteProviderByIdAsync(int providerNo)
        {
            var providerCategory = await(from a in CreditContext.Provider
                                         where a.ProviderNo == providerNo
                                         select a).SingleOrDefaultAsync();

            if (providerCategory != null)
            {
                var deleted = CreditContext.Remove(providerCategory);
                if (deleted != null)
                {
                    return(1);
                }
            }

            return(-1);
        }