示例#1
0
        public async Task <int> UpdateSubgroupNo(SubGroupNumber sub, int id)
        {
            SubGroupNumber s = _context.SubGroupNumbers.Where(e => e.Id == id).First();

            s.SubGroupNum = sub.SubGroupNum;
            return(await _context.SaveChangesAsync());
        }
示例#2
0
        public async Task <bool> AddSubGroupNumber(SubGroupNumber subGroup)
        {
            _context.SubGroupNumbers.Add(subGroup);
            int result = await _context.SaveChangesAsync();

            if (result > 0)
            {
                return(true);
            }

            return(false);
        }