//Update Incharge
        public void Update(Incharge obj)
        {
            //Test if id exists
            if (!_context.INCHARGE.Any(x => x.ID == obj.ID))
            {
                throw new NotFoundException("Id not Found");
            }

            //Update Incharge
            _context.Update(obj);

            //Save changes
            _context.SaveChanges();
        }
        //Update Loan
        public void Update(Loan obj)
        {
            //Test if id exists
            if (!_context.LOAN.Any(x => x.ID == obj.ID))
            {
                throw new NotFoundException("Id not Found");
            }

            //Update Loan
            _context.Update(obj);

            //Save changes
            _context.SaveChanges();
        }
示例#3
0
        //Update Schedules
        public void Update(Schedule obj)
        {
            //Test if id exists
            if (!_context.SCHEDULE.Any(x => x.ID == obj.ID))
            {
                throw new NotFoundException("Id not Found");
            }

            //Update Schedule
            _context.Update(obj);

            //Save changes
            _context.SaveChanges();
        }
示例#4
0
        //Update Absence
        public void Update(Absence obj)
        {
            //Test if id exists
            if (!_context.ABSENCE.Any(x => x.ID == obj.ID))
            {
                throw new NotFoundException("Id not Found");
            }

            //Update Absence
            _context.Update(obj);

            //Save changes
            _context.SaveChanges();
        }
        //Update Employee
        public void Update(Employee obj)
        {
            //Test if id exists
            if (!_context.EMPLOYS.Any(x => x.ID == obj.ID))
            {
                throw new NotFoundException("Id not Found");
            }

            //Update Employe
            _context.Update(obj);

            //Save changes
            _context.SaveChanges();
        }