public string update(StudentLearningPlan slp, int id) { var response = ApiHelper.Post(ApiEndpoint + "/studentLearningPlan/" + id.ToString(), new Dictionary <string, string> { { "student_id", slp.student_id.ToString() }, { "learning_plan_id", slp.learning_plan_id.ToString() }, { "from", slp.from.ToString("yyyy-MM-dd") }, { "to", slp.to.ToString("yyyy-MM-dd") } }); return(response); }
private void add_Click(object sender, EventArgs e) { if (StudentListView.SelectedCells.Count > 0) { var studentId = ((List <StudentView>)StudentListView.DataSource)[StudentListView.SelectedCells[0].RowIndex].id; var newStudentLearningPlan = new StudentLearningPlan { student_id = studentId, learning_plan_id = (int)LearningPlanList.SelectedValue, from = planFromPicker.Value, to = planToPicker.Value }; slpRepo.add(newStudentLearningPlan); ReloadLearningPlanList(studentId); } }