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(); }
public void DrawTabs(User _user) { HideAll(); Show(_user.Role.Access); /* _navigator.Items.Cast<ToolStripItem>().First(l => l.Name == "save_btn").Enabled = false; _navigator.Items.Cast<ToolStripItem>().First(l => l.Name == "add_btn").Enabled = false;*/ }
partial void UpdateUser(User instance);
partial void InsertUser(User instance);
partial void DeleteUser(User instance);
private void detach_Users(User entity) { this.SendPropertyChanging("Users"); entity.Role = null; }
private void attach_Users(User entity) { this.SendPropertyChanging("Users"); entity.Role = this; }