Exemple #1
0
        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();
        }
Exemple #2
0
        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";
        }
Exemple #3
0
        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;
            }
        }
Exemple #4
0
        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;
            }
        }