-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGirisYap.java
138 lines (110 loc) · 6.2 KB
/
GirisYap.java
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
package otel.gui;
import java.sql.SQLException;
import javax.swing.JOptionPane;
import otel.database.Veritabani;
public class GirisYap extends javax.swing.JFrame {
//Giriş yapma formu
public GirisYap() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
girisOlButton = new javax.swing.JButton();
girisUserBox = new javax.swing.JTextField();
girisSifreBox = new javax.swing.JPasswordField();
jLabel6 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel4.setText("Kullanıcı adı:");
jLabel5.setText("Şifre");
girisOlButton.setText("Giriş Yap");
girisOlButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
girisOlButtonActionPerformed(evt);
}
});
jLabel6.setForeground(new java.awt.Color(51, 153, 255));
jLabel6.setText("Hesabın yokmu? Kaydol");
jLabel6.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel6MouseClicked(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(47, 47, 47)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(girisUserBox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE)
.addComponent(girisSifreBox, javax.swing.GroupLayout.Alignment.LEADING))
.addContainerGap(49, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(girisOlButton, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(79, 79, 79)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(girisUserBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(girisSifreBox, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(girisOlButton, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addContainerGap(160, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void girisOlButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_girisOlButtonActionPerformed
try {
Veritabani db = new Veritabani();
if(otel.utils.Kontroller.isEmpty(girisUserBox.getText(),new String(girisSifreBox.getPassword()))){
JOptionPane.showMessageDialog(null,"Tüm alanları Doldurun","Giriş Yap",0);
return;
}
boolean giris= db.girisYap(girisUserBox.getText(),new String(girisSifreBox.getPassword()));
if(giris){
JOptionPane.showMessageDialog(null,"Giriş Başarılı","Rezervasyon ekranına aktarılıyorsunuz...",1);
new RezervasyonForm(girisUserBox.getText()).setVisible(true);
}
else{
JOptionPane.showMessageDialog(null,"Hatalı Kullancı adı veya şifre","Giriş Yap",0);
}
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null,ex);
}
}//GEN-LAST:event_girisOlButtonActionPerformed
private void jLabel6MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel6MouseClicked
MusteriKayit musteri = new MusteriKayit();
musteri.setVisible(true);
}//GEN-LAST:event_jLabel6MouseClicked
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton girisOlButton;
private javax.swing.JPasswordField girisSifreBox;
private javax.swing.JTextField girisUserBox;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
// End of variables declaration//GEN-END:variables
}