Esempio n. 1
0
 public void AddMachineToList()
 {
     if (TxtMachineName.Text == "")
     {
         MessageBox.Show("Niste unijeli naziv stroja", "Error");
     }
     else
     {
         ProductMachine proizvodStroj = new ProductMachine();
         Machine        stroj         = new Machine(TxtMachineName.Text);
         proizvodStroj.InputNewMachine(stroj);
         Close();
     }
 }
Esempio n. 2
0
        private void BtnDeleteColumn_Click(object sender, EventArgs e)
        {
            if (dgvTableProductMachine.CurrentCell == null)
            {
                MessageBox.Show("Niste odabrali stupac", "Error");
                return;
            }

            int    columnIndex = dgvTableProductMachine.CurrentCell.ColumnIndex;
            string columnName  = dgvTableProductMachine.Columns[columnIndex].Name;

            if (columnName == "Naziv proizvoda")
            {
                MessageBox.Show("Navedeni stupac se ne može izbrisati", "Error");
                return;
            }

            ProductMachine.RemoveMachineFromList(columnName);

            DataTableProductMachine.Columns.RemoveAt(columnIndex);
            RefreshTable();
        }