private void RefreshData(SLAMMdbDataContext db) { dbSLAMM = db; tblFilesReconFunctionBindingSource.DataSource = db.tblFilesRecon_Functions; tblFilesReconMarketBindingSource.DataSource = db.tblFilesRecon_Markets; BuildTimeZoneComboBox(db); this.tblFilesRecon_LocationBindingSource.DataSource = db.tblFilesRecon_Locations; this.tblFilesRecon_LocationBindingSource.MoveLast(); }
private void BuildTimeZoneComboBox(SLAMMdbDataContext db) { var items = (from i in db.tblFilesRecon_Locations select i.TimeZone).Distinct(); List <TimeZone> allTimeZones = new List <TimeZone>(); foreach (var data in items) { allTimeZones.Add(new TimeZone(data.ToString(), data.ToString())); } timeZoneListBox.DataSource = allTimeZones; timeZoneListBox.DisplayMember = "timeZoneDecr"; timeZoneListBox.ValueMember = "timeZoneDecr"; }
private void button1_Click(object sender, EventArgs e) { SLAMMdbDataContext db = new SLAMMdbDataContext(); RefreshData(db); ClearValidation(); tblFilesRecon_LocationBindingNavigator.Enabled = true; tblFilesRecon_LocationDataGridView.Enabled = true; if (_hasSuperAccess) { bindingNavigatorDeleteItem.Enabled = true; } else { panel1.Enabled = false; bindingNavigatorDeleteItem.Enabled = false; } }
private void FrmSLAMM_Load(object sender, EventArgs e) { SLAMMdbDataContext db = new SLAMMdbDataContext(); RefreshData(db); _hasSuperAccess = IsSupervisor(_currentUser); //todo: testing only //_hasSuperAccess = false; if (_hasSuperAccess) { bindingNavigatorDeleteItem.Enabled = true; } else { panel1.Enabled = false; bindingNavigatorDeleteItem.Enabled = false; } }