예제 #1
0
        /// <summary>
        /// Deletes the highlighted estate
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int    indexToDelete = listBox1.SelectedIndex;
            Estate estate        = estateManager.GetAt(indexToDelete);

            estateManager.DeleteAt(indexToDelete);
            dictionaryHandler.Delete(estate);
        }
예제 #2
0
        /// <summary>
        /// button to delete a selected object in the viewlist, also gets deleted in the list in listmanager.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelete_Click(object sender, EventArgs e)
        {
            estateManager.DeleteAt(lvProperties.SelectedIndices[0]);

            fillList();
            btnDelete.Enabled = false;
            btnChange.Enabled = false;
            test();
        }
예제 #3
0
        public bool DeleteEstate(Estate estate)
        {
            int index = SearchEstateById(estate.EstateId);

            if (index < 0)
            {
                return(false);
            }

            return(_estateManager.DeleteAt(index));
        }
예제 #4
0
 private void DeleteBtn_Click(object sender, EventArgs e)
 {
     try
     {
         if (listBox1.SelectedItems.Count == 1)
         {
             Em.DeleteAt(listBox1.SelectedIndex);
             Update();
         }
         else
         {
             MessageBox.Show("Please select only one item!");
         }
     }
     catch (Exception exc)
     {
         throw exc;
     }
 }
예제 #5
0
 private void DeleteBtn_Click(object sender, EventArgs e)
 {
     estateManager.DeleteAt(objectsLView.SelectedIndices[0]);
     ClearFields();
     ShowAllObjectsInListBox();
 }
예제 #6
0
 public void DeleteEstate(int id)
 {
     estates.DeleteAt(GetPosition(id));
 }