продолжение рефакторинга. создал предка для класса current

This commit is contained in:
2024-10-08 00:39:13 +03:00
parent 3516b58127
commit d0c08a2c7e
157 changed files with 648 additions and 421 deletions

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.Server;
import Common.CurrentAnchestor;
import Common_old.Current;
import Common.Database.Objects.riDBObject;
import Repository.RepositoryServer;
@@ -15,14 +16,14 @@ public abstract class CloneServerObject<S extends RepositoryServer, D extends ri
@Override
protected boolean canStart(Object... args) throws Exception {
src=null;
if (!Current.Check(Log, currentName()))
if (!CurrentAnchestor.Check(Log, currentName()))
return false;
//---------
pk = null;
if (Current.getAccount().CheckRegistered(Log)) {
target = d.newInstance();
target.SynchronizeFields(src=(D) Current.get(currentName()));
target.SynchronizeFields(src=(D) CurrentAnchestor.get(currentName()));
//единственное отличие клона - текущий автор
target.description+=" копия";
target.sender_name = Current.getAccount().name;

View File

@@ -1,5 +1,5 @@
package Visual_DVM_2021.Passes.Server;
import Common_old.Current;
import Common.CurrentAnchestor;
import Common.Database.Objects.DBObject;
import Common.Database.Tables.DBTable;
import Common.Database.Database;
@@ -40,7 +40,7 @@ public class DeleteServerObjects <S extends RepositoryServer, D extends DBObject
return UI.Warning(table.getCheckedCount()+" объектов будет удален(о).");
}
else {
if (Current.Check(Log, table.CurrentName())){
if (CurrentAnchestor.Check(Log, table.CurrentName())){
target = new Vector<>();
target.add(table.getCurrent().getPK());
return getDb().tables.get(d).CheckCurrent(Log) && getDb().tables.get(d).ShowDeleteObjectDialog(table.getCurrent());