Ejemplo n.º 1
0
        public void Delete_DeleteClient_Client()
        {
            ClientClass testClient = new ClientClass("Client9", "9", 9);

            testClient.Save();
            List <ClientClass> emptyList = new List <ClientClass>();

            testClient.Delete();
            List <ClientClass> postDeleteClients = ClientClass.GetAll();

            CollectionAssert.AreEqual(emptyList, postDeleteClients);
        }
Ejemplo n.º 2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int index = e.RowIndex;
            int id    = int.Parse(dataGridView1.Rows[index].Cells["ID"].Value.ToString());

            if (e.ColumnIndex == 6)
            {
                Clients c = new Clients(id);
                c.Show(this);
            }
            else if (e.ColumnIndex == 7)
            {
                clientClass.Delete(id);

                dataGridView1.AutoGenerateColumns = false;
                dataGridView1.DataSource          = clientClass.SelectAll();
            }
        }