private void CourseUpdate(int uId) { List <ComboBox> addCourseList = new List <ComboBox>(); addCourseList.Add(c1); addCourseList.Add(c2); addCourseList.Add(c3); addCourseList.Add(c4); addCourseList.Add(c5); DBA db = DBA.Instance; db.connect(); db.query("DELETE courseToTT where id_user = "******""); int ind = 0; while (ind < 5) { if (addCourseList[ind].Text != "") { string course = addCourseList[ind].GetItemText(addCourseList[ind].SelectedItem); course = course.Remove(course.Length - 1); string[] course_data = course.Split('['); int course_id = GlobalItems.strToInt(course_data[1]); db.query("INSERT INTO courseToTT (id_user, id_course) VALUES (" + uId + ", " + course_id + ")"); } ind++; } }
private int getEventId(string eve) { if (eve == "" || eve == null) { return(0); } string[] c = eve.Split('|'); return(GlobalItems.strToInt(c[0])); }
private void c5_SelectedIndexChanged(object sender, EventArgs e) { string course = c5.GetItemText(c5.SelectedItem); optC5.Text = ""; if (course != "") { optC5.Items.Clear(); course = course.Remove(course.Length - 1); string[] course_data = course.Split('['); int course_id = GlobalItems.strToInt(course_data[1]); getAllCourseOptions(course_id, optC5); } else { optC5.Items.Clear(); } }