예제 #1
0
        private void addGroupToFaculty_Click(object sender, EventArgs e)
        {
            if (GroupList.SelectedValue == null)
            {
                return;
            }

            var groupToAdd = sgRepo.get((int)GroupList.SelectedValue);

            if (FacultiesListView.SelectedCells.Count > 0)
            {
                var faculty = ((List <Faculty>)FacultiesListView.DataSource)[FacultiesListView.SelectedCells[0].RowIndex];

                var fsg = new FacultyStudentGroup {
                    student_group_id = groupToAdd.id, faculty_id = faculty.id
                };

                fsgRepo.add(fsg);

                RefreshView(RefreshType.GroupsOnly);
            }
            else
            {
                MessageBox.Show("Не выбран факультет.");
            }
        }
예제 #2
0
        public string update(FacultyStudentGroup fsg, int id)
        {
            var response =
                ApiHelper.Post(ApiEndpoint + "/facultyStudentGroup/" + id.ToString(),
                               new Dictionary <string, string>
            {
                { "student_id", fsg.faculty_id.ToString() },
                { "student_group_id", fsg.student_group_id.ToString() }
            });

            return(response);
        }