コード例 #1
0
 /// <summary>
 /// Event handler for the Select Form upon loading.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SelectForm_Load(object sender, EventArgs e)
 {
     using (var db = new DollarComputersContext()) {
         db.products.Load();
         productsBindingSource.DataSource = db.products.Local.ToBindingList();
     }
 }
 /// <summary>
 /// The method for loading the products onto the ProductDataGridView
 /// </summary>
 private void LoadProducts()
 {
     using (var db = new DollarComputersContext())
     {
         db.products.Load();
         productBindingSource.DataSource = db.products.Local.ToBindingList();
     }
 }
コード例 #3
0
 /// <summary>
 /// This is event handler for SelectForm Load event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SelectForm_Load(object sender, EventArgs e)
 {
     // load database and connect to local DataGridView
     using (var db = new DollarComputersContext())
     {
         db.products.Load();
         productBindingSource.DataSource = db.products.Local.ToBindingList();
     }
 }
コード例 #4
0
        /// <summary>
        /// This method handle the Load event of the selectForm
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SelectProductForm_Load(object sender, EventArgs e)
        {
            //disable next button
            SelectFormNextButton.Enabled = false;

            //bind database data to the productDataGridView
            using (var db = new DollarComputersContext())
            {
                db.products.Load();
                productBindingSource.DataSource = db.products.Local.ToBindingList();
            }
            ProductDataGridView.UpdateCellValue(0, 0);
        }
コード例 #5
0
 public bool HasLoadedDataSource()
 {
     using (var db = new DollarComputersContext())
     {
         db.products.Load();
         productBindingSource.DataSource = db.products.Local.ToBindingList();
         if (productBindingSource.DataSource != null)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #6
0
 private void SelectForm_Load(object sender, EventArgs e)
 {
     using (var db = new DollarComputersContext())
     {
         //db.products.Load();
         //productBindingSource.DataSource = db.products.Local.ToBindingList();
         {
             db.products.Load();
             productBindingSource.DataSource = db.products.Local.ToBindingList();
             SelectFormNextButton.Enabled    = false;
             SelectionTextBox.Text           = "";
         }
     }
 }
コード例 #7
0
        /// <summary>
        /// This event fires when the Select form loads and loads the Database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SelectForm_Load(object sender, EventArgs e)
        {
            using (var db = new DollarComputersContext())
            {
                db.products.Load();
                productBindingSource.DataSource = db.products.Local.ToBindingList();
                _dataLoaded            = false;
                TableLoadTimer.Enabled = true;
                //HardwareText.Text = $"{Program.product.manufacturer}-{Program.product.model}\t${Program.product.cost:f2}";
            }
            //Set initial selection to null

            //Do not select any data when first load
            MyProductDataGridView.CurrentCell.Selected = false;
        }