示例#1
0
 private void BtnDelete_Click(object sender, EventArgs e)
 {
     if (lstTypes.SelectedIndex > -1)
     {
         typeRepository.Delete(type);
         LoadListBox();
         ClearTextBoxes();
     }
 }
示例#2
0
        public IActionResult Delete([FromRoute] int id)
        {
            var type = typeRepository.FindById(id);

            if (type == null)
            {
                return(NotFound());
            }
            typeRepository.Delete(id);
            return(NoContent());
        }
        public void Delete()
        {
            //Act
            repository.Delete(id);
            context.SaveChanges();
            var result = repository.GetAll().ToList();

            //Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count);
            Assert.AreNotEqual(1, result[0].ID);
        }
示例#4
0
        private void deleteBtn_Click(object sender, EventArgs e)
        {
            TypeRepository typeRepo = new TypeRepository();

            foreach (DataGridViewRow row in dataGridView1.SelectedRows)
            {
                int typeId = (int)row.Cells["Id"].Value;

                typeRepo.Delete(typeId);

                MessageBox.Show("Selected rows Deleted!");
            }

            FormReLoad();
        }
示例#5
0
 public void Delete(int ID)
 {
     tRep.Delete(x => x.ID == ID);
 }