public void ShowDialog(RosterMysqlDataContext context, User user) { InitializeComponent(); Context = context; Security = new Security(StudentMainTab, StudentNavigator); Security.DrawTabs(user); Filtered_Students = Context.Students; studentBindingSource.DataSource = Context.Students; //--- Load Program/Schedule Defaults --- programBindingSource.DataSource = Context.Programs; _Program = Context.Programs.First(); scheduleBindingSource.DataSource = _Program.Schedules.ToList(); _Schedule = _Program.Schedules.First(); //enrollmentOfficerBindingSource.DataSource = Context.EnrollmentOfficers; graduatedBindingSource.DataSource = _Student.Graduated; lockerBindingSource.DataSource = Context.Lockers.Where(l => l.Student.Id == null); RepProgram_cmb.DataSource = Context.Programs; DropForm.FormClosed += DropForm_FormClosed; ShowDialog(); }
private void schedule_cmb_SelectedIndexChanged(object sender, EventArgs e) { try { _Schedule = Context.Schedules.First(c => c.Id == (int)schedule_cmb.SelectedValue); } catch (Exception) { } }
private void program_cmb_SelectedIndexChanged(object sender, EventArgs e) { try { _Program = Context.Programs.First(c => c.Id == (int)program_cmb.SelectedValue); _Schedule = _Program.Schedules.First(); scheduleBindingSource.DataSource = _Program.Schedules.ToList(); } catch (Exception) { } }
partial void UpdateSchedule(Schedule instance);
partial void InsertSchedule(Schedule instance);
partial void DeleteSchedule(Schedule instance);
private void detach_Schedules(Schedule entity) { this.SendPropertyChanging("Schedules"); entity.Program = null; }