示例#1
0
 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."));
 }
示例#2
0
 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"));
 }
示例#6
0
        public FacultyList(string apiEndpoint)
        {
            InitializeComponent();

            ApiEndpoint = apiEndpoint;

            fRepo   = new FacultyRepo(ApiEndpoint);
            sgRepo  = new StudentGroupRepo(ApiEndpoint);
            fsgRepo = new FacultyStudentGroupRepo(ApiEndpoint);
        }
示例#7
0
        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();
        }
示例#8
0
        public IActionResult Get(int id)
        {
            var faculty = FacultyRepo.GetById(id);

            return(Ok(faculty));
        }
示例#9
0
        public IActionResult Get()
        {
            var faculty = FacultyRepo.GetAll();

            return(Ok(faculty));
        }
        public ActionResult <string> Get(int id)
        {
            var faculty = FacultyRepo.Retrieve(id);

            return(Ok(faculty));
        }