2023-11-19 02:12:44 +03:00
|
|
|
package TestingSystem.SAPFOR.SapforConfigurationCommand;
|
2023-09-17 22:13:42 +03:00
|
|
|
import Common.Current;
|
2023-11-17 21:26:01 +03:00
|
|
|
import Common.Database.iDBTable;
|
2023-09-17 22:13:42 +03:00
|
|
|
import Common.UI.DataSetControlForm;
|
|
|
|
|
import Common.UI.UI;
|
|
|
|
|
import Common.UI.Windows.Dialog.DBObjectDialog;
|
2024-09-22 23:10:27 +03:00
|
|
|
import TestingSystem.Common.Configuration.Configuration;
|
2023-11-19 02:12:44 +03:00
|
|
|
import TestingSystem.SAPFOR.SapforConfigurationCommand.UI.SapforConfigurationCommandFields;
|
|
|
|
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
2024-09-22 23:10:27 +03:00
|
|
|
|
|
|
|
|
import java.util.Vector;
|
2023-11-17 21:26:01 +03:00
|
|
|
public class SapforConfigurationCommandsDBTable extends iDBTable<SapforConfigurationCommand> {
|
2023-09-17 22:13:42 +03:00
|
|
|
public SapforConfigurationCommandsDBTable() {
|
2023-11-17 21:26:01 +03:00
|
|
|
super(SapforConfigurationCommand.class);
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String getSingleDescription() {
|
|
|
|
|
return "команда";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String getPluralDescription() {
|
|
|
|
|
return "команды";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected DataSetControlForm createUI() {
|
2024-09-22 23:10:27 +03:00
|
|
|
return new DataSetControlForm(this) {
|
2023-12-06 03:04:26 +03:00
|
|
|
@Override
|
|
|
|
|
public boolean hasCheckBox() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2023-11-14 23:07:49 +03:00
|
|
|
@Override
|
|
|
|
|
protected void AdditionalInitColumns() {
|
2023-11-17 21:36:56 +03:00
|
|
|
//columns.get(0).setVisible(false);
|
2023-11-14 23:07:49 +03:00
|
|
|
}
|
|
|
|
|
};
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String[] getUIColumnNames() {
|
|
|
|
|
return new String[]{
|
|
|
|
|
"Проход"
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public Object getFieldAt(SapforConfigurationCommand object, int columnIndex) {
|
|
|
|
|
switch (columnIndex) {
|
2023-12-06 03:04:26 +03:00
|
|
|
case 2:
|
2023-09-17 22:13:42 +03:00
|
|
|
return object.passCode.getDescription();
|
|
|
|
|
default:
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public Current CurrentName() {
|
|
|
|
|
return Current.SapforConfigurationCommand;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public DBObjectDialog<SapforConfigurationCommand, SapforConfigurationCommandFields> getDialog() {
|
|
|
|
|
return new DBObjectDialog<SapforConfigurationCommand, SapforConfigurationCommandFields>(SapforConfigurationCommandFields.class) {
|
|
|
|
|
@Override
|
|
|
|
|
public int getDefaultHeight() {
|
|
|
|
|
return 250;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void fillFields() {
|
|
|
|
|
UI.TrySelect(fields.cbPassCode, Result.passCode);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void ProcessResult() {
|
|
|
|
|
Result.passCode = (PassCode_2021) fields.cbPassCode.getSelectedItem();
|
|
|
|
|
Result.sapforconfiguration_id = Current.getSapforConfiguration().id;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
2024-09-22 23:10:27 +03:00
|
|
|
public Vector<PassCode_2021> getCodes(Configuration configuration) {
|
|
|
|
|
Vector<PassCode_2021> res = new Vector<>();
|
|
|
|
|
for (SapforConfigurationCommand command : Data.values()) {
|
|
|
|
|
if (command.sapforconfiguration_id == configuration.id)
|
|
|
|
|
res.add(command.passCode);
|
|
|
|
|
}
|
|
|
|
|
return res;
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|