public IActionResult DeleteFaculty([FromBody] FacultyModel faculty) { if (FacultyRepo.Delete(faculty)) { return(Ok("Faculty has been successfully deleted.")); } return(NotFound("The faculty member was not found.")); }
public IActionResult AddFaculty([FromBody] FacultyModel faculty) { if (FacultyRepo.Add(faculty)) { return(Ok($"{faculty.name} has been successfully added to faculty.")); } return(BadRequest("This member of faculty already exists.")); }
public ActionResult Delete([FromBody] Faculty f) { if (FacultyRepo.Del(f)) { return(Ok("Faculty has been successfull deleted")); } return(NotFound("The Faculty record is not found")); }
public ActionResult UpdateStudent([FromBody] Faculty f) { if (FacultyRepo.Update(f)) { return(Ok("Faculty has been successfull updated")); } return(NotFound("The Faculty record is not found")); }
public ActionResult AddFaculty([FromBody] Faculty f) { if (FacultyRepo.Add(f)) { return(Ok("Faculty has been successfully added")); } return(BadRequest("The Faculty has already been added")); }
public FacultyList(string apiEndpoint) { InitializeComponent(); ApiEndpoint = apiEndpoint; fRepo = new FacultyRepo(ApiEndpoint); sgRepo = new StudentGroupRepo(ApiEndpoint); fsgRepo = new FacultyStudentGroupRepo(ApiEndpoint); }
private void LearningPlanList_Load(object sender, EventArgs e) { IntPtr pIcon = Resources.applebooks.GetHicon(); Icon = Icon.FromHandle(pIcon); lpRepo = new LearningPlanRepo(ApiEndpoint); lpdRepo = new LearningPlanDisciplineRepo(ApiEndpoint); lpdsRepo = new LearningPlanDisciplineSemesterRepo(ApiEndpoint); fRepo = new FacultyRepo(ApiEndpoint); Faculties = fRepo.all().OrderBy(f => f.sorting_order).ToList(); lpFaculty.DisplayMember = "name"; lpFaculty.ValueMember = "id"; lpFaculty.DataSource = Faculties; RefreshLearningPlanList(); }
public IActionResult Get(int id) { var faculty = FacultyRepo.GetById(id); return(Ok(faculty)); }
public IActionResult Get() { var faculty = FacultyRepo.GetAll(); return(Ok(faculty)); }
public ActionResult <string> Get(int id) { var faculty = FacultyRepo.Retrieve(id); return(Ok(faculty)); }