public IActionResult DeleteStaff([FromBody] StaffModel staff)
 {
     if (StaffRepo.Delete(staff))
     {
         return(Ok($"Successfully deleted {staff.name}'s details."));
     }
     else
     {
         return(NotFound($"Staff member was not found."));
     }
 }
 public IActionResult AddStaff([FromBody] StaffModel staff)
 {
     if (StaffRepo.Add(staff))
     {
         return(Ok($"Successfully added {staff.name} to staff."));
     }
     else
     {
         return(BadRequest("This member of staff already exists."));
     }
 }
Esempio n. 3
0
 public EntityService()
 {
     _appointmentService = new AppointmentRepo();
     _cityService        = new CityRepo();
     _hospitalService    = new HospitalRepo();
     _patientRepo        = new PatientRepo();
     _policlinicService  = new PoliclinicRepo();
     _staffRepo          = new StaffRepo();
     _titleService       = new TitleRepo();
     _townService        = new TownRepo();
     _userService        = new UserRepo();
 }
Esempio n. 4
0
 public FrmStaff(string staffId = "")
 {
     InitializeComponent();
     _repo = new StaffRepo();
     _id   = staffId;
     LoadDropdowns();
     if (staffId != "")
     {
         lblTitle.Text = "Update Staff";
         //  comboDept.Enabled = false;
         GetItem(staffId);
     }
 }
Esempio n. 5
0
 public FrmUploadStaff()
 {
     InitializeComponent();
     _repo = new StaffRepo();
 }
        public IActionResult Get(int id)
        {
            var staff = StaffRepo.GetById(id);

            return(Ok(staff));
        }
        public IActionResult Get()
        {
            var staff = StaffRepo.GetAll();

            return(Ok(staff));
        }
Esempio n. 8
0
 public PgUser()
 {
     InitializeComponent();
     _repo = new StaffRepo();
 }
        public ActionResult <string> Get(int id)
        {
            var staff = StaffRepo.Retrieve(id);

            return(Ok(staff));
        }
Esempio n. 10
0
 public StaffController()
 {
     this.repo = new StaffRepo();
 }