|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package info.bukova.isspst.ui;
|
|
|
|
|
|
|
|
|
|
import info.bukova.isspst.StringUtils;
|
|
|
|
|
import info.bukova.isspst.data.DataModel;
|
|
|
|
|
import info.bukova.isspst.filters.Filter;
|
|
|
|
|
import info.bukova.isspst.services.Service;
|
|
|
|
@ -140,7 +141,7 @@ public class ListViewModel<T extends DataModel> {
|
|
|
|
|
} catch (IllegalAccessException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (AccessDeniedException e) {
|
|
|
|
|
Messagebox.show("K vykobání této operace nemáte dostatečná oprávnění", "Chyba", Messagebox.OK, Messagebox.ERROR);
|
|
|
|
|
Messagebox.show(StringUtils.localize("ErrorRights"), StringUtils.localize("Error"), Messagebox.OK, Messagebox.ERROR);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -164,7 +165,7 @@ public class ListViewModel<T extends DataModel> {
|
|
|
|
|
@Command
|
|
|
|
|
@NotifyChange({ "dataList", "dataBean" })
|
|
|
|
|
public void delete() {
|
|
|
|
|
Messagebox.show("Opravdu smazat?", "Smazat záznam", Messagebox.YES
|
|
|
|
|
Messagebox.show(StringUtils.localize("DbReallyDelete"), StringUtils.localize("DbDeleteRecord"), Messagebox.YES
|
|
|
|
|
| Messagebox.NO, Messagebox.QUESTION,
|
|
|
|
|
new EventListener<Event>() {
|
|
|
|
|
|
|
|
|
@ -180,9 +181,9 @@ public class ListViewModel<T extends DataModel> {
|
|
|
|
|
BindUtils.postNotifyChange(null, null,
|
|
|
|
|
ListViewModel.this, "dataBean");
|
|
|
|
|
} catch (DataIntegrityViolationException e) {
|
|
|
|
|
Messagebox.show("Chyba při mazání záznamu", "Chyba", Messagebox.OK, Messagebox.ERROR);
|
|
|
|
|
Messagebox.show(StringUtils.localize("DbCannotDelete"), StringUtils.localize("Error"), Messagebox.OK, Messagebox.ERROR);
|
|
|
|
|
} catch (AccessDeniedException e) {
|
|
|
|
|
Messagebox.show("K vykobání této operace nemáte dostatečná oprávnění", "Chyba", Messagebox.OK, Messagebox.ERROR);
|
|
|
|
|
Messagebox.show(StringUtils.localize("ErrorRights"), StringUtils.localize("Error"), Messagebox.OK, Messagebox.ERROR);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -198,7 +199,7 @@ public class ListViewModel<T extends DataModel> {
|
|
|
|
|
dataList.remove(dataBean);
|
|
|
|
|
dataBean = null;
|
|
|
|
|
} catch (DataIntegrityViolationException e) {
|
|
|
|
|
Messagebox.show("Chyba při mazání záznamu", "Chyba", Messagebox.OK,
|
|
|
|
|
Messagebox.show(StringUtils.localize("DbCannotDelete"), StringUtils.localize("Error"), Messagebox.OK,
|
|
|
|
|
Messagebox.ERROR);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|