예제 #1
0
        private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
        {
            if (dataGridView1.SelectedRows.Count > 0)
            {
                DataGridViewRow row = dataGridView1.SelectedRows[0];
                int             id  = (int)row.Cells["IdColumn"].Value;

                if (e.KeyCode == Keys.F12)
                {
                    LoadRecentSales(id);
                }
                else if (e.KeyCode == Keys.F11)
                {
                    LoadRecentPurchases(id);
                }
                else if (e.KeyCode == Keys.Enter)
                {
                    OpenSelectedAutoPartDetail(row.Index);
                }
                else if (e.KeyCode == Keys.Up)
                {
                    if (row.Index == 0)
                    {
                        PartNumberTextbox.Focus();
                    }
                }
            }

            if (e.KeyCode == Keys.Left)
            {
                dataGridView2.Focus();
            }
        }
예제 #2
0
 private void ClearForm()
 {
     if (AutoPartId == 0)
     {
         AutoPartTextbox.Clear();
         DescriptionTextbox.Clear();
         MakeTextbox.Clear();
         ModelTextbox.Clear();
         brandBindingSource.Position = -1;
         BrandDropdown.SelectedIndex = -1;
         SellingPriceTextbox.Text    = "0.00";
         SellingPrice2Textbox.Text   = "0.00";
         PurchasePriceTextbox.Text   = "0.00";
         ReorderTextbox.Text         = "0";
         InitialQtyTextbox.Text      = "0";
         UnitTextbox.Clear();
         PartNumberTextbox.Clear();
         SizeTextbox.Clear();
         AltTextbox.Clear();
         PictureTextbox.Clear();
     }
     else
     {
         LoadPartDetails();
     }
 }
        private void ClearButton_Click(object sender, EventArgs e)
        {
            PartNumberTextbox.Clear();
            //PartNameTextbox.Clear();
            BrandDropdown.ComboBox.SelectedIndex = -1;
            BrandDropdown.SelectedIndex          = -1;
            ModelTextbox.Clear();
            SizeTextbox.Clear();

            LoadPartsInventory();
        }
예제 #4
0
        private void ClearFilter()
        {
            PartNumberTextbox.Clear();
            //PartNameTextbox.Clear();
            BrandDropdown.ComboBox.SelectedIndex = -1;
            BrandDropdown.SelectedIndex          = -1;
            ModelTextbox.Clear();
            SizeTextbox.Clear();

            LoadPartsInventory(true);
        }