Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int ResponsibilityID)
        {
            responsibility responsibility = ResponsibilityRepository.GetResponsibilityByID(ResponsibilityID);

            ResponsibilityRepository.DeleteRecord(responsibility);
            return(RedirectToAction("List"));
        }
Ejemplo n.º 2
0
        public ActionResult DeleteConfirmed(int StaffID)
        {
            staff staff = StaffRepository.GetStaffByID(StaffID);

            if (staff.pictureID > 0)
            {
                picture pic = PictureResponsibility.GetPictureByID((int)staff.pictureID);
                PictureResponsibility.DeleteRecord(pic);
            }
            IEnumerable <responsibility> duties = ResponsibilityRepository.GetResponsibilityByStaff(StaffID);

            foreach (responsibility r in duties)
            {
                ResponsibilityRepository.DeleteRecord(r);
            }
            StaffRepository.DeleteRecord(staff);
            return(RedirectToAction("Details"));
        }