예제 #1
0
        public void deleteElement()
        {
            ElementVezbe selectedElement = view.SelectedElement;

            if (selectedElement != null)
            {
                string message = string.Format("Da li zelite da izbrisete " +
                                               "element \"{0}\"?", selectedElement.NazivElementa);
                bool choice = view.queryConfirmation(message);
                if (choice)
                {
                    try
                    {
                        vezba.UkloniElement(selectedElement);
                        view.ukloniElementGridRow(selectedElement.RedBroj);
                        view.updateRedBrojColumn();
                        view.updateGridFooter();
                        modified = true;
                    }
                    catch (Exception ex)
                    {
                        message = string.Format("Problem prilikom pokusaja brisanja " +
                                                "elementa \"{0}\". \n{1}", selectedElement.NazivElementa, ex.Message);
                        view.showMessage(message);
                    }
                }
            }
        }