示例#1
0
        private void addBtn_Click(object sender, EventArgs e)
        {
            UpdateSpareDataBase updateSpare = new UpdateSpareDataBase();

            updateSpare.AddSpare(artTxt.Text, nameTxt.Text, locTxt.Text, quantityTxt.Text);

            artTxt.Text  = "";
            nameTxt.Text = "";
            locTxt.Text  = "";
            quantityTxt.ResetText();
        }
示例#2
0
 private void editQuantity_Click(object sender, EventArgs e)
 {
     try
     {
         UpdateSpareDataBase updateQty = new UpdateSpareDataBase();
         updateQty.EditQuantity(newQty.Text, spareDataGrid.SelectedRows[0].Cells[0].Value.ToString());
         this.sparesTableAdapter.Fill(this.ezMaintdbDataSet.spares);
     }
     catch (Exception)
     {
         MessageBox.Show("Mark the whole lane please");
     }
 }
示例#3
0
        private void deleteSpare_Click(object sender, EventArgs e)
        {
            try
            {
                UpdateSpareDataBase updateSpare = new UpdateSpareDataBase();
                updateSpare.DeleteSpare(spareDataGrid.SelectedRows[0].Cells[0].Value.ToString());

                spareDataGrid.Rows.RemoveAt(spareDataGrid.SelectedRows[0].Index);
                MessageBox.Show("Spare part successfully removed.");
            }
            catch (Exception)
            {
                MessageBox.Show("Mark the whole lane!");
            }
        }