Esempio n. 1
0
        public void DeleteCargoTest_CorrectId_ReturnFalse()
        {
            bool factResult;
            int  id = 99;

            factResult = CargosDB.DeleteCargo(id);
            Assert.IsFalse(factResult);
        }
        private void DeleteCargoButton_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Удалить запись?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                int line = informationGridView.CurrentRow.Index;
                int id   = Convert.ToInt32(informationGridView.Rows[line].Cells[0].Value.ToString());

                CargosDB.DeleteCargo(id);

                MessageBox.Show("Запись удалена", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            adminForm.Visible = true;
            this.Close();
        }