ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package com.vci.client.framework.systemConfig.stafforgmanage.listeners;
 
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
 
import javax.swing.JPanel;
 
import com.vci.client.ClientSession;
import com.vci.client.LogonApplication;
import com.vci.client.common.objects.UserObject;
import com.vci.client.framework.delegate.UserEntityClientDelegate;
import com.vci.client.framework.systemConfig.stafforgmanage.MachSecurityDialog;
import com.vci.client.framework.systemConfig.stafforgmanage.MachSecurityPanel;
import com.vci.client.ui.swing.VCIOptionPane;
import com.vci.corba.common.VCIError;
import com.vci.corba.framework.data.MachSecurityInfo;
import com.vci.corba.common.data.UserEntityInfo;
 
 
public class MachSecurityActionListener extends JPanel implements ActionListener {
 
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private MachSecurityDialog dialog = null;
    private MachSecurityPanel tablePanel=null;
    private String type = null;
    private String userName = LogonApplication.getUserEntityObject().getUserName();
    private UserObject logonUserInfo;
    private MachSecurityInfo dataInfo;
    
    public MachSecurityActionListener(MachSecurityDialog dlg, MachSecurityPanel tablePanel, String type, MachSecurityInfo dataInfo) {
        this.dialog = dlg;
        this.tablePanel = tablePanel;
        this.dataInfo = dataInfo;
        this.type = type;
    }
    
    public void actionPerformed(ActionEvent e) {
        if (type.equalsIgnoreCase("add")) {
            add_actionPerformed();
        } else if (type.equalsIgnoreCase("edit")) {
            edit_actionPerformed();
        } else if (type.equalsIgnoreCase("delete")) {
            delete_actionPerformed();
        }
    }
 
    private void add_actionPerformed() {
        // TODO Auto-generated method stub
        if (!checkMachSecurity()) {
            return;
        }
 
        try {
            UserEntityInfo userInfo = UserEntityClientDelegate.changeUserEntityToInfo(LogonApplication.getUserEntityObject());
            ClientSession.getFrameworkService().saveMachSecurity(dataInfo, userInfo);
        } catch (VCIError e) {
            VCIOptionPane.showError(LogonApplication.frame, e);
            return;
        }
        dialog.dispose();
        tablePanel.refreshTableData();
    }
 
    private void edit_actionPerformed() {
        // TODO Auto-generated method stub
        
    }
 
    private void delete_actionPerformed() {
        // TODO Auto-generated method stub
        
    }
 
    
    private boolean checkMachSecurity() {
        // TODO Auto-generated method stub
        return false;
    }
 
}