рефакторинг. вынес в обобщенную часть бд, но еще не все
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package Visual_DVM_2021.UI.Main;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.UI.Windows.Dialog.Dialog;
|
||||
import Common_old.UI.Windows.FormType;
|
||||
import GlobalData.FormsParams.DBForm;
|
||||
import GlobalData.GlobalDatabase;
|
||||
public class ProfilesForm extends Dialog<Object, ProfilesFields> {
|
||||
private DBForm info = null;
|
||||
public ProfilesForm() {
|
||||
@@ -17,13 +18,13 @@ public class ProfilesForm extends Dialog<Object, ProfilesFields> {
|
||||
}
|
||||
@Override
|
||||
public void Init(Object... params) {
|
||||
if (Global.db.sapforProfiles.size() > 0) {
|
||||
for (Object key : Global.db.sapforProfiles.Data.keySet()) {
|
||||
Global.db.sapforProfiles.ShowUI(key);
|
||||
if (((GlobalDatabase)CommonUtils.db).sapforProfiles.size() > 0) {
|
||||
for (Object key : ((GlobalDatabase)CommonUtils.db).sapforProfiles.Data.keySet()) {
|
||||
((GlobalDatabase)CommonUtils.db).sapforProfiles.ShowUI(key);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
Global.db.sapforProfiles.ShowUI();
|
||||
((GlobalDatabase)CommonUtils.db).sapforProfiles.ShowUI();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@@ -54,8 +55,8 @@ public class ProfilesForm extends Dialog<Object, ProfilesFields> {
|
||||
}
|
||||
}
|
||||
public void LoadWindowParameters() throws Exception {
|
||||
if (Global.db.forms.Data.containsKey(FormType.Profiles)) {
|
||||
info = Global.db.forms.Data.get(FormType.Profiles);
|
||||
if (((GlobalDatabase)CommonUtils.db).forms.Data.containsKey(FormType.Profiles)) {
|
||||
info = ((GlobalDatabase)CommonUtils.db).forms.Data.get(FormType.Profiles);
|
||||
info.Apply(this);
|
||||
return;
|
||||
}
|
||||
@@ -64,8 +65,8 @@ public class ProfilesForm extends Dialog<Object, ProfilesFields> {
|
||||
public void SaveWindowParameters() throws Exception {
|
||||
if (info != null) {
|
||||
info.Init(this);
|
||||
Global.db.Update(info);
|
||||
CommonUtils.db.Update(info);
|
||||
} else
|
||||
Global.db.Insert(new DBForm(FormType.Profiles, this));
|
||||
CommonUtils.db.Insert(new DBForm(FormType.Profiles, this));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user