blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6f6a451d548b7a63ba0d8f201f4157039056c059 | 5b8337c39cea735e3817ee6f6e6e4a0115c7487c | /sources/com/google/android/exoplayer2/upstream/cache/CacheDataSinkFactory.java | f9751ed3e925dc965bbf082bbd539cd7aacdac30 | [] | no_license | karthik990/G_Farm_Application | 0a096d334b33800e7d8b4b4c850c45b8b005ccb1 | 53d1cc82199f23517af599f5329aa4289067f4aa | refs/heads/master | 2022-12-05T06:48:10.513509 | 2020-08-10T14:46:48 | 2020-08-10T14:46:48 | 286,496,946 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 751 | java | package com.google.android.exoplayer2.upstream.cache;
import com.google.android.exoplayer2.upstream.DataSink;
import com.google.android.exoplayer2.upstream.DataSink.Factory;
public final class CacheDataSinkFactory implements Factory {
private final int bufferSize;
private final Cache cache;
private final long fragmentSize;
public CacheDataSinkFactory(Cache cache2, long j) {
this(cache2, j, CacheDataSink.DEFAULT_BUFFER_SIZE);
}
public CacheDataSinkFactory(Cache cache2, long j, int i) {
this.cache = cache2;
this.fragmentSize = j;
this.bufferSize = i;
}
public DataSink createDataSink() {
return new CacheDataSink(this.cache, this.fragmentSize, this.bufferSize);
}
}
| [
"knag88@gmail.com"
] | knag88@gmail.com |
ec6a8ef8cae7b11ba5c500e49f4aeb7720f40511 | 785fc3eba3ba5dfa2f74e09eb7d558173d033e44 | /src/controlador/AcepcionControlador.java | 3b426bab26e8143b2aabd7c055d3837e9065a9a0 | [] | no_license | vick08bv/ProyectoDiccionario | 2e9cb2978e450107c12fb414d3c291327d360ff0 | 0941b2a08474d944db1729696285784b6ee6eb40 | refs/heads/master | 2020-09-20T17:56:44.852218 | 2019-12-05T23:27:43 | 2019-12-05T23:27:43 | 224,553,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,581 | java | package controlador;
import conexion.Conexion;
import modelo.Acepcion;
import java.util.ArrayList;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.PreparedStatement;
/**
* Controlador para la clase Acepción.
*/
public class AcepcionControlador {
private Conexion cnx = null;
/**
* Constructor
* @param cnx.
*/
public AcepcionControlador(Conexion cnx) {
this.cnx = cnx;
}
/**
* Verifica si una acepción se encuentra en el diccionario.
* @param acepcion Acepción por buscar.
* @return Existencia de la acepción.
*/
public boolean existeAcepcion(String acepcion) {
String query = "select * from Acepcion where acepcion = ?";
try {
PreparedStatement pst = cnx.getConexion().prepareStatement(query);
pst.setString(1, acepcion);
ResultSet rs = pst.executeQuery();
return rs.next();
} catch (SQLException ex) {
return false;
}
}
/**
* Agrega una acepción a la base de datos.
* @param acepcion Acepción por agrega.
* @return Resultado de la operación.
*/
public boolean agregarAcepcion(String acepcion){
if(!this.existeAcepcion(acepcion)){
String query = "insert into Acepcion values (?)";
try {
PreparedStatement pst = cnx.getConexion().prepareStatement(query);
pst.setString(1, acepcion);
pst.execute();
return true;
} catch (SQLException ex) {
return false;
}
} else {
return true;
}
}
/**
* Muestra todas las acepciones relacionadas a un vocablo.
* @param vocablo Vocablo con las acepciones por buscar.
* @return Lista con las acepciones.
*/
public ArrayList<String> acepcionesVocablo(String vocablo) {
ArrayList<String> entradas = new ArrayList<>(25);
String query = "select distinct acepcion from Acepciones \n" +
"where vocablo = ?";
try {
PreparedStatement pst = cnx.getConexion().prepareStatement(query);
pst.setString(1, vocablo);
ResultSet rs = pst.executeQuery();
while (rs.next()){
entradas.add(rs.getString(1));
}
} catch (SQLException ex) {
}
return entradas;
}
/**
* Devuelve los ejemplos de uso de un vocablo con la acepción dada.
* @param vocablo Vocablo a buscar.
* @param acepcion Acepción del vocablo.
* @return Acepciones.
*/
public ArrayList<Acepcion> ejemplosAcepcion(String vocablo, String acepcion) {
ArrayList<Acepcion> entradas = new ArrayList<>(5);
String query = "select ejemplo, explicacion from Acepciones \n" +
"where vocablo = ? and acepcion = ?";
try {
PreparedStatement pst = cnx.getConexion().prepareStatement(query);
pst.setString(1, vocablo);
pst.setString(2, acepcion);
ResultSet rs = pst.executeQuery();
while (rs.next()){
entradas.add(new Acepcion(acepcion,rs.getString(1),rs.getString(2)));
}
} catch (SQLException ex) {
}
return entradas;
}
/**
* Agrega una nueva acepción para el v dado.
* @param v Vocablo al que se le agrega la acepción.
* @param a Acepción del v.
* @param e Un e para la acepción.
* @param x Explicación del e.
* @return Resultado de la operación.
*/
public String agregar(String v, String a, String e, String x){
String vocablo = v; String acepcion = a;
String ejemplo = e; String explicacion = x;
if(vocablo.replace(" ", "").equals("")){
return "\n Indique un vocablo.";
}
if(acepcion.replace(" ","").equals("")){
return "\n Indique una acepción.";
}
if(ejemplo.replace(" ", "").equals("null") ||
ejemplo.replace(" ", "").equals("")){
e = null;
x = null;
} else {
if(x.replace(" ", "").equals("null") ||
x.replace(" ", "").equals("")){
x = null;
}
}
VocabloControlador vocabloControlador = new VocabloControlador(cnx);
// Si el v no existe en la base de datos, no se agrega nada.
if(vocabloControlador.existeVocablo(v)){
// Se agrega la acepción a la base de datos, para
// posteriormente, relacionarla con el v.
if(this.agregarAcepcion(a)){
// Si la el v ya cuenta con la acepción, no se hace nada.
// Si no, se le agrega.
if(this.acepcionesVocablo(v).contains(a)){
return "\n La acepción ya existe.";
} else {
String query = "insert into Acepciones values (?, ?, ?, ?)";
try {
PreparedStatement pst = cnx.getConexion().prepareStatement(query);
pst.setString(1, a);
pst.setString(2, v);
pst.setString(3, e);
pst.setString(4, x);
pst.execute();
return "\n Acepción añadida.";
} catch (SQLException ex) {
return "\n Error. \n" +
"No se pudo añadir la acepción.";
}
}
} else {
return "\n Error. \n" +
"No se pudo añadir la acepción.";
}
} else {
return "\n El vocablo no existe.";
}
}
/**
* Borra una acepción para un vocablo dado.
* @param vocablo Vocablo indicado.
* @param acepcion Acepción que se remueve del vocablo.
* @return Resultado de la operación.
*/
public String borrar(String vocablo, String acepcion){
if(vocablo.replace(" ", "").equals("")){
return "\n Indique un vocablo.";
}
if(acepcion.replace(" ","").equals("")){
return "\n Indique una acepción.";
}
VocabloControlador vocabloControlador = new VocabloControlador(cnx);
// Si el vocablo existe y posee la acepción, se le quita.
if(vocabloControlador.existeVocablo(vocablo)){
if(this.acepcionesVocablo(vocablo).contains(acepcion)){
String query = "delete from Acepciones \n" +
"where acepcion = ? and vocablo = ?";
try {
PreparedStatement pst = cnx.getConexion().prepareStatement(query);
pst.setString(1, acepcion);
pst.setString(2, vocablo);
pst.execute();
} catch (SQLException ex) {
return "\n Error. \n" +
"No se pudo borrar la acepción.";
}
// Cuando ningún vocablo posee la acepción
// en la base de datos, esta se elimina.
query = "Select count(Acepciones.acepcion) from Acepciones \n" +
"inner join Acepcion on Acepciones.acepcion = Acepcion.acepcion \n" +
"where Acepcion.acepcion = ?";
int registros = 1;
try {
PreparedStatement pst = cnx.getConexion().prepareStatement(query);
pst.setString(1, acepcion);
pst.execute();
ResultSet rs = pst.executeQuery();
rs.next();
registros = rs.getInt(1);
} catch (SQLException ex) {
return "\n Acepción borrada.";
}
if(registros == 0){
query = "delete from Acepcion where acepcion = ?";
try {
PreparedStatement pst = cnx.getConexion().prepareStatement(query);
pst.setString(1, acepcion);
pst.execute();
} catch (SQLException ex) {
return "\n Acepción borrada.";
}
}
return "\n Acepción borrada \n" +
" del diccionario.";
} else {
return "\n El vocablo no contiene \n" +
" la acepción.";
}
} else {
return "\n El vocablo no existe.";
}
}
} | [
"vick08bv@users.noreply.github.com"
] | vick08bv@users.noreply.github.com |
6d027a1060f048f6659a636b064565a544cfad25 | d51218b9157aa3776284e156f9ce009a8c56d33c | /app/src/test/java/pet/clever/volleyfragment/ExampleUnitTest.java | 5f8a636ade76e391383a99aa0472717ee3afc065 | [] | no_license | rrizun/VolleyFragment | 5d0fa1ae7e51c62c70e82dc6da9b97bbaa023bdd | f44681db6bb4edbde8cd0436951cdfc80f84a889 | refs/heads/master | 2020-08-05T06:50:30.486599 | 2016-09-03T00:47:56 | 2016-09-03T00:47:56 | 67,263,312 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 318 | java | package pet.clever.volleyfragment;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"rrizun@gmail.com"
] | rrizun@gmail.com |
f2f8a9e179d52859a44d09aa37f95ab1fbe9736d | effae60fd5e304165de1da51fa195d45fdcc762c | /Academy Management System/src/ams/ui/MainUI.java | d12609835b3474f1086d87d359fcdfee8cc850b0 | [] | no_license | rasansmn/Academy_Management_System | 187c2fb89323af3c5154195ab08fc938d0deb178 | c79190a8dc7f0feb3cf73504008b3f98d601e48e | refs/heads/master | 2021-07-09T07:35:02.671959 | 2017-10-02T19:16:35 | 2017-10-02T19:16:35 | 105,574,522 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 486,415 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ams.ui;
import ams.db.Log;
import ams.data.UserType;
import ams.data.Validator;
import ams.db.Backup;
import ams.db.VectorModel;
import ams.db.DB;
import ams.db.ComboBox;
import ams.email.EmailClass;
import javax.swing.*;
import java.sql.*;
import java.util.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.mail.MessagingException;
/**
*
* @author Rasan
*/
public class MainUI extends javax.swing.JFrame {
private Connection con;
private static UserType usertype;
private static int userid;
/**
* Creates new form MainUI
*/
public MainUI(UserType usertype, int userid) {
this.usertype = usertype;
this.userid = userid;
initComponents();
if(usertype == UserType.receptionist){
TabbedPane.remove(ModulesPanel);
TabbedPane.remove(DepartmentsPanel);
TabbedPane.remove(CoursesPanel);
TabbedPane.remove(ExamsPanel);
TabbedPane.remove(AssignmentsPanel);
TabbedPane.remove(LecturesPanel);
TabbedPane.remove(LecturersPanel);
TabbedPane.remove(UsersPanel);
TabbedPane.remove(LogsPanel);
TabbedPane.remove(ReportsPanel);
TabbedPane.remove(ToolsPanel);
TabbedPane.remove(ClassroomsPanel);
TabbedPane.remove(BatchesPanel);
}else if(usertype == UserType.coordinator){
TabbedPane.remove(UsersPanel);
TabbedPane.remove(LogsPanel);
TabbedPane.remove(ReportsPanel);
TabbedPane.remove(ToolsPanel);
}
this.setLocationRelativeTo(null);
showDepartments(null, null);
showStudents(null, null);
showLecturers(null, null);
showCourses(null, null);
showClassrooms(null, null);
showPracticals(null, null);
showPayments(null, null);
showModules(null, null);
showExams(null, null);
showAssignments(null, null);
showLectures(null, null);
showUsers(null, null);
showLogs(null, null);
showBatches(null, null);
showStAss(null, null);
showStExams(null, null);
showCourseModules(null, null);
showStAttendance(null, null);
showStCourses(null, null);
showStBatches(null, null);
showCourseBatches(null, null);
stateInsertDepartment();
stateInsertStudent();
stateInsertLecturer();
stateInsertCourse();
stateInsertClassroom();
stateInsertPractical();
stateInsertPayment();
stateInsertModule();
stateInsertExam();
stateInsertAssignment();
stateInsertLecture();
stateInsertUser();
stateInsertBatch();
stateInsertStAss();
stateInsertStExam();
stateInsertCourseModule();
stateInsertStAttendance();
stateInsertStCourse();
stateInsertStBatch();
stateInsertCourseBatch();
}
//Department
private void clearDepartmentForm(){
txtDepartmentid.setText(null);
txtDepartmentname.setText(null);
txtDepartmentdescription.setText(null);
txtDepartmentid.requestFocus();
}
private void stateInsertDepartment(){
btnUpdateDepartment.setEnabled(false);
btnDeleteDepartment.setEnabled(false);
btnInsertDepartment.setText("Insert");
}
private void stateUpdateDepartment(){
btnUpdateDepartment.setEnabled(true);
btnDeleteDepartment.setEnabled(true);
btnInsertDepartment.setText("New Department...");
}
private void showDepartments(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Department ID");
header.add("Name");
header.add("Description");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getDepartments();
}else{
data = new VectorModel().getDepartments(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in searchDepartments: " + ex.getMessage());
}
tblDepartments.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane1.setViewportView(tblDepartments);
}
//Department
//Student
private void clearStudentForm(){
txtStudentid.setText(null);
txtStudentname.setText(null);
txtStudentaddress.setText(null);
cmbStudentgender.setSelectedItem(null);
dteStudentbirthday.setDate(null);
txtStudentemail.setText(null);
txtStudentphone.setText(null);
txtStudentbackground.setText(null);
dteStudentregdate.setDate(null);
txtStudentid.requestFocus();
}
private void stateInsertStudent(){
btnUpdatestudent.setEnabled(false);
btnDeletestudent.setEnabled(false);
btnInsertstudent.setText("Insert");
ComboBox.bindCombo(cmbStudentbatchid, "tblbatch", "batchid");
}
private void stateUpdateStudent(){
btnUpdatestudent.setEnabled(true);
btnDeletestudent.setEnabled(true);
btnInsertstudent.setText("New Student...");
ComboBox.bindCombo(cmbStudentbatchid, "tblbatch", "batchid");
}
private void showStudents(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Student ID");
header.add("Name");
header.add("Address");
header.add("Gender");
header.add("Birthday");
header.add("Email");
header.add("Phone");
header.add("Background");
header.add("Reg Date");
header.add("Batch ID");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getStudents();
}else{
data = new VectorModel().getStudents(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in searchStudents: " + ex.getMessage());
}
tblStudents.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane15.setViewportView(tblStudents);
}
//Student
//Lecturer
private void clearLecturerForm(){
txtLecturerid.setText(null);
txtLecturername.setText(null);
txtLectureraddress.setText(null);
txtLectureremail.setText(null);
txtLecturerphone.setText(null);
txtLecturerdescription.setText(null);
txtLecturerid.requestFocus();
}
private void stateInsertLecturer(){
btnUpdatelecturer.setEnabled(false);
btnDeletelecturer.setEnabled(false);
btnInsertlecturer.setText("Insert");
}
private void stateUpdateLecturer(){
btnUpdatelecturer.setEnabled(true);
btnDeletelecturer.setEnabled(true);
btnInsertlecturer.setText("New Lecturer...");
}
private void showLecturers(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Lecturer ID");
header.add("Name");
header.add("Address");;
header.add("Email");
header.add("Phone");
header.add("Description");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getLecturers();
}else{
data = new VectorModel().getLecturers(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showLecturers: " + ex.getMessage());
}
tblLecturers.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane4.setViewportView(tblLecturers);
}
//Lecturer
//Course
private void clearCourseForm(){
txtCourseid.setText(null);
txtCoursename.setText(null);
txtCourseduration.setText(null);
txtCoursefee.setText(null);
txtCourselevel.setText(null);
txtCourseid.requestFocus();
}
private void stateInsertCourse(){
btnUpdatecourse.setEnabled(false);
btnDeletecourse.setEnabled(false);
btnInsertcourse.setText("Insert");
ComboBox.bindCombo(cmbCoursedepartmentid, "tbldepartment", "departmentid");
ComboBox.bindCombo(cmbCoursecoordinatorid, "tbllecturer", "lecturerid");
}
private void stateUpdateCourse(){
btnUpdatecourse.setEnabled(true);
btnDeletecourse.setEnabled(true);
btnInsertcourse.setText("New Course...");
ComboBox.bindCombo(cmbCoursedepartmentid, "tbldepartment", "departmentid");
ComboBox.bindCombo(cmbCoursecoordinatorid, "tbllecturer", "lecturerid");
}
private void showCourses(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Course ID");
header.add("Name");
header.add("Duration");;
header.add("Fee");
header.add("Level");
header.add("Department ID");
header.add("Coordinator ID");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getCourses();
}else{
data = new VectorModel().getCourses(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showCourses: " + ex.getMessage());
}
tblCourses.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane3.setViewportView(tblCourses);
}
//Course
//Practical
private void clearPracticalForm(){
txtPracticalid.setText(null);
txtCoursename.setText(null);
dtePracticalstartdate.setDate(null);
dtePracticalenddate.setDate(null);
txtPracticalid.requestFocus();
}
private void stateInsertPractical(){
btnUpdatepractical.setEnabled(false);
btnDeletepractical.setEnabled(false);
btnInsertpractical.setText("Insert");
ComboBox.bindCombo(cmbPracticalstudentid, "tblstudent", "studentid");
ComboBox.bindCombo(cmbPracticalclassroomid, "tblclassroom", "classroomid");
}
private void stateUpdatePractical(){
btnUpdatepractical.setEnabled(true);
btnDeletepractical.setEnabled(true);
btnInsertpractical.setText("New Practical...");
ComboBox.bindCombo(cmbPracticalstudentid, "tblstudent", "studentid");
ComboBox.bindCombo(cmbPracticalclassroomid, "tblclassroom", "classroomid");
}
private void showPracticals(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Practical ID");
header.add("Start Time");
header.add("End Time");;
header.add("Student ID");
header.add("Classroom ID");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getPracticals();
}else{
data = new VectorModel().getPracticals(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showPracticals: " + ex.getMessage());
}
tblPracticals.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane5.setViewportView(tblPracticals);
}
//Practical
//Classroom
private void clearClassroomForm(){
txtClassroomid.setText(null);
txtClassroomname.setText(null);
txtClassroomdescription.setText(null);
txtClassroomid.requestFocus();
}
private void stateInsertClassroom(){
btnUpdateClassroom.setEnabled(false);
btnDeleteClassroom.setEnabled(false);
btnInsertClassroom.setText("Insert");
}
private void stateUpdateClassroom(){
btnUpdateClassroom.setEnabled(true);
btnDeleteClassroom.setEnabled(true);
btnInsertClassroom.setText("New Classroom...");
}
private void showClassrooms(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Classroom ID");
header.add("Classroom Name");
header.add("Description");;
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getClassrooms();
}else{
data = new VectorModel().getClassrooms(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showClassrooms: " + ex.getMessage());
}
tblClassrooms.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane13.setViewportView(tblClassrooms);
}
//Classroom
//Payment
private void clearPaymentForm(){
txtPaymentid.setText(null);
txtPaymentamount.setText(null);
dtePaymentdate.setDate(null);
txtPaymentid.requestFocus();
}
private void stateInsertPayment(){
btnUpdatepayment.setEnabled(false);
btnDeletepayment.setEnabled(false);
btnInsertpayment.setText("Insert");
ComboBox.bindCombo(cmbPaymentstudentid, "tblstudent", "studentid");
}
private void stateUpdatePayment(){
btnUpdatepayment.setEnabled(true);
btnDeletepayment.setEnabled(true);
btnInsertpayment.setText("New Payment...");
ComboBox.bindCombo(cmbPaymentstudentid, "tblstudent", "studentid");
}
private void showPayments(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Payment ID");
header.add("Amount");
header.add("Time");
header.add("Student ID");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getPayments();
}else{
data = new VectorModel().getPayments(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showPayments: " + ex.getMessage());
}
tblPayments.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane6.setViewportView(tblPayments);
}
//Payment
//Module
private void clearModuleForm(){
txtModuleid.setText(null);
txtModulename.setText(null);
txtModuledescription.setText(null);
txtModuleid.requestFocus();
}
private void stateInsertModule(){
btnUpdatemodule.setEnabled(false);
btnDeletemodule.setEnabled(false);
btnInsertmodule.setText("Insert");
ComboBox.bindCombo(cmbModulelecturerid, "tbllecturer", "lecturerid");
}
private void stateUpdateModule(){
btnUpdatemodule.setEnabled(true);
btnDeletemodule.setEnabled(true);
btnInsertmodule.setText("New Module...");
ComboBox.bindCombo(cmbModulelecturerid, "tbllecturer", "lecturerid");
}
private void showModules(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Module ID");
header.add("Name");
header.add("Description");
header.add("Lecturer ID");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getModules();
}else{
data = new VectorModel().getModules(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showModules: " + ex.getMessage());
}
tblModules.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane7.setViewportView(tblModules);
}
//Module
//Exam
private void clearExamForm(){
txtExamid.setText(null);
dteExamstartdate.setDate(null);
dteExamenddate.setDate(null);
txtExamid.requestFocus();
}
private void stateInsertExam(){
btnUpdateexam.setEnabled(false);
btnDeleteexam.setEnabled(false);
btnInsertexam.setText("Insert");
ComboBox.bindCombo(cmbExammoduleid, "tblmodule", "moduleid");
}
private void stateUpdateExam(){
btnUpdateexam.setEnabled(true);
btnDeleteexam.setEnabled(true);
btnInsertexam.setText("New Exam...");
ComboBox.bindCombo(cmbExammoduleid, "tblmodule", "moduleid");
}
private void showExams(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Exam ID");
header.add("Start Time");
header.add("End Time");
header.add("Module ID");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getExams();
}else{
data = new VectorModel().getExams(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showExams: " + ex.getMessage());
}
tblExams.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane8.setViewportView(tblExams);
}
//Exam
//Assignment
private void clearAssignmentForm(){
txtAssignmentid.setText(null);
txtAssignmentname.setText(null);
txtAssignmentdescription.setText(null);
dteAssignmentduedate.setDate(null);
txtAssignmentid.requestFocus();
}
private void stateInsertAssignment(){
btnUpdateassignment.setEnabled(false);
btnDeleteassignment.setEnabled(false);
btnInsertassignment.setText("Insert");
ComboBox.bindCombo(cmbAssignmentmoduleid, "tblmodule", "moduleid");
}
private void stateUpdateAssignment(){
btnUpdateassignment.setEnabled(true);
btnDeleteassignment.setEnabled(true);
btnInsertassignment.setText("New Assignment...");
ComboBox.bindCombo(cmbAssignmentmoduleid, "tblmodule", "moduleid");
}
private void showAssignments(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Assignment ID");
header.add("Assignment Name");
header.add("Description");
header.add("Module ID");
header.add("Due Date");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getAssignments();
}else{
data = new VectorModel().getAssignments(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showAssignment: " + ex.getMessage());
}
tblAssignments.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane9.setViewportView(tblAssignments);
}
//Assignment
//Lecture
private void clearLectureForm(){
txtLectureid.setText(null);
dteLecturestartdate.setDate(null);
dteLectureenddate.setDate(null);
txtLecturedescription.setText(null);
txtLectureclassroomid.setText(null);
txtLectureid.requestFocus();
}
private void stateInsertLecture(){
btnUpdatelecture.setEnabled(false);
btnDeletelecture.setEnabled(false);
btnInsertlecture.setText("Insert");
ComboBox.bindCombo(cmbLecturemoduleid, "tblmodule", "moduleid");
}
private void stateUpdateLecture(){
btnUpdatelecture.setEnabled(true);
btnDeletelecture.setEnabled(true);
btnInsertlecture.setText("New Lecture...");
ComboBox.bindCombo(cmbLecturemoduleid, "tblmodule", "moduleid");
}
private void showLectures(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Lecure ID");
header.add("Start Time");
header.add("End Time");
header.add("Description");
header.add("Classroom ID");
header.add("Module ID");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getLectures();
}else{
data = new VectorModel().getLectures(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showLectures: " + ex.getMessage());
}
tblLectures.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane10.setViewportView(tblLectures);
}
//Lecture
//User
private void clearUserForm(){
txtUserid.setText(null);
txtUsername.setText(null);
txtUseremail.setText(null);
txtUserpassword.setText(null);
txtUserid.requestFocus();
}
private void stateInsertUser(){
btnUpdateuser.setEnabled(false);
btnDeleteuser.setEnabled(false);
btnInsertuser.setText("Insert");
}
private void stateUpdateUser(){
btnUpdateuser.setEnabled(true);
btnDeleteuser.setEnabled(true);
btnInsertuser.setText("New User...");
}
private void showUsers(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("User ID");
header.add("User Name");
header.add("Email");
header.add("Type");
header.add("Status");
try{
if(where == null && what==null){
data = new VectorModel().getUsers();
}else{
data = new VectorModel().getUsers(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showUsers: " + ex.getMessage());
}
tblUsers.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane11.setViewportView(tblUsers);
}
//User
//Log
private void showLogs(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Log ID");
header.add("Entity");
header.add("Action");
header.add("Time");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getLogs();
}else{
data = new VectorModel().getLogs(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showLogs: " + ex.getMessage());
}
tblLogs.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane12.setViewportView(tblLogs);
}
//Log
//Batch
private void clearBatchForm(){
txtBatchid.setText(null);
txtBatchname.setText(null);
dteBatchstartdate.setDate(null);
txtBatchid.requestFocus();
}
private void stateInsertBatch(){
btnUpdateBatch.setEnabled(false);
btnDeleteBatch.setEnabled(false);
btnInsertBatch.setText("Insert");
}
private void stateUpdateBatch(){
btnUpdateBatch.setEnabled(true);
btnDeleteBatch.setEnabled(true);
btnInsertBatch.setText("New Batch...");
}
private void showBatches(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Batch ID");
header.add("Batch Name");
header.add("Start Date");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getBatches();
}else{
data = new VectorModel().getBatches(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showBatches: " + ex.getMessage());
}
tblBatches.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane14.setViewportView(tblBatches);
}
//Batch
//Student Assignment
private void clearStAssForm(){
txtStAssMarks.setText(null);
txtStAssMarks.requestFocus();
}
private void stateInsertStAss(){
btnUpdateStAss.setEnabled(false);
btnDeleteStAss.setEnabled(false);
btnInsertStAss.setText("Insert");
ComboBox.bindCombo(cmbStAssStudentid, "tblstudent", "studentid");
ComboBox.bindCombo(cmbStAssAssignmentid, "tblassignment", "assignmentid");
}
private void stateUpdateStAss(){
btnUpdateStAss.setEnabled(true);
btnDeleteStAss.setEnabled(true);
btnInsertStAss.setText("New Record...");
ComboBox.bindCombo(cmbStAssStudentid, "tblstudent", "studentid");
ComboBox.bindCombo(cmbStAssAssignmentid, "tblassignment", "assignmentid");
}
private void showStAss(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Student ID");
header.add("Assignment ID");
header.add("Marks");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getStudentAssignments();
}else{
data = new VectorModel().getStudentAssignments(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showStAss: " + ex.getMessage());
}
tblStAss.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane16.setViewportView(tblStAss);
}
//student assignment
//Student Exam
private void clearStExamForm(){
txtStExamMarks.setText(null);
txtStExamMarks.requestFocus();
}
private void stateInsertStExam(){
btnUpdateStExam.setEnabled(false);
btnDeleteStExam.setEnabled(false);
btnInsertStExam.setText("Insert");
ComboBox.bindCombo(cmbStExamStudentid, "tblstudent", "studentid");
ComboBox.bindCombo(cmbStExamExamid, "tblexam", "examid");
}
private void stateUpdateStExam(){
btnUpdateStExam.setEnabled(true);
btnDeleteStExam.setEnabled(true);
btnInsertStExam.setText("New Record...");
ComboBox.bindCombo(cmbStExamStudentid, "tblstudent", "studentid");
ComboBox.bindCombo(cmbStExamExamid, "tblexam", "examid");
}
private void showStExams(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Student ID");
header.add("Exam ID");
header.add("Marks");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getStudentExams();
}else{
data = new VectorModel().getStudentExams(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showStExams: " + ex.getMessage());
}
tblStExam.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane17.setViewportView(tblStExam);
}
//student exam
//Course Module
private void clearCourseModuleForm(){
cmbCourseModuleCourseid.requestFocus();
}
private void stateInsertCourseModule(){
btnDeleteCourseModule.setEnabled(false);
btnInsertCourseModule.setText("Insert");
ComboBox.bindCombo(cmbCourseModuleCourseid, "tblcourse", "courseid");
ComboBox.bindCombo(cmbCourseModuleModuleid, "tblmodule", "moduleid");
}
private void stateUpdateCourseModule(){
btnDeleteCourseModule.setEnabled(true);
btnInsertCourseModule.setText("New Record...");
ComboBox.bindCombo(cmbCourseModuleCourseid, "tblcourse", "courseid");
ComboBox.bindCombo(cmbCourseModuleModuleid, "tblmodule", "moduleid");
}
private void showCourseModules(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Course ID");
header.add("Module ID");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getCourseModules();
}else{
data = new VectorModel().getCourseModules(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showCourseModules: " + ex.getMessage());
}
tblCourseModules.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane18.setViewportView(tblCourseModules);
}
//course modules
//attendance
private void clearStAttendanceForm(){
dteStAttendancedate.cleanup();
cmbStAttendanceStudentid.requestFocus();
}
private void stateInsertStAttendance(){
btnUpdateStAttendance.setEnabled(false);
btnDeleteStAttendance.setEnabled(false);
btnInsertStAttendance.setText("Insert");
ComboBox.bindCombo(cmbStAttendanceStudentid, "tblstudent", "studentid");
ComboBox.bindCombo(cmbStAttendanceLectureid, "tbllecture", "lectureid");
}
private void stateUpdateStAttendance(){
btnUpdateStAttendance.setEnabled(true);
btnDeleteStAttendance.setEnabled(true);
btnInsertStAttendance.setText("New Record...");
ComboBox.bindCombo(cmbStAttendanceStudentid, "tblstudent", "studentid");
ComboBox.bindCombo(cmbStAttendanceLectureid, "tbllecture", "lectureid");
}
private void showStAttendance(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Student ID");
header.add("Lecture ID");
header.add("Time");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getStudentAttendance();
}else{
data = new VectorModel().getStudentAttendance(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showStAttendance: " + ex.getMessage());
}
tblStAttendance.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane19.setViewportView(tblStAttendance);
}
//attendance
//Student course
private void clearStCourseForm(){
txtStCourseFee.setText(null);
txtStCourseFee.requestFocus();
}
private void stateInsertStCourse(){
btnUpdateStCourse.setEnabled(false);
btnDeleteStCourse.setEnabled(false);
btnInsertStCourse.setText("Insert");
ComboBox.bindCombo(cmbStCourseStudentid, "tblstudent", "studentid");
ComboBox.bindCombo(cmbStCourseCourseid, "tblcourse", "courseid");
}
private void stateUpdateStCourse(){
btnUpdateStCourse.setEnabled(true);
btnDeleteStCourse.setEnabled(true);
btnInsertStCourse.setText("New Record...");
ComboBox.bindCombo(cmbStCourseStudentid, "tblstudent", "studentid");
ComboBox.bindCombo(cmbStCourseCourseid, "tblcourse", "courseid");
}
private void showStCourses(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Course ID");
header.add("Student ID");
header.add("Fee");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getStudentCourses();
}else{
data = new VectorModel().getStudentCourses(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showStCourses: " + ex.getMessage());
}
tblStCourse.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane20.setViewportView(tblStCourse);
}
//student course
//Student batch
private void clearStBatchForm(){
cmbStBatchStudentid.requestFocus();
}
private void stateInsertStBatch(){
btnDeleteStBatch.setEnabled(false);
btnInsertStBatch.setText("Insert");
ComboBox.bindCombo(cmbStBatchStudentid, "tblstudent", "studentid");
ComboBox.bindCombo(cmbStBatchBatchid, "tblbatch", "batchid");
}
private void stateUpdateStBatch(){
btnDeleteStBatch.setEnabled(true);
btnInsertStBatch.setText("New Record...");
ComboBox.bindCombo(cmbStBatchStudentid, "tblstudent", "studentid");
ComboBox.bindCombo(cmbStBatchBatchid, "tblbatch", "batchid");
}
private void showStBatches(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Batch ID");
header.add("Student ID");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getStudentBatches();
}else{
data = new VectorModel().getStudentBatches(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showStBatches: " + ex.getMessage());
}
tblStBatch.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane21.setViewportView(tblStBatch);
}
//student batch
//course batch
private void clearCourseBatchForm(){
cmbCourseBatchCourseid.requestFocus();
}
private void stateInsertCourseBatch(){
btnDeleteCourseBatch.setEnabled(false);
btnInsertCourseBatch.setText("Insert");
ComboBox.bindCombo(cmbCourseBatchCourseid, "tblcourse", "courseid");
ComboBox.bindCombo(cmbCourseBatchBatchid, "tblbatch", "batchid");
}
private void stateUpdateCourseBatch(){
btnDeleteCourseBatch.setEnabled(true);
btnInsertCourseBatch.setText("New Record...");
ComboBox.bindCombo(cmbCourseBatchCourseid, "tblcourse", "courseid");
ComboBox.bindCombo(cmbCourseBatchBatchid, "tblbatch", "batchid");
}
private void showCourseBatches(String where, String what){
Vector<Vector<String>> data = null;
Vector<String> header = new Vector<String>();
header.add("Course ID");
header.add("Batch ID");
header.add("User ID");
try{
if(where == null && what==null){
data = new VectorModel().getCourseBatches();
}else{
data = new VectorModel().getCourseBatches(where, what);
}
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in showCourseBatches: " + ex.getMessage());
}
tblCourseBatches.setModel(new javax.swing.table.DefaultTableModel(data, header));
jScrollPane22.setViewportView(tblCourseBatches);
}
//course batch
/**
* 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() {
TabbedPane = new javax.swing.JTabbedPane();
StudentsPanel = new javax.swing.JPanel();
jTabbedPane5 = new javax.swing.JTabbedPane();
jPanel44 = new javax.swing.JPanel();
jPanel14 = new javax.swing.JPanel();
jScrollPane15 = new javax.swing.JScrollPane();
tblStudents = new javax.swing.JTable();
txtSearchstudent = new javax.swing.JTextField();
cmbStudentsearchin = new javax.swing.JComboBox();
jLabel81 = new javax.swing.JLabel();
jPanel16 = new javax.swing.JPanel();
jLabel9 = new javax.swing.JLabel();
txtStudentid = new javax.swing.JTextField();
jLabel10 = new javax.swing.JLabel();
txtStudentname = new javax.swing.JTextField();
jLabel11 = new javax.swing.JLabel();
txtStudentaddress = new javax.swing.JTextField();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
txtStudentemail = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
txtStudentphone = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
txtStudentbackground = new javax.swing.JTextField();
dteStudentbirthday = new com.toedter.calendar.JDateChooser();
cmbStudentgender = new javax.swing.JComboBox();
cmbStudentbatchid = new javax.swing.JComboBox();
jLabel76 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
dteStudentregdate = new com.toedter.calendar.JDateChooser();
btnUpdatestudent = new javax.swing.JButton();
btnDeletestudent = new javax.swing.JButton();
btnInsertstudent = new javax.swing.JButton();
jPanel45 = new javax.swing.JPanel();
jPanel46 = new javax.swing.JPanel();
jLabel104 = new javax.swing.JLabel();
jLabel105 = new javax.swing.JLabel();
jLabel106 = new javax.swing.JLabel();
txtStCourseFee = new javax.swing.JTextField();
cmbStCourseStudentid = new javax.swing.JComboBox();
cmbStCourseCourseid = new javax.swing.JComboBox();
btnUpdateStCourse = new javax.swing.JButton();
btnDeleteStCourse = new javax.swing.JButton();
btnInsertStCourse = new javax.swing.JButton();
jPanel47 = new javax.swing.JPanel();
jScrollPane20 = new javax.swing.JScrollPane();
tblStCourse = new javax.swing.JTable();
txtSearchstcourse = new javax.swing.JTextField();
cmbStCoursesearchin = new javax.swing.JComboBox();
jLabel90 = new javax.swing.JLabel();
jPanel54 = new javax.swing.JPanel();
jPanel55 = new javax.swing.JPanel();
jLabel118 = new javax.swing.JLabel();
jLabel119 = new javax.swing.JLabel();
cmbStBatchStudentid = new javax.swing.JComboBox();
cmbStBatchBatchid = new javax.swing.JComboBox();
jPanel56 = new javax.swing.JPanel();
jScrollPane21 = new javax.swing.JScrollPane();
tblStBatch = new javax.swing.JTable();
txtSearchstbatch = new javax.swing.JTextField();
cmbStBatchsearchin = new javax.swing.JComboBox();
jLabel121 = new javax.swing.JLabel();
btnDeleteStBatch = new javax.swing.JButton();
btnInsertStBatch = new javax.swing.JButton();
DepartmentsPanel = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
tblDepartments = new javax.swing.JTable();
txtSearchdepartment = new javax.swing.JTextField();
cmbDepartmentsearchin = new javax.swing.JComboBox();
jLabel4 = new javax.swing.JLabel();
jPanel15 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
txtDepartmentid = new javax.swing.JTextField();
txtDepartmentname = new javax.swing.JTextField();
txtDepartmentdescription = new javax.swing.JTextField();
btnInsertDepartment = new javax.swing.JButton();
btnUpdateDepartment = new javax.swing.JButton();
btnDeleteDepartment = new javax.swing.JButton();
PracticalsPanel = new javax.swing.JPanel();
jPanel5 = new javax.swing.JPanel();
jScrollPane5 = new javax.swing.JScrollPane();
tblPracticals = new javax.swing.JTable();
txtSearchpractical = new javax.swing.JTextField();
cmbPracticalsearchin = new javax.swing.JComboBox();
jLabel30 = new javax.swing.JLabel();
jPanel19 = new javax.swing.JPanel();
jLabel38 = new javax.swing.JLabel();
jLabel39 = new javax.swing.JLabel();
jLabel40 = new javax.swing.JLabel();
txtPracticalid = new javax.swing.JTextField();
jLabel59 = new javax.swing.JLabel();
jLabel60 = new javax.swing.JLabel();
cmbPracticalstudentid = new javax.swing.JComboBox();
cmbPracticalclassroomid = new javax.swing.JComboBox();
cmbPracticalstarttime = new javax.swing.JComboBox();
dtePracticalstartdate = new com.toedter.calendar.JDateChooser();
cmbPracticalendtime = new javax.swing.JComboBox();
dtePracticalenddate = new com.toedter.calendar.JDateChooser();
btnUpdatepractical = new javax.swing.JButton();
btnDeletepractical = new javax.swing.JButton();
btnInsertpractical = new javax.swing.JButton();
PaymentsPanel = new javax.swing.JPanel();
jPanel6 = new javax.swing.JPanel();
jScrollPane6 = new javax.swing.JScrollPane();
tblPayments = new javax.swing.JTable();
txtSearchpayment = new javax.swing.JTextField();
cmbPaymentsearchin = new javax.swing.JComboBox();
jLabel31 = new javax.swing.JLabel();
jPanel20 = new javax.swing.JPanel();
jLabel41 = new javax.swing.JLabel();
jLabel42 = new javax.swing.JLabel();
jLabel43 = new javax.swing.JLabel();
txtPaymentid = new javax.swing.JTextField();
txtPaymentamount = new javax.swing.JTextField();
jLabel61 = new javax.swing.JLabel();
cmbPaymentstudentid = new javax.swing.JComboBox();
cmbPaymenttime = new javax.swing.JComboBox();
dtePaymentdate = new com.toedter.calendar.JDateChooser();
btnUpdatepayment = new javax.swing.JButton();
btnDeletepayment = new javax.swing.JButton();
btnInsertpayment = new javax.swing.JButton();
ModulesPanel = new javax.swing.JPanel();
jPanel7 = new javax.swing.JPanel();
jScrollPane7 = new javax.swing.JScrollPane();
tblModules = new javax.swing.JTable();
txtSearchmodule = new javax.swing.JTextField();
cmbModulesearchin = new javax.swing.JComboBox();
jLabel32 = new javax.swing.JLabel();
jPanel21 = new javax.swing.JPanel();
jLabel44 = new javax.swing.JLabel();
jLabel45 = new javax.swing.JLabel();
jLabel46 = new javax.swing.JLabel();
txtModuleid = new javax.swing.JTextField();
txtModulename = new javax.swing.JTextField();
txtModuledescription = new javax.swing.JTextField();
jLabel62 = new javax.swing.JLabel();
cmbModulelecturerid = new javax.swing.JComboBox();
btnUpdatemodule = new javax.swing.JButton();
btnDeletemodule = new javax.swing.JButton();
btnInsertmodule = new javax.swing.JButton();
CoursesPanel = new javax.swing.JPanel();
jTabbedPane3 = new javax.swing.JTabbedPane();
jPanel36 = new javax.swing.JPanel();
jPanel3 = new javax.swing.JPanel();
jScrollPane3 = new javax.swing.JScrollPane();
tblCourses = new javax.swing.JTable();
txtSearchcourse = new javax.swing.JTextField();
cmbCoursesearchin = new javax.swing.JComboBox();
jLabel15 = new javax.swing.JLabel();
jPanel17 = new javax.swing.JPanel();
jLabel16 = new javax.swing.JLabel();
txtCourseid = new javax.swing.JTextField();
jLabel17 = new javax.swing.JLabel();
txtCoursename = new javax.swing.JTextField();
jLabel18 = new javax.swing.JLabel();
txtCourseduration = new javax.swing.JTextField();
jLabel19 = new javax.swing.JLabel();
txtCoursefee = new javax.swing.JTextField();
jLabel20 = new javax.swing.JLabel();
txtCourselevel = new javax.swing.JTextField();
jLabel21 = new javax.swing.JLabel();
jLabel22 = new javax.swing.JLabel();
cmbCoursedepartmentid = new javax.swing.JComboBox();
cmbCoursecoordinatorid = new javax.swing.JComboBox();
btnUpdatecourse = new javax.swing.JButton();
btnDeletecourse = new javax.swing.JButton();
btnInsertcourse = new javax.swing.JButton();
jPanel37 = new javax.swing.JPanel();
jPanel38 = new javax.swing.JPanel();
jLabel99 = new javax.swing.JLabel();
jLabel100 = new javax.swing.JLabel();
cmbCourseModuleCourseid = new javax.swing.JComboBox();
cmbCourseModuleModuleid = new javax.swing.JComboBox();
jPanel39 = new javax.swing.JPanel();
jScrollPane18 = new javax.swing.JScrollPane();
tblCourseModules = new javax.swing.JTable();
txtSearchcoursemodule = new javax.swing.JTextField();
cmbCourseModulesearchin = new javax.swing.JComboBox();
jLabel88 = new javax.swing.JLabel();
btnDeleteCourseModule = new javax.swing.JButton();
btnInsertCourseModule = new javax.swing.JButton();
jPanel57 = new javax.swing.JPanel();
jPanel58 = new javax.swing.JPanel();
jLabel120 = new javax.swing.JLabel();
jLabel122 = new javax.swing.JLabel();
cmbCourseBatchCourseid = new javax.swing.JComboBox();
cmbCourseBatchBatchid = new javax.swing.JComboBox();
btnDeleteCourseBatch = new javax.swing.JButton();
btnInsertCourseBatch = new javax.swing.JButton();
jPanel59 = new javax.swing.JPanel();
jScrollPane22 = new javax.swing.JScrollPane();
tblCourseBatches = new javax.swing.JTable();
txtSearchcoursebatch = new javax.swing.JTextField();
cmbCourseBatchsearchin = new javax.swing.JComboBox();
jLabel123 = new javax.swing.JLabel();
ExamsPanel = new javax.swing.JPanel();
jTabbedPane2 = new javax.swing.JTabbedPane();
jPanel31 = new javax.swing.JPanel();
jPanel8 = new javax.swing.JPanel();
jScrollPane8 = new javax.swing.JScrollPane();
tblExams = new javax.swing.JTable();
txtSearchexam = new javax.swing.JTextField();
cmbExamsearchin = new javax.swing.JComboBox();
jLabel33 = new javax.swing.JLabel();
jPanel22 = new javax.swing.JPanel();
jLabel47 = new javax.swing.JLabel();
jLabel48 = new javax.swing.JLabel();
jLabel49 = new javax.swing.JLabel();
txtExamid = new javax.swing.JTextField();
jLabel63 = new javax.swing.JLabel();
cmbExammoduleid = new javax.swing.JComboBox();
cmbExamstarttime = new javax.swing.JComboBox();
dteExamstartdate = new com.toedter.calendar.JDateChooser();
cmbExamendtime = new javax.swing.JComboBox();
dteExamenddate = new com.toedter.calendar.JDateChooser();
btnUpdateexam = new javax.swing.JButton();
btnDeleteexam = new javax.swing.JButton();
btnInsertexam = new javax.swing.JButton();
jPanel32 = new javax.swing.JPanel();
jPanel34 = new javax.swing.JPanel();
jLabel96 = new javax.swing.JLabel();
jLabel97 = new javax.swing.JLabel();
jLabel98 = new javax.swing.JLabel();
txtStExamMarks = new javax.swing.JTextField();
cmbStExamStudentid = new javax.swing.JComboBox();
cmbStExamExamid = new javax.swing.JComboBox();
btnUpdateStExam = new javax.swing.JButton();
btnDeleteStExam = new javax.swing.JButton();
btnInsertStExam = new javax.swing.JButton();
jPanel35 = new javax.swing.JPanel();
jScrollPane17 = new javax.swing.JScrollPane();
tblStExam = new javax.swing.JTable();
txtSearchstexam = new javax.swing.JTextField();
cmbStExamsearchin = new javax.swing.JComboBox();
jLabel87 = new javax.swing.JLabel();
AssignmentsPanel = new javax.swing.JPanel();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel2 = new javax.swing.JPanel();
jPanel9 = new javax.swing.JPanel();
jScrollPane9 = new javax.swing.JScrollPane();
tblAssignments = new javax.swing.JTable();
txtSearchassignment = new javax.swing.JTextField();
cmbAssignmentsearchin = new javax.swing.JComboBox();
jLabel34 = new javax.swing.JLabel();
jPanel23 = new javax.swing.JPanel();
jLabel50 = new javax.swing.JLabel();
jLabel51 = new javax.swing.JLabel();
jLabel52 = new javax.swing.JLabel();
txtAssignmentid = new javax.swing.JTextField();
txtAssignmentname = new javax.swing.JTextField();
txtAssignmentdescription = new javax.swing.JTextField();
jLabel75 = new javax.swing.JLabel();
dteAssignmentduedate = new com.toedter.calendar.JDateChooser();
jLabel64 = new javax.swing.JLabel();
cmbAssignmentmoduleid = new javax.swing.JComboBox();
cmbAssignmentduetime = new javax.swing.JComboBox();
btnUpdateassignment = new javax.swing.JButton();
btnDeleteassignment = new javax.swing.JButton();
btnInsertassignment = new javax.swing.JButton();
jPanel29 = new javax.swing.JPanel();
jPanel30 = new javax.swing.JPanel();
jScrollPane16 = new javax.swing.JScrollPane();
tblStAss = new javax.swing.JTable();
txtSearchstass = new javax.swing.JTextField();
cmbStAsssearchin = new javax.swing.JComboBox();
jLabel86 = new javax.swing.JLabel();
jPanel33 = new javax.swing.JPanel();
jLabel93 = new javax.swing.JLabel();
jLabel94 = new javax.swing.JLabel();
jLabel95 = new javax.swing.JLabel();
txtStAssMarks = new javax.swing.JTextField();
cmbStAssStudentid = new javax.swing.JComboBox();
cmbStAssAssignmentid = new javax.swing.JComboBox();
btnUpdateStAss = new javax.swing.JButton();
btnDeleteStAss = new javax.swing.JButton();
btnInsertStAss = new javax.swing.JButton();
LecturesPanel = new javax.swing.JPanel();
jTabbedPane4 = new javax.swing.JTabbedPane();
jPanel40 = new javax.swing.JPanel();
jPanel10 = new javax.swing.JPanel();
jScrollPane10 = new javax.swing.JScrollPane();
tblLectures = new javax.swing.JTable();
txtSearchlecture = new javax.swing.JTextField();
cmbLecturessearchin = new javax.swing.JComboBox();
jLabel35 = new javax.swing.JLabel();
jPanel24 = new javax.swing.JPanel();
jLabel53 = new javax.swing.JLabel();
jLabel54 = new javax.swing.JLabel();
jLabel55 = new javax.swing.JLabel();
txtLectureid = new javax.swing.JTextField();
jLabel65 = new javax.swing.JLabel();
txtLecturedescription = new javax.swing.JTextField();
jLabel66 = new javax.swing.JLabel();
txtLectureclassroomid = new javax.swing.JTextField();
jLabel67 = new javax.swing.JLabel();
cmbLecturemoduleid = new javax.swing.JComboBox();
cmbLecturestarttime = new javax.swing.JComboBox();
dteLecturestartdate = new com.toedter.calendar.JDateChooser();
cmbLectureendtime = new javax.swing.JComboBox();
dteLectureenddate = new com.toedter.calendar.JDateChooser();
btnUpdatelecture = new javax.swing.JButton();
btnDeletelecture = new javax.swing.JButton();
btnInsertlecture = new javax.swing.JButton();
jPanel41 = new javax.swing.JPanel();
jPanel42 = new javax.swing.JPanel();
jLabel101 = new javax.swing.JLabel();
jLabel102 = new javax.swing.JLabel();
jLabel103 = new javax.swing.JLabel();
cmbStAttendanceStudentid = new javax.swing.JComboBox();
cmbStAttendanceLectureid = new javax.swing.JComboBox();
cmbStAttendancetime = new javax.swing.JComboBox();
dteStAttendancedate = new com.toedter.calendar.JDateChooser();
btnUpdateStAttendance = new javax.swing.JButton();
btnDeleteStAttendance = new javax.swing.JButton();
btnInsertStAttendance = new javax.swing.JButton();
jPanel43 = new javax.swing.JPanel();
jScrollPane19 = new javax.swing.JScrollPane();
tblStAttendance = new javax.swing.JTable();
txtSearchstattendance = new javax.swing.JTextField();
cmbStAttendancesearchin = new javax.swing.JComboBox();
jLabel89 = new javax.swing.JLabel();
LecturersPanel = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
jScrollPane4 = new javax.swing.JScrollPane();
tblLecturers = new javax.swing.JTable();
txtSearchlecturer = new javax.swing.JTextField();
cmbLecturersearchin = new javax.swing.JComboBox();
jLabel23 = new javax.swing.JLabel();
jPanel18 = new javax.swing.JPanel();
jLabel24 = new javax.swing.JLabel();
txtLecturerid = new javax.swing.JTextField();
jLabel25 = new javax.swing.JLabel();
txtLecturername = new javax.swing.JTextField();
jLabel26 = new javax.swing.JLabel();
txtLectureraddress = new javax.swing.JTextField();
jLabel27 = new javax.swing.JLabel();
txtLectureremail = new javax.swing.JTextField();
jLabel28 = new javax.swing.JLabel();
txtLecturerphone = new javax.swing.JTextField();
jLabel29 = new javax.swing.JLabel();
txtLecturerdescription = new javax.swing.JTextField();
btnUpdatelecturer = new javax.swing.JButton();
btnDeletelecturer = new javax.swing.JButton();
btnInsertlecturer = new javax.swing.JButton();
ClassroomsPanel = new javax.swing.JPanel();
jPanel13 = new javax.swing.JPanel();
jScrollPane13 = new javax.swing.JScrollPane();
tblClassrooms = new javax.swing.JTable();
txtSearchclassroom = new javax.swing.JTextField();
cmbClassroomsearchin = new javax.swing.JComboBox();
jLabel70 = new javax.swing.JLabel();
jPanel26 = new javax.swing.JPanel();
jLabel71 = new javax.swing.JLabel();
jLabel72 = new javax.swing.JLabel();
jLabel73 = new javax.swing.JLabel();
txtClassroomid = new javax.swing.JTextField();
txtClassroomname = new javax.swing.JTextField();
txtClassroomdescription = new javax.swing.JTextField();
btnInsertClassroom = new javax.swing.JButton();
btnDeleteClassroom = new javax.swing.JButton();
btnUpdateClassroom = new javax.swing.JButton();
BatchesPanel = new javax.swing.JPanel();
jPanel27 = new javax.swing.JPanel();
jScrollPane14 = new javax.swing.JScrollPane();
tblBatches = new javax.swing.JTable();
txtSearchbatch = new javax.swing.JTextField();
cmbBatchsearchin = new javax.swing.JComboBox();
jLabel77 = new javax.swing.JLabel();
jPanel28 = new javax.swing.JPanel();
jLabel78 = new javax.swing.JLabel();
jLabel79 = new javax.swing.JLabel();
txtBatchid = new javax.swing.JTextField();
txtBatchname = new javax.swing.JTextField();
dteBatchstartdate = new com.toedter.calendar.JDateChooser();
jLabel80 = new javax.swing.JLabel();
btnUpdateBatch = new javax.swing.JButton();
btnDeleteBatch = new javax.swing.JButton();
btnInsertBatch = new javax.swing.JButton();
UsersPanel = new javax.swing.JPanel();
jPanel11 = new javax.swing.JPanel();
jScrollPane11 = new javax.swing.JScrollPane();
tblUsers = new javax.swing.JTable();
txtSearchuser = new javax.swing.JTextField();
cmbUsersearchin = new javax.swing.JComboBox();
jLabel36 = new javax.swing.JLabel();
jPanel25 = new javax.swing.JPanel();
jLabel56 = new javax.swing.JLabel();
jLabel57 = new javax.swing.JLabel();
jLabel58 = new javax.swing.JLabel();
txtUserid = new javax.swing.JTextField();
txtUsername = new javax.swing.JTextField();
txtUseremail = new javax.swing.JTextField();
jLabel68 = new javax.swing.JLabel();
jLabel69 = new javax.swing.JLabel();
jLabel74 = new javax.swing.JLabel();
txtUserpassword = new javax.swing.JTextField();
cmbUsertype = new javax.swing.JComboBox();
cmbUserstatus = new javax.swing.JComboBox();
btnUpdateuser = new javax.swing.JButton();
btnDeleteuser = new javax.swing.JButton();
btnInsertuser = new javax.swing.JButton();
LogsPanel = new javax.swing.JPanel();
jPanel12 = new javax.swing.JPanel();
jScrollPane12 = new javax.swing.JScrollPane();
tblLogs = new javax.swing.JTable();
txtSearchlog = new javax.swing.JTextField();
cmbLogsearchin = new javax.swing.JComboBox();
jLabel37 = new javax.swing.JLabel();
btnRefreshlog = new javax.swing.JButton();
btnClearLog = new javax.swing.JButton();
ReportsPanel = new javax.swing.JPanel();
jPanel48 = new javax.swing.JPanel();
btnAllStudentsReport = new javax.swing.JButton();
btnStudentAssignmentsReport = new javax.swing.JButton();
btnStudentExamsReport = new javax.swing.JButton();
txtAssignmentReportStudentid = new javax.swing.JTextField();
btnStudentAssignmentReport2 = new javax.swing.JButton();
jLabel91 = new javax.swing.JLabel();
btnStudentExamsReport2 = new javax.swing.JButton();
jPanel51 = new javax.swing.JPanel();
btnStudentPaymentsReport = new javax.swing.JButton();
jLabel92 = new javax.swing.JLabel();
txtPaymentReportStudentid = new javax.swing.JTextField();
btnAllPaymentsReport1 = new javax.swing.JButton();
jPanel53 = new javax.swing.JPanel();
btnStudentBatchReport = new javax.swing.JButton();
jLabel115 = new javax.swing.JLabel();
txtBatchReportStudentid = new javax.swing.JTextField();
btnAllCoursesReport = new javax.swing.JButton();
btnAllBatchesReport = new javax.swing.JButton();
jLabel116 = new javax.swing.JLabel();
txtCourseStudentReportCourseid = new javax.swing.JTextField();
btnCourseStudentsReport = new javax.swing.JButton();
ToolsPanel = new javax.swing.JPanel();
jPanel49 = new javax.swing.JPanel();
txtSenderEmail = new javax.swing.JTextField();
txtSubject = new javax.swing.JTextField();
jScrollPane2 = new javax.swing.JScrollPane();
txtMessage = new javax.swing.JTextArea();
txtSenderEmailPassword = new javax.swing.JPasswordField();
btnSendMail = new javax.swing.JButton();
jLabel107 = new javax.swing.JLabel();
jLabel108 = new javax.swing.JLabel();
jLabel109 = new javax.swing.JLabel();
jLabel110 = new javax.swing.JLabel();
jLabel111 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jPanel50 = new javax.swing.JPanel();
btnBackup = new javax.swing.JButton();
jPanel52 = new javax.swing.JPanel();
btnRestore = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
txtSqlDump = new javax.swing.JTextField();
AboutPanel = new javax.swing.JPanel();
jLabel82 = new javax.swing.JLabel();
jLabel83 = new javax.swing.JLabel();
jLabel84 = new javax.swing.JLabel();
jLabel85 = new javax.swing.JLabel();
jLabel112 = new javax.swing.JLabel();
jLabel113 = new javax.swing.JLabel();
jLabel114 = new javax.swing.JLabel();
jLabel117 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Academy Management System");
TabbedPane.setTabPlacement(javax.swing.JTabbedPane.LEFT);
jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Students"));
tblStudents.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblStudents.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblStudentsMouseClicked(evt);
}
});
jScrollPane15.setViewportView(tblStudents);
txtSearchstudent.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchstudentKeyReleased(evt);
}
});
cmbStudentsearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "studentid", "student_name", "address", "gender", "birthday", "email", "phone", "background", "reg_date", "batchid" }));
jLabel81.setText("Search In:");
javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
jPanel14.setLayout(jPanel14Layout);
jPanel14Layout.setHorizontalGroup(
jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane15, javax.swing.GroupLayout.DEFAULT_SIZE, 1403, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel81)
.addGap(18, 18, 18)
.addComponent(cmbStudentsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchstudent, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel14Layout.setVerticalGroup(
jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchstudent, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbStudentsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel81))
.addGap(18, 18, 18)
.addComponent(jScrollPane15, javax.swing.GroupLayout.PREFERRED_SIZE, 238, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(19, 19, 19))
);
jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Student Record"));
jPanel16.setPreferredSize(new java.awt.Dimension(445, 298));
jLabel9.setText("Student ID:");
txtStudentid.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtStudentidKeyPressed(evt);
}
});
jLabel10.setText("Name:");
jLabel11.setText("Address:");
jLabel12.setText("Gender:");
jLabel13.setText("Birthday:");
jLabel6.setText("Email:");
jLabel7.setText("Phone:");
jLabel8.setText("Background:");
dteStudentbirthday.setDateFormatString("yyyy-MM-dd");
cmbStudentgender.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Male", "Female" }));
jLabel76.setText("Batch ID:");
jLabel14.setText("Reg. date:");
dteStudentregdate.setDateFormatString("yyyy-MM-dd");
javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
jPanel16.setLayout(jPanel16Layout);
jPanel16Layout.setHorizontalGroup(
jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel16Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE)
.addComponent(jLabel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel76, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(38, 38, 38)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(dteStudentregdate, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
.addComponent(txtStudentbackground, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtStudentphone, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtStudentemail, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(dteStudentbirthday, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cmbStudentgender, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(txtStudentaddress, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtStudentname, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtStudentid, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(cmbStudentbatchid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel16Layout.setVerticalGroup(
jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel16Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel9)
.addComponent(txtStudentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(4, 4, 4)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtStudentname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel10))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtStudentaddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel11))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel12)
.addComponent(cmbStudentgender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel13)
.addComponent(dteStudentbirthday, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtStudentemail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtStudentphone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7))
.addGap(8, 8, 8)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtStudentbackground, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel14)
.addComponent(dteStudentregdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cmbStudentbatchid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel76))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdatestudent.setText("Update");
btnUpdatestudent.setEnabled(false);
btnUpdatestudent.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdatestudentActionPerformed(evt);
}
});
btnDeletestudent.setText("Delete");
btnDeletestudent.setEnabled(false);
btnDeletestudent.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeletestudentActionPerformed(evt);
}
});
btnInsertstudent.setText("Insert");
btnInsertstudent.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertstudentActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel44Layout = new javax.swing.GroupLayout(jPanel44);
jPanel44.setLayout(jPanel44Layout);
jPanel44Layout.setHorizontalGroup(
jPanel44Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel44Layout.createSequentialGroup()
.addGroup(jPanel44Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel44Layout.createSequentialGroup()
.addComponent(btnUpdatestudent)
.addGap(18, 18, 18)
.addComponent(btnDeletestudent)
.addGap(18, 18, 18)
.addComponent(btnInsertstudent))
.addComponent(jPanel16, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 970, Short.MAX_VALUE))
.addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
jPanel44Layout.setVerticalGroup(
jPanel44Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel44Layout.createSequentialGroup()
.addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel44Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertstudent)
.addComponent(btnDeletestudent)
.addComponent(btnUpdatestudent))
.addContainerGap(18, Short.MAX_VALUE))
);
jTabbedPane5.addTab("Students", jPanel44);
jPanel46.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Student Course Record"));
jPanel46.setPreferredSize(new java.awt.Dimension(445, 116));
jLabel104.setText("Student ID:");
jLabel105.setText("Course ID: ");
jLabel106.setText("Fee:");
cmbStCourseStudentid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
cmbStCourseCourseid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
javax.swing.GroupLayout jPanel46Layout = new javax.swing.GroupLayout(jPanel46);
jPanel46.setLayout(jPanel46Layout);
jPanel46Layout.setHorizontalGroup(
jPanel46Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel46Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel46Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel104, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel105, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
.addComponent(jLabel106, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel46Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtStCourseFee, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
.addComponent(cmbStCourseStudentid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cmbStCourseCourseid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel46Layout.setVerticalGroup(
jPanel46Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel46Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel46Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel104)
.addComponent(cmbStCourseStudentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel46Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel105)
.addComponent(cmbStCourseCourseid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(9, 9, 9)
.addGroup(jPanel46Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel106)
.addComponent(txtStCourseFee, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdateStCourse.setText("Update");
btnUpdateStCourse.setEnabled(false);
btnUpdateStCourse.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateStCourseActionPerformed(evt);
}
});
btnDeleteStCourse.setText("Delete");
btnDeleteStCourse.setEnabled(false);
btnDeleteStCourse.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteStCourseActionPerformed(evt);
}
});
btnInsertStCourse.setText("Insert");
btnInsertStCourse.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertStCourseActionPerformed(evt);
}
});
jPanel47.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Student Courses"));
tblStCourse.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblStCourse.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblStCourseMouseClicked(evt);
}
});
jScrollPane20.setViewportView(tblStCourse);
txtSearchstcourse.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchstcourseKeyReleased(evt);
}
});
cmbStCoursesearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "studentid", "courseid", "fee", "userid" }));
jLabel90.setText("Search In:");
javax.swing.GroupLayout jPanel47Layout = new javax.swing.GroupLayout(jPanel47);
jPanel47.setLayout(jPanel47Layout);
jPanel47Layout.setHorizontalGroup(
jPanel47Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane20, javax.swing.GroupLayout.DEFAULT_SIZE, 952, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel47Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel90)
.addGap(18, 18, 18)
.addComponent(cmbStCoursesearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchstcourse, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel47Layout.setVerticalGroup(
jPanel47Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel47Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel47Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchstcourse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbStCoursesearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel90))
.addGap(18, 18, 18)
.addComponent(jScrollPane20, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
javax.swing.GroupLayout jPanel45Layout = new javax.swing.GroupLayout(jPanel45);
jPanel45.setLayout(jPanel45Layout);
jPanel45Layout.setHorizontalGroup(
jPanel45Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel45Layout.createSequentialGroup()
.addGroup(jPanel45Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jPanel46, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel45Layout.createSequentialGroup()
.addComponent(btnUpdateStCourse)
.addGap(18, 18, 18)
.addComponent(btnDeleteStCourse)
.addGap(18, 18, 18)
.addComponent(btnInsertStCourse)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel47, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel45Layout.setVerticalGroup(
jPanel45Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel45Layout.createSequentialGroup()
.addGroup(jPanel45Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel47, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel45Layout.createSequentialGroup()
.addComponent(jPanel46, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel45Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertStCourse)
.addComponent(btnDeleteStCourse)
.addComponent(btnUpdateStCourse))))
.addGap(0, 0, Short.MAX_VALUE))
);
jTabbedPane5.addTab("Student Courses", jPanel45);
jPanel55.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Student Batch Record"));
jPanel55.setPreferredSize(new java.awt.Dimension(445, 116));
jLabel118.setText("Student ID:");
jLabel119.setText("Batch ID: ");
cmbStBatchStudentid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
cmbStBatchBatchid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
javax.swing.GroupLayout jPanel55Layout = new javax.swing.GroupLayout(jPanel55);
jPanel55.setLayout(jPanel55Layout);
jPanel55Layout.setHorizontalGroup(
jPanel55Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel55Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel55Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel118, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel119, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel55Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(cmbStBatchStudentid, 0, 289, Short.MAX_VALUE)
.addComponent(cmbStBatchBatchid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel55Layout.setVerticalGroup(
jPanel55Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel55Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel55Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel118)
.addComponent(cmbStBatchStudentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel55Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel119)
.addComponent(cmbStBatchBatchid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(37, Short.MAX_VALUE))
);
jPanel56.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Student Batches"));
tblStBatch.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblStBatch.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblStBatchMouseClicked(evt);
}
});
jScrollPane21.setViewportView(tblStBatch);
txtSearchstbatch.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchstbatchKeyReleased(evt);
}
});
cmbStBatchsearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "studentid", "batchid", "userid" }));
jLabel121.setText("Search In:");
javax.swing.GroupLayout jPanel56Layout = new javax.swing.GroupLayout(jPanel56);
jPanel56.setLayout(jPanel56Layout);
jPanel56Layout.setHorizontalGroup(
jPanel56Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane21, javax.swing.GroupLayout.DEFAULT_SIZE, 952, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel56Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel121)
.addGap(18, 18, 18)
.addComponent(cmbStBatchsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchstbatch, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel56Layout.setVerticalGroup(
jPanel56Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel56Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel56Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchstbatch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbStBatchsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel121))
.addGap(18, 18, 18)
.addComponent(jScrollPane21, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
btnDeleteStBatch.setText("Delete");
btnDeleteStBatch.setEnabled(false);
btnDeleteStBatch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteStBatchActionPerformed(evt);
}
});
btnInsertStBatch.setText("Insert");
btnInsertStBatch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertStBatchActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel54Layout = new javax.swing.GroupLayout(jPanel54);
jPanel54.setLayout(jPanel54Layout);
jPanel54Layout.setHorizontalGroup(
jPanel54Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel54Layout.createSequentialGroup()
.addGroup(jPanel54Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jPanel55, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel54Layout.createSequentialGroup()
.addComponent(btnDeleteStBatch)
.addGap(18, 18, 18)
.addComponent(btnInsertStBatch)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel56, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel54Layout.setVerticalGroup(
jPanel54Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel54Layout.createSequentialGroup()
.addGroup(jPanel54Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel56, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel54Layout.createSequentialGroup()
.addComponent(jPanel55, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel54Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertStBatch)
.addComponent(btnDeleteStBatch))))
.addGap(0, 335, Short.MAX_VALUE))
);
jTabbedPane5.addTab("Student Batches", jPanel54);
javax.swing.GroupLayout StudentsPanelLayout = new javax.swing.GroupLayout(StudentsPanel);
StudentsPanel.setLayout(StudentsPanelLayout);
StudentsPanelLayout.setHorizontalGroup(
StudentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane5)
);
StudentsPanelLayout.setVerticalGroup(
StudentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane5)
);
TabbedPane.addTab("Students", new javax.swing.ImageIcon(getClass().getResource("/res/studenticon.jpg")), StudentsPanel, "Manage Students Information"); // NOI18N
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Departments"));
tblDepartments.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblDepartments.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblDepartmentsMouseClicked(evt);
}
});
jScrollPane1.setViewportView(tblDepartments);
txtSearchdepartment.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchdepartmentKeyReleased(evt);
}
});
cmbDepartmentsearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "departmentid", "department_name", "description", "userid" }));
jLabel4.setText("Search In:");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel4)
.addGap(18, 18, 18)
.addComponent(cmbDepartmentsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchdepartment, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchdepartment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbDepartmentsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addGap(18, 18, 18)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Department Record"));
jPanel15.setPreferredSize(new java.awt.Dimension(445, 116));
jLabel1.setText("Department ID:");
jLabel2.setText("Department Name: ");
jLabel3.setText("Description:");
txtDepartmentid.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtDepartmentidKeyPressed(evt);
}
});
javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
jPanel15.setLayout(jPanel15Layout);
jPanel15Layout.setHorizontalGroup(
jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel15Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtDepartmentdescription, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
.addComponent(txtDepartmentid)
.addComponent(txtDepartmentname, javax.swing.GroupLayout.Alignment.TRAILING))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel15Layout.setVerticalGroup(
jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel15Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(txtDepartmentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(txtDepartmentname, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3)
.addComponent(txtDepartmentdescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnInsertDepartment.setText("Insert");
btnInsertDepartment.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertDepartmentActionPerformed(evt);
}
});
btnUpdateDepartment.setText("Update");
btnUpdateDepartment.setEnabled(false);
btnUpdateDepartment.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateDepartmentActionPerformed(evt);
}
});
btnDeleteDepartment.setText("Delete");
btnDeleteDepartment.setEnabled(false);
btnDeleteDepartment.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteDepartmentActionPerformed(evt);
}
});
javax.swing.GroupLayout DepartmentsPanelLayout = new javax.swing.GroupLayout(DepartmentsPanel);
DepartmentsPanel.setLayout(DepartmentsPanelLayout);
DepartmentsPanelLayout.setHorizontalGroup(
DepartmentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(DepartmentsPanelLayout.createSequentialGroup()
.addGroup(DepartmentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(DepartmentsPanelLayout.createSequentialGroup()
.addComponent(btnUpdateDepartment)
.addGap(18, 18, 18)
.addComponent(btnDeleteDepartment)
.addGap(18, 18, 18)
.addComponent(btnInsertDepartment))
.addComponent(jPanel15, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 975, Short.MAX_VALUE))
);
DepartmentsPanelLayout.setVerticalGroup(
DepartmentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(DepartmentsPanelLayout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(DepartmentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertDepartment)
.addComponent(btnDeleteDepartment)
.addComponent(btnUpdateDepartment))
.addGap(0, 210, Short.MAX_VALUE))
);
TabbedPane.addTab("Departments", new javax.swing.ImageIcon(getClass().getResource("/res/departments.png")), DepartmentsPanel, "Manage Departments Information"); // NOI18N
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Practicals"));
tblPracticals.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblPracticals.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblPracticalsMouseClicked(evt);
}
});
jScrollPane5.setViewportView(tblPracticals);
txtSearchpractical.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchpracticalKeyReleased(evt);
}
});
cmbPracticalsearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "practicalid", "starttime", "endtime", "studentid", "classroomid", "userid" }));
jLabel30.setText("Search In:");
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 1408, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel30)
.addGap(18, 18, 18)
.addComponent(cmbPracticalsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchpractical, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchpractical, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbPracticalsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel30))
.addGap(18, 18, 18)
.addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel19.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Practical Record"));
jPanel19.setPreferredSize(new java.awt.Dimension(445, 186));
jLabel38.setText("Practical ID:");
jLabel39.setText("Start Time: ");
jLabel40.setText("End Time:");
txtPracticalid.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtPracticalidKeyPressed(evt);
}
});
jLabel59.setText("Student ID:");
jLabel60.setText("Classroom ID:");
cmbPracticalstarttime.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00" }));
dtePracticalstartdate.setDateFormatString("yyyy-MM-dd");
cmbPracticalendtime.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00" }));
dtePracticalenddate.setDateFormatString("yyyy-MM-dd");
javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
jPanel19.setLayout(jPanel19Layout);
jPanel19Layout.setHorizontalGroup(
jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel19Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel38, javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE)
.addComponent(jLabel39, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel40, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel59, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(jLabel60, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(34, 34, 34)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(cmbPracticalclassroomid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel19Layout.createSequentialGroup()
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(dtePracticalenddate, javax.swing.GroupLayout.DEFAULT_SIZE, 229, Short.MAX_VALUE)
.addComponent(dtePracticalstartdate, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(cmbPracticalstarttime, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cmbPracticalendtime, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addComponent(txtPracticalid)
.addComponent(cmbPracticalstudentid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jPanel19Layout.setVerticalGroup(
jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel19Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel38)
.addComponent(txtPracticalid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(cmbPracticalstarttime, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(dtePracticalstartdate, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel39, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel40)
.addComponent(dtePracticalenddate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbPracticalendtime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel19Layout.createSequentialGroup()
.addGap(15, 15, 15)
.addComponent(jLabel59))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel19Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cmbPracticalstudentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel60)
.addComponent(cmbPracticalclassroomid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdatepractical.setText("Update");
btnUpdatepractical.setEnabled(false);
btnUpdatepractical.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdatepracticalActionPerformed(evt);
}
});
btnDeletepractical.setText("Delete");
btnDeletepractical.setEnabled(false);
btnDeletepractical.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeletepracticalActionPerformed(evt);
}
});
btnInsertpractical.setText("Insert");
btnInsertpractical.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertpracticalActionPerformed(evt);
}
});
javax.swing.GroupLayout PracticalsPanelLayout = new javax.swing.GroupLayout(PracticalsPanel);
PracticalsPanel.setLayout(PracticalsPanelLayout);
PracticalsPanelLayout.setHorizontalGroup(
PracticalsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(PracticalsPanelLayout.createSequentialGroup()
.addGroup(PracticalsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(PracticalsPanelLayout.createSequentialGroup()
.addComponent(btnUpdatepractical)
.addGap(18, 18, 18)
.addComponent(btnDeletepractical)
.addGap(18, 18, 18)
.addComponent(btnInsertpractical))
.addComponent(jPanel19, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 437, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
PracticalsPanelLayout.setVerticalGroup(
PracticalsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PracticalsPanelLayout.createSequentialGroup()
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(PracticalsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertpractical)
.addComponent(btnDeletepractical)
.addComponent(btnUpdatepractical))
.addGap(0, 155, Short.MAX_VALUE))
);
TabbedPane.addTab("Practicals", new javax.swing.ImageIcon(getClass().getResource("/res/practicals.jpg")), PracticalsPanel, "Manage Practicals Information"); // NOI18N
jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Payments"));
tblPayments.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblPayments.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblPaymentsMouseClicked(evt);
}
});
jScrollPane6.setViewportView(tblPayments);
txtSearchpayment.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchpaymentKeyReleased(evt);
}
});
cmbPaymentsearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "paymentid", "amount", "time", "studentid", "userid" }));
jLabel31.setText("Search In:");
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
jPanel6.setLayout(jPanel6Layout);
jPanel6Layout.setHorizontalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 1408, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel31)
.addGap(18, 18, 18)
.addComponent(cmbPaymentsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchpayment, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel6Layout.setVerticalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchpayment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbPaymentsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel31))
.addGap(18, 18, 18)
.addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel20.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Payment Record"));
jPanel20.setPreferredSize(new java.awt.Dimension(445, 142));
jLabel41.setText("Payment ID:");
jLabel42.setText("Amount: ");
jLabel43.setText("Time:");
txtPaymentid.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtPaymentidKeyPressed(evt);
}
});
jLabel61.setText("Student ID:");
cmbPaymenttime.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00" }));
dtePaymentdate.setDateFormatString("yyyy-MM-dd");
javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
jPanel20.setLayout(jPanel20Layout);
jPanel20Layout.setHorizontalGroup(
jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel20Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel43, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel61, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel41, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel42, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
.addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel20Layout.createSequentialGroup()
.addComponent(dtePaymentdate, javax.swing.GroupLayout.DEFAULT_SIZE, 229, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(cmbPaymenttime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(txtPaymentamount, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtPaymentid, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(cmbPaymentstudentid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jPanel20Layout.setVerticalGroup(
jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel20Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel41)
.addComponent(txtPaymentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel42)
.addComponent(txtPaymentamount, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(cmbPaymenttime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel43)
.addComponent(dtePaymentdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel61)
.addComponent(cmbPaymentstudentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdatepayment.setText("Update");
btnUpdatepayment.setEnabled(false);
btnUpdatepayment.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdatepaymentActionPerformed(evt);
}
});
btnDeletepayment.setText("Delete");
btnDeletepayment.setEnabled(false);
btnDeletepayment.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeletepaymentActionPerformed(evt);
}
});
btnInsertpayment.setText("Insert");
btnInsertpayment.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertpaymentActionPerformed(evt);
}
});
javax.swing.GroupLayout PaymentsPanelLayout = new javax.swing.GroupLayout(PaymentsPanel);
PaymentsPanel.setLayout(PaymentsPanelLayout);
PaymentsPanelLayout.setHorizontalGroup(
PaymentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(PaymentsPanelLayout.createSequentialGroup()
.addGroup(PaymentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(PaymentsPanelLayout.createSequentialGroup()
.addComponent(btnUpdatepayment)
.addGap(18, 18, 18)
.addComponent(btnDeletepayment)
.addGap(18, 18, 18)
.addComponent(btnInsertpayment))
.addComponent(jPanel20, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(975, Short.MAX_VALUE))
);
PaymentsPanelLayout.setVerticalGroup(
PaymentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PaymentsPanelLayout.createSequentialGroup()
.addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(PaymentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertpayment)
.addComponent(btnDeletepayment)
.addComponent(btnUpdatepayment))
.addGap(0, 184, Short.MAX_VALUE))
);
TabbedPane.addTab("Payments", new javax.swing.ImageIcon(getClass().getResource("/res/payments.jpg")), PaymentsPanel, "Manage Payments Information"); // NOI18N
jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Modules"));
tblModules.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblModules.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblModulesMouseClicked(evt);
}
});
jScrollPane7.setViewportView(tblModules);
txtSearchmodule.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchmoduleKeyReleased(evt);
}
});
cmbModulesearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "moduleid", "module_name", "description", "lecturerid", "userid" }));
jLabel32.setText("Search In:");
javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
jPanel7.setLayout(jPanel7Layout);
jPanel7Layout.setHorizontalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 1408, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel32)
.addGap(18, 18, 18)
.addComponent(cmbModulesearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchmodule, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel7Layout.setVerticalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchmodule, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbModulesearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel32))
.addGap(18, 18, 18)
.addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel21.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Module Record"));
jPanel21.setPreferredSize(new java.awt.Dimension(445, 160));
jLabel44.setText("Module ID:");
jLabel45.setText("Module Name: ");
jLabel46.setText("Description:");
txtModuleid.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtModuleidKeyPressed(evt);
}
});
jLabel62.setText("Lecturer ID:");
javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21);
jPanel21.setLayout(jPanel21Layout);
jPanel21Layout.setHorizontalGroup(
jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel21Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel45, javax.swing.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE)
.addComponent(jLabel44, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel46, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel62, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(30, 30, 30)
.addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(cmbModulelecturerid, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtModuledescription, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
.addComponent(txtModulename, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtModuleid, javax.swing.GroupLayout.Alignment.TRAILING)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel21Layout.setVerticalGroup(
jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel21Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel44)
.addComponent(txtModuleid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel45)
.addComponent(txtModulename, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel46)
.addComponent(txtModuledescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel62)
.addComponent(cmbModulelecturerid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdatemodule.setText("Update");
btnUpdatemodule.setEnabled(false);
btnUpdatemodule.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdatemoduleActionPerformed(evt);
}
});
btnDeletemodule.setText("Delete");
btnDeletemodule.setEnabled(false);
btnDeletemodule.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeletemoduleActionPerformed(evt);
}
});
btnInsertmodule.setText("Insert");
btnInsertmodule.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertmoduleActionPerformed(evt);
}
});
javax.swing.GroupLayout ModulesPanelLayout = new javax.swing.GroupLayout(ModulesPanel);
ModulesPanel.setLayout(ModulesPanelLayout);
ModulesPanelLayout.setHorizontalGroup(
ModulesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(ModulesPanelLayout.createSequentialGroup()
.addGroup(ModulesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(ModulesPanelLayout.createSequentialGroup()
.addComponent(btnUpdatemodule)
.addGap(18, 18, 18)
.addComponent(btnDeletemodule)
.addGap(18, 18, 18)
.addComponent(btnInsertmodule))
.addComponent(jPanel21, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE))
);
ModulesPanelLayout.setVerticalGroup(
ModulesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ModulesPanelLayout.createSequentialGroup()
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(ModulesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertmodule)
.addComponent(btnDeletemodule)
.addComponent(btnUpdatemodule))
.addGap(0, 184, Short.MAX_VALUE))
);
TabbedPane.addTab("Modules", new javax.swing.ImageIcon(getClass().getResource("/res/modules.png")), ModulesPanel, "Manage Modules Information"); // NOI18N
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Courses"));
tblCourses.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblCourses.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblCoursesMouseClicked(evt);
}
});
jScrollPane3.setViewportView(tblCourses);
txtSearchcourse.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchcourseKeyReleased(evt);
}
});
cmbCoursesearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "courseid", "course_name", "duration", "fee", "level", "departmentid", "coordinatorid", "userid" }));
jLabel15.setText("Search In:");
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 1403, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel15)
.addGap(18, 18, 18)
.addComponent(cmbCoursesearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchcourse, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchcourse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbCoursesearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel15))
.addGap(18, 18, 18)
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel17.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Course Record"));
jPanel17.setPreferredSize(new java.awt.Dimension(445, 261));
jLabel16.setText("Course ID:");
txtCourseid.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtCourseidKeyPressed(evt);
}
});
jLabel17.setText("Course Name:");
jLabel18.setText("Duration:");
jLabel19.setText("Fee:");
jLabel20.setText("Level:");
jLabel21.setText("Department ID:");
jLabel22.setText("Coordinator ID:");
javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
jPanel17.setLayout(jPanel17Layout);
jPanel17Layout.setHorizontalGroup(
jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel17Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel20, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel21, javax.swing.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)
.addComponent(jLabel22, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(cmbCoursedepartmentid, javax.swing.GroupLayout.Alignment.LEADING, 0, 305, Short.MAX_VALUE)
.addComponent(txtCourselevel, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtCoursefee, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtCourseduration, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(cmbCoursecoordinatorid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(txtCourseid)
.addComponent(txtCoursename))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel17Layout.setVerticalGroup(
jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel17Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel16)
.addComponent(txtCourseid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel17)
.addComponent(txtCoursename, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel18)
.addComponent(txtCourseduration, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtCoursefee, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel19))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel20)
.addComponent(txtCourselevel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel21)
.addComponent(cmbCoursedepartmentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel22)
.addComponent(cmbCoursecoordinatorid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdatecourse.setText("Update");
btnUpdatecourse.setEnabled(false);
btnUpdatecourse.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdatecourseActionPerformed(evt);
}
});
btnDeletecourse.setText("Delete");
btnDeletecourse.setEnabled(false);
btnDeletecourse.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeletecourseActionPerformed(evt);
}
});
btnInsertcourse.setText("Insert");
btnInsertcourse.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertcourseActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel36Layout = new javax.swing.GroupLayout(jPanel36);
jPanel36.setLayout(jPanel36Layout);
jPanel36Layout.setHorizontalGroup(
jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel36Layout.createSequentialGroup()
.addGroup(jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel36Layout.createSequentialGroup()
.addComponent(btnUpdatecourse)
.addGap(18, 18, 18)
.addComponent(btnDeletecourse)
.addGap(18, 18, 18)
.addComponent(btnInsertcourse))
.addComponent(jPanel17, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 970, Short.MAX_VALUE))
);
jPanel36Layout.setVerticalGroup(
jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel36Layout.createSequentialGroup()
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertcourse)
.addComponent(btnDeletecourse)
.addComponent(btnUpdatecourse))
.addGap(0, 68, Short.MAX_VALUE))
);
jTabbedPane3.addTab("Courses", jPanel36);
jPanel38.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Course Module Record"));
jPanel38.setPreferredSize(new java.awt.Dimension(445, 116));
jLabel99.setText("Course ID:");
jLabel100.setText("Module ID: ");
cmbCourseModuleCourseid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
cmbCourseModuleModuleid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
javax.swing.GroupLayout jPanel38Layout = new javax.swing.GroupLayout(jPanel38);
jPanel38.setLayout(jPanel38Layout);
jPanel38Layout.setHorizontalGroup(
jPanel38Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel38Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel38Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel99, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel100, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel38Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(cmbCourseModuleCourseid, 0, 289, Short.MAX_VALUE)
.addComponent(cmbCourseModuleModuleid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel38Layout.setVerticalGroup(
jPanel38Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel38Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel38Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel99)
.addComponent(cmbCourseModuleCourseid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel38Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel100)
.addComponent(cmbCourseModuleModuleid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel39.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Course Modules"));
tblCourseModules.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblCourseModules.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblCourseModulesMouseClicked(evt);
}
});
jScrollPane18.setViewportView(tblCourseModules);
txtSearchcoursemodule.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchcoursemoduleKeyReleased(evt);
}
});
cmbCourseModulesearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "courseid", "moduleid", "userid" }));
jLabel88.setText("Search In:");
javax.swing.GroupLayout jPanel39Layout = new javax.swing.GroupLayout(jPanel39);
jPanel39.setLayout(jPanel39Layout);
jPanel39Layout.setHorizontalGroup(
jPanel39Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane18, javax.swing.GroupLayout.DEFAULT_SIZE, 952, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel39Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel88)
.addGap(18, 18, 18)
.addComponent(cmbCourseModulesearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchcoursemodule, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel39Layout.setVerticalGroup(
jPanel39Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel39Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel39Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchcoursemodule, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbCourseModulesearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel88))
.addGap(18, 18, 18)
.addComponent(jScrollPane18, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
btnDeleteCourseModule.setText("Delete");
btnDeleteCourseModule.setEnabled(false);
btnDeleteCourseModule.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteCourseModuleActionPerformed(evt);
}
});
btnInsertCourseModule.setText("Insert");
btnInsertCourseModule.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertCourseModuleActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel37Layout = new javax.swing.GroupLayout(jPanel37);
jPanel37.setLayout(jPanel37Layout);
jPanel37Layout.setHorizontalGroup(
jPanel37Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel37Layout.createSequentialGroup()
.addGroup(jPanel37Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jPanel38, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel37Layout.createSequentialGroup()
.addComponent(btnDeleteCourseModule)
.addGap(18, 18, 18)
.addComponent(btnInsertCourseModule)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel39, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel37Layout.setVerticalGroup(
jPanel37Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel37Layout.createSequentialGroup()
.addGroup(jPanel37Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel39, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel37Layout.createSequentialGroup()
.addComponent(jPanel38, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel37Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertCourseModule)
.addComponent(btnDeleteCourseModule))))
.addGap(0, 0, Short.MAX_VALUE))
);
jTabbedPane3.addTab("Course Modules", jPanel37);
jPanel58.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Course Batch Record"));
jPanel58.setPreferredSize(new java.awt.Dimension(445, 116));
jLabel120.setText("Course ID:");
jLabel122.setText("Batch ID: ");
cmbCourseBatchCourseid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
cmbCourseBatchBatchid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
javax.swing.GroupLayout jPanel58Layout = new javax.swing.GroupLayout(jPanel58);
jPanel58.setLayout(jPanel58Layout);
jPanel58Layout.setHorizontalGroup(
jPanel58Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel58Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel58Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel120, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel122, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel58Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(cmbCourseBatchCourseid, 0, 289, Short.MAX_VALUE)
.addComponent(cmbCourseBatchBatchid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel58Layout.setVerticalGroup(
jPanel58Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel58Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel58Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel120)
.addComponent(cmbCourseBatchCourseid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel58Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel122)
.addComponent(cmbCourseBatchBatchid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnDeleteCourseBatch.setText("Delete");
btnDeleteCourseBatch.setEnabled(false);
btnDeleteCourseBatch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteCourseBatchActionPerformed(evt);
}
});
btnInsertCourseBatch.setText("Insert");
btnInsertCourseBatch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertCourseBatchActionPerformed(evt);
}
});
jPanel59.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Course Batches"));
tblCourseBatches.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblCourseBatches.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblCourseBatchesMouseClicked(evt);
}
});
jScrollPane22.setViewportView(tblCourseBatches);
txtSearchcoursebatch.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchcoursebatchKeyReleased(evt);
}
});
cmbCourseBatchsearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "courseid", "moduleid", "userid" }));
jLabel123.setText("Search In:");
javax.swing.GroupLayout jPanel59Layout = new javax.swing.GroupLayout(jPanel59);
jPanel59.setLayout(jPanel59Layout);
jPanel59Layout.setHorizontalGroup(
jPanel59Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane22, javax.swing.GroupLayout.DEFAULT_SIZE, 952, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel59Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel123)
.addGap(18, 18, 18)
.addComponent(cmbCourseBatchsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchcoursebatch, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel59Layout.setVerticalGroup(
jPanel59Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel59Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel59Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchcoursebatch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbCourseBatchsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel123))
.addGap(18, 18, 18)
.addComponent(jScrollPane22, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
javax.swing.GroupLayout jPanel57Layout = new javax.swing.GroupLayout(jPanel57);
jPanel57.setLayout(jPanel57Layout);
jPanel57Layout.setHorizontalGroup(
jPanel57Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel57Layout.createSequentialGroup()
.addGroup(jPanel57Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jPanel58, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel57Layout.createSequentialGroup()
.addComponent(btnDeleteCourseBatch)
.addGap(18, 18, 18)
.addComponent(btnInsertCourseBatch)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel59, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel57Layout.setVerticalGroup(
jPanel57Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel57Layout.createSequentialGroup()
.addGroup(jPanel57Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel59, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel57Layout.createSequentialGroup()
.addComponent(jPanel58, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel57Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertCourseBatch)
.addComponent(btnDeleteCourseBatch))))
.addGap(0, 0, Short.MAX_VALUE))
);
jTabbedPane3.addTab("Course Batches", jPanel57);
javax.swing.GroupLayout CoursesPanelLayout = new javax.swing.GroupLayout(CoursesPanel);
CoursesPanel.setLayout(CoursesPanelLayout);
CoursesPanelLayout.setHorizontalGroup(
CoursesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane3)
);
CoursesPanelLayout.setVerticalGroup(
CoursesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane3)
);
TabbedPane.addTab("Courses", new javax.swing.ImageIcon(getClass().getResource("/res/courses.png")), CoursesPanel, "Manage Courses Information"); // NOI18N
jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Exams"));
tblExams.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblExams.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblExamsMouseClicked(evt);
}
});
jScrollPane8.setViewportView(tblExams);
txtSearchexam.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchexamKeyReleased(evt);
}
});
cmbExamsearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "examid", "starttime", "endtime", "moduleid", "userid" }));
jLabel33.setText("Search In:");
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 1403, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel33)
.addGap(18, 18, 18)
.addComponent(cmbExamsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchexam, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchexam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbExamsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel33))
.addGap(18, 18, 18)
.addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel22.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Exam Record"));
jPanel22.setPreferredSize(new java.awt.Dimension(445, 160));
jLabel47.setText("Exam ID:");
jLabel48.setText("Start Time: ");
jLabel49.setText("End Time:");
txtExamid.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtExamidKeyPressed(evt);
}
});
jLabel63.setText("Module ID:");
cmbExamstarttime.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00" }));
dteExamstartdate.setDateFormatString("yyyy-MM-dd");
cmbExamendtime.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00" }));
dteExamenddate.setDateFormatString("yyyy-MM-dd");
javax.swing.GroupLayout jPanel22Layout = new javax.swing.GroupLayout(jPanel22);
jPanel22.setLayout(jPanel22Layout);
jPanel22Layout.setHorizontalGroup(
jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel22Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel63)
.addComponent(jLabel48, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLabel47, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLabel49, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(45, 45, 45)
.addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel22Layout.createSequentialGroup()
.addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(dteExamenddate, javax.swing.GroupLayout.DEFAULT_SIZE, 236, Short.MAX_VALUE)
.addComponent(dteExamstartdate, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(11, 11, 11)
.addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(cmbExamstarttime, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cmbExamendtime, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addComponent(txtExamid)
.addComponent(cmbExammoduleid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jPanel22Layout.setVerticalGroup(
jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel22Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel47)
.addComponent(txtExamid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel48)
.addComponent(dteExamstartdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(cmbExamstarttime, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(dteExamenddate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel49))
.addComponent(cmbExamendtime, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cmbExammoduleid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel63))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdateexam.setText("Update");
btnUpdateexam.setEnabled(false);
btnUpdateexam.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateexamActionPerformed(evt);
}
});
btnDeleteexam.setText("Delete");
btnDeleteexam.setEnabled(false);
btnDeleteexam.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteexamActionPerformed(evt);
}
});
btnInsertexam.setText("Insert");
btnInsertexam.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertexamActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel31Layout = new javax.swing.GroupLayout(jPanel31);
jPanel31.setLayout(jPanel31Layout);
jPanel31Layout.setHorizontalGroup(
jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel31Layout.createSequentialGroup()
.addGroup(jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel31Layout.createSequentialGroup()
.addComponent(btnUpdateexam)
.addGap(18, 18, 18)
.addComponent(btnDeleteexam)
.addGap(18, 18, 18)
.addComponent(btnInsertexam))
.addComponent(jPanel22, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(970, Short.MAX_VALUE))
);
jPanel31Layout.setVerticalGroup(
jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel31Layout.createSequentialGroup()
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel22, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertexam)
.addComponent(btnDeleteexam)
.addComponent(btnUpdateexam))
.addGap(0, 146, Short.MAX_VALUE))
);
jTabbedPane2.addTab("Exams", jPanel31);
jPanel34.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Student Exam Record"));
jPanel34.setPreferredSize(new java.awt.Dimension(445, 116));
jLabel96.setText("Student ID:");
jLabel97.setText("Exam ID: ");
jLabel98.setText("Marks:");
cmbStExamStudentid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
cmbStExamExamid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
javax.swing.GroupLayout jPanel34Layout = new javax.swing.GroupLayout(jPanel34);
jPanel34.setLayout(jPanel34Layout);
jPanel34Layout.setHorizontalGroup(
jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel34Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel96, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel97, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
.addComponent(jLabel98, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtStExamMarks, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
.addComponent(cmbStExamStudentid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cmbStExamExamid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel34Layout.setVerticalGroup(
jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel34Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel96)
.addComponent(cmbStExamStudentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel97)
.addComponent(cmbStExamExamid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(9, 9, 9)
.addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel98)
.addComponent(txtStExamMarks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdateStExam.setText("Update");
btnUpdateStExam.setEnabled(false);
btnUpdateStExam.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateStExamActionPerformed(evt);
}
});
btnDeleteStExam.setText("Delete");
btnDeleteStExam.setEnabled(false);
btnDeleteStExam.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteStExamActionPerformed(evt);
}
});
btnInsertStExam.setText("Insert");
btnInsertStExam.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertStExamActionPerformed(evt);
}
});
jPanel35.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Student Exams"));
tblStExam.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblStExam.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblStExamMouseClicked(evt);
}
});
jScrollPane17.setViewportView(tblStExam);
txtSearchstexam.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchstexamKeyReleased(evt);
}
});
cmbStExamsearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "studentid", "examid", "marks", "userid" }));
jLabel87.setText("Search In:");
javax.swing.GroupLayout jPanel35Layout = new javax.swing.GroupLayout(jPanel35);
jPanel35.setLayout(jPanel35Layout);
jPanel35Layout.setHorizontalGroup(
jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane17, javax.swing.GroupLayout.DEFAULT_SIZE, 952, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel35Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel87)
.addGap(18, 18, 18)
.addComponent(cmbStExamsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchstexam, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel35Layout.setVerticalGroup(
jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel35Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchstexam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbStExamsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel87))
.addGap(18, 18, 18)
.addComponent(jScrollPane17, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
javax.swing.GroupLayout jPanel32Layout = new javax.swing.GroupLayout(jPanel32);
jPanel32.setLayout(jPanel32Layout);
jPanel32Layout.setHorizontalGroup(
jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel32Layout.createSequentialGroup()
.addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jPanel34, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel32Layout.createSequentialGroup()
.addComponent(btnUpdateStExam)
.addGap(18, 18, 18)
.addComponent(btnDeleteStExam)
.addGap(18, 18, 18)
.addComponent(btnInsertStExam)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel35, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel32Layout.setVerticalGroup(
jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel32Layout.createSequentialGroup()
.addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel35, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel32Layout.createSequentialGroup()
.addComponent(jPanel34, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertStExam)
.addComponent(btnDeleteStExam)
.addComponent(btnUpdateStExam))))
.addGap(0, 0, Short.MAX_VALUE))
);
jTabbedPane2.addTab("Student Exams", jPanel32);
javax.swing.GroupLayout ExamsPanelLayout = new javax.swing.GroupLayout(ExamsPanel);
ExamsPanel.setLayout(ExamsPanelLayout);
ExamsPanelLayout.setHorizontalGroup(
ExamsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane2)
);
ExamsPanelLayout.setVerticalGroup(
ExamsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane2)
);
TabbedPane.addTab("Exams", new javax.swing.ImageIcon(getClass().getResource("/res/exams.png")), ExamsPanel, "Manage Exams Information"); // NOI18N
jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Assignments"));
tblAssignments.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblAssignments.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblAssignmentsMouseClicked(evt);
}
});
jScrollPane9.setViewportView(tblAssignments);
txtSearchassignment.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchassignmentKeyReleased(evt);
}
});
cmbAssignmentsearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "assignmentid", "assignment_name", "description", "moduleid", "userid" }));
jLabel34.setText("Search In:");
javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
jPanel9.setLayout(jPanel9Layout);
jPanel9Layout.setHorizontalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 1403, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel34)
.addGap(18, 18, 18)
.addComponent(cmbAssignmentsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchassignment, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel9Layout.setVerticalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchassignment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbAssignmentsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel34))
.addGap(18, 18, 18)
.addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel23.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Assignment Record"));
jPanel23.setPreferredSize(new java.awt.Dimension(445, 188));
jPanel23.setRequestFocusEnabled(false);
jLabel50.setText("Assignment ID:");
jLabel51.setText("Assignment Name: ");
jLabel52.setText("Description:");
txtAssignmentid.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtAssignmentidKeyPressed(evt);
}
});
jLabel75.setText("Due Date:");
dteAssignmentduedate.setDateFormatString("yyyy-MM-dd");
jLabel64.setText("Module ID:");
cmbAssignmentduetime.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00" }));
javax.swing.GroupLayout jPanel23Layout = new javax.swing.GroupLayout(jPanel23);
jPanel23.setLayout(jPanel23Layout);
jPanel23Layout.setHorizontalGroup(
jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel23Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel51, javax.swing.GroupLayout.DEFAULT_SIZE, 104, Short.MAX_VALUE)
.addComponent(jLabel50, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel52, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(jLabel64, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel23Layout.createSequentialGroup()
.addComponent(jLabel75, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(34, 34, 34)))
.addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel23Layout.createSequentialGroup()
.addGap(8, 8, 8)
.addComponent(dteAssignmentduedate, javax.swing.GroupLayout.PREFERRED_SIZE, 234, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(cmbAssignmentduetime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(cmbAssignmentmoduleid, javax.swing.GroupLayout.Alignment.TRAILING, 0, 297, Short.MAX_VALUE)
.addComponent(txtAssignmentdescription, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtAssignmentname, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtAssignmentid, javax.swing.GroupLayout.Alignment.TRAILING)))
.addContainerGap())
);
jPanel23Layout.setVerticalGroup(
jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel23Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel50)
.addComponent(txtAssignmentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel51)
.addComponent(txtAssignmentname, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel52)
.addComponent(txtAssignmentdescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cmbAssignmentmoduleid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel64))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel23Layout.createSequentialGroup()
.addComponent(jLabel75)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel23Layout.createSequentialGroup()
.addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(cmbAssignmentduetime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(dteAssignmentduedate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
);
btnUpdateassignment.setText("Update");
btnUpdateassignment.setEnabled(false);
btnUpdateassignment.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateassignmentActionPerformed(evt);
}
});
btnDeleteassignment.setText("Delete");
btnDeleteassignment.setEnabled(false);
btnDeleteassignment.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteassignmentActionPerformed(evt);
}
});
btnInsertassignment.setText("Insert");
btnInsertassignment.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertassignmentActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(btnUpdateassignment)
.addGap(18, 18, 18)
.addComponent(btnDeleteassignment)
.addGap(18, 18, 18)
.addComponent(btnInsertassignment))
.addComponent(jPanel23, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel23, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertassignment)
.addComponent(btnDeleteassignment)
.addComponent(btnUpdateassignment))
.addGap(0, 120, Short.MAX_VALUE))
);
jTabbedPane1.addTab("Assignments", jPanel2);
jPanel30.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Student Assignments"));
tblStAss.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblStAss.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblStAssMouseClicked(evt);
}
});
jScrollPane16.setViewportView(tblStAss);
txtSearchstass.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchstassKeyReleased(evt);
}
});
cmbStAsssearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "studentid", "assignmentid", "marks", "userid" }));
jLabel86.setText("Search In:");
javax.swing.GroupLayout jPanel30Layout = new javax.swing.GroupLayout(jPanel30);
jPanel30.setLayout(jPanel30Layout);
jPanel30Layout.setHorizontalGroup(
jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane16, javax.swing.GroupLayout.DEFAULT_SIZE, 952, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel30Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel86)
.addGap(18, 18, 18)
.addComponent(cmbStAsssearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchstass, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel30Layout.setVerticalGroup(
jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel30Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchstass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbStAsssearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel86))
.addGap(18, 18, 18)
.addComponent(jScrollPane16, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel33.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Student Assignment Record"));
jPanel33.setPreferredSize(new java.awt.Dimension(445, 116));
jLabel93.setText("Student ID:");
jLabel94.setText("Assignment ID: ");
jLabel95.setText("Marks:");
cmbStAssStudentid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
cmbStAssAssignmentid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
javax.swing.GroupLayout jPanel33Layout = new javax.swing.GroupLayout(jPanel33);
jPanel33.setLayout(jPanel33Layout);
jPanel33Layout.setHorizontalGroup(
jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel33Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel93, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel94, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
.addComponent(jLabel95, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtStAssMarks, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
.addComponent(cmbStAssStudentid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cmbStAssAssignmentid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel33Layout.setVerticalGroup(
jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel33Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel93)
.addComponent(cmbStAssStudentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel94)
.addComponent(cmbStAssAssignmentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(9, 9, 9)
.addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel95)
.addComponent(txtStAssMarks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdateStAss.setText("Update");
btnUpdateStAss.setEnabled(false);
btnUpdateStAss.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateStAssActionPerformed(evt);
}
});
btnDeleteStAss.setText("Delete");
btnDeleteStAss.setEnabled(false);
btnDeleteStAss.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteStAssActionPerformed(evt);
}
});
btnInsertStAss.setText("Insert");
btnInsertStAss.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertStAssActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel29Layout = new javax.swing.GroupLayout(jPanel29);
jPanel29.setLayout(jPanel29Layout);
jPanel29Layout.setHorizontalGroup(
jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel29Layout.createSequentialGroup()
.addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jPanel33, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel29Layout.createSequentialGroup()
.addComponent(btnUpdateStAss)
.addGap(18, 18, 18)
.addComponent(btnDeleteStAss)
.addGap(18, 18, 18)
.addComponent(btnInsertStAss)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel30, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel29Layout.setVerticalGroup(
jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel29Layout.createSequentialGroup()
.addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel30, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel29Layout.createSequentialGroup()
.addComponent(jPanel33, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertStAss)
.addComponent(btnDeleteStAss)
.addComponent(btnUpdateStAss))))
.addGap(0, 0, Short.MAX_VALUE))
);
jTabbedPane1.addTab("Student Assignments", jPanel29);
javax.swing.GroupLayout AssignmentsPanelLayout = new javax.swing.GroupLayout(AssignmentsPanel);
AssignmentsPanel.setLayout(AssignmentsPanelLayout);
AssignmentsPanelLayout.setHorizontalGroup(
AssignmentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane1)
);
AssignmentsPanelLayout.setVerticalGroup(
AssignmentsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane1)
);
TabbedPane.addTab("Assignments", new javax.swing.ImageIcon(getClass().getResource("/res/assignments.jpg")), AssignmentsPanel, "Manage Assignments Information"); // NOI18N
jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Lectures"));
tblLectures.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblLectures.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblLecturesMouseClicked(evt);
}
});
jScrollPane10.setViewportView(tblLectures);
txtSearchlecture.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchlectureKeyReleased(evt);
}
});
cmbLecturessearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "lectureid", "starttime", "endtime", "description", "classroomid", "moduleid", "userid" }));
jLabel35.setText("Search In:");
javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
jPanel10.setLayout(jPanel10Layout);
jPanel10Layout.setHorizontalGroup(
jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 1403, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel35)
.addGap(18, 18, 18)
.addComponent(cmbLecturessearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchlecture, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel10Layout.setVerticalGroup(
jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchlecture, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbLecturessearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel35))
.addGap(18, 18, 18)
.addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel24.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Lecture Record"));
jPanel24.setPreferredSize(new java.awt.Dimension(445, 234));
jLabel53.setText("Lecture ID:");
jLabel54.setText("Start Time: ");
jLabel55.setText("End Time:");
txtLectureid.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtLectureidKeyPressed(evt);
}
});
jLabel65.setText("Description:");
jLabel66.setText("Classroom ID: ");
jLabel67.setText("Module ID:");
cmbLecturestarttime.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00" }));
dteLecturestartdate.setDateFormatString("yyyy-MM-dd");
cmbLectureendtime.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00" }));
dteLectureenddate.setDateFormatString("yyyy-MM-dd");
javax.swing.GroupLayout jPanel24Layout = new javax.swing.GroupLayout(jPanel24);
jPanel24.setLayout(jPanel24Layout);
jPanel24Layout.setHorizontalGroup(
jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel24Layout.createSequentialGroup()
.addGap(55, 55, Short.MAX_VALUE)
.addComponent(jLabel67, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(cmbLecturemoduleid, javax.swing.GroupLayout.PREFERRED_SIZE, 278, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(30, 30, 30))
.addGroup(jPanel24Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel24Layout.createSequentialGroup()
.addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel53, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel54, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel55, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel24Layout.createSequentialGroup()
.addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(dteLectureenddate, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(dteLecturestartdate, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(cmbLecturestarttime, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cmbLectureendtime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(txtLectureid, javax.swing.GroupLayout.PREFERRED_SIZE, 298, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel24Layout.createSequentialGroup()
.addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel66, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel65, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtLecturedescription)
.addComponent(txtLectureclassroomid, javax.swing.GroupLayout.PREFERRED_SIZE, 298, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap())
);
jPanel24Layout.setVerticalGroup(
jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel24Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel53)
.addComponent(txtLectureid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(dteLecturestartdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel54)
.addComponent(cmbLecturestarttime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel55)
.addComponent(dteLectureenddate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbLectureendtime, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel65)
.addComponent(txtLecturedescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtLectureclassroomid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel66))
.addGap(83, 83, 83)
.addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel67)
.addComponent(cmbLecturemoduleid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdatelecture.setText("Update");
btnUpdatelecture.setEnabled(false);
btnUpdatelecture.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdatelectureActionPerformed(evt);
}
});
btnDeletelecture.setText("Delete");
btnDeletelecture.setEnabled(false);
btnDeletelecture.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeletelectureActionPerformed(evt);
}
});
btnInsertlecture.setText("Insert");
btnInsertlecture.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertlectureActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel40Layout = new javax.swing.GroupLayout(jPanel40);
jPanel40.setLayout(jPanel40Layout);
jPanel40Layout.setHorizontalGroup(
jPanel40Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel40Layout.createSequentialGroup()
.addGroup(jPanel40Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel40Layout.createSequentialGroup()
.addComponent(btnUpdatelecture)
.addGap(18, 18, 18)
.addComponent(btnDeletelecture)
.addGap(18, 18, 18)
.addComponent(btnInsertlecture))
.addComponent(jPanel24, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(970, Short.MAX_VALUE))
);
jPanel40Layout.setVerticalGroup(
jPanel40Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel40Layout.createSequentialGroup()
.addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel24, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel40Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertlecture)
.addComponent(btnDeletelecture)
.addComponent(btnUpdatelecture))
.addGap(0, 120, Short.MAX_VALUE))
);
jTabbedPane4.addTab("Lectures", jPanel40);
jPanel42.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Student Attendance Record"));
jPanel42.setPreferredSize(new java.awt.Dimension(445, 116));
jLabel101.setText("Student ID:");
jLabel102.setText("Lecture ID: ");
jLabel103.setText("Time:");
cmbStAttendanceStudentid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
cmbStAttendanceLectureid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
cmbStAttendancetime.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00" }));
dteStAttendancedate.setDateFormatString("yyyy-MM-dd");
javax.swing.GroupLayout jPanel42Layout = new javax.swing.GroupLayout(jPanel42);
jPanel42.setLayout(jPanel42Layout);
jPanel42Layout.setHorizontalGroup(
jPanel42Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel42Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel42Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel101, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel102, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
.addComponent(jLabel103, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel42Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel42Layout.createSequentialGroup()
.addGroup(jPanel42Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(cmbStAttendanceStudentid, 0, 289, Short.MAX_VALUE)
.addComponent(cmbStAttendanceLectureid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel42Layout.createSequentialGroup()
.addComponent(dteStAttendancedate, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(cmbStAttendancetime, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
jPanel42Layout.setVerticalGroup(
jPanel42Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel42Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel42Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel101)
.addComponent(cmbStAttendanceStudentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel42Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel102)
.addComponent(cmbStAttendanceLectureid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(6, 6, 6)
.addGroup(jPanel42Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel42Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel103)
.addComponent(cmbStAttendancetime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(dteStAttendancedate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdateStAttendance.setText("Update");
btnUpdateStAttendance.setEnabled(false);
btnUpdateStAttendance.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateStAttendanceActionPerformed(evt);
}
});
btnDeleteStAttendance.setText("Delete");
btnDeleteStAttendance.setEnabled(false);
btnDeleteStAttendance.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteStAttendanceActionPerformed(evt);
}
});
btnInsertStAttendance.setText("Insert");
btnInsertStAttendance.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertStAttendanceActionPerformed(evt);
}
});
jPanel43.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Student Attendance"));
tblStAttendance.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblStAttendance.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblStAttendanceMouseClicked(evt);
}
});
jScrollPane19.setViewportView(tblStAttendance);
txtSearchstattendance.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchstattendanceKeyReleased(evt);
}
});
cmbStAttendancesearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "studentid", "lectureid", "time", "userid" }));
jLabel89.setText("Search In:");
javax.swing.GroupLayout jPanel43Layout = new javax.swing.GroupLayout(jPanel43);
jPanel43.setLayout(jPanel43Layout);
jPanel43Layout.setHorizontalGroup(
jPanel43Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane19, javax.swing.GroupLayout.DEFAULT_SIZE, 951, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel43Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel89)
.addGap(18, 18, 18)
.addComponent(cmbStAttendancesearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchstattendance, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel43Layout.setVerticalGroup(
jPanel43Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel43Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel43Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchstattendance, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbStAttendancesearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel89))
.addGap(18, 18, 18)
.addComponent(jScrollPane19, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
javax.swing.GroupLayout jPanel41Layout = new javax.swing.GroupLayout(jPanel41);
jPanel41.setLayout(jPanel41Layout);
jPanel41Layout.setHorizontalGroup(
jPanel41Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel41Layout.createSequentialGroup()
.addGroup(jPanel41Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jPanel42, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel41Layout.createSequentialGroup()
.addComponent(btnUpdateStAttendance)
.addGap(18, 18, 18)
.addComponent(btnDeleteStAttendance)
.addGap(18, 18, 18)
.addComponent(btnInsertStAttendance)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel43, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel41Layout.setVerticalGroup(
jPanel41Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel41Layout.createSequentialGroup()
.addGroup(jPanel41Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel43, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel41Layout.createSequentialGroup()
.addComponent(jPanel42, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel41Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertStAttendance)
.addComponent(btnDeleteStAttendance)
.addComponent(btnUpdateStAttendance))))
.addGap(0, 335, Short.MAX_VALUE))
);
jTabbedPane4.addTab("Student Attendance", jPanel41);
javax.swing.GroupLayout LecturesPanelLayout = new javax.swing.GroupLayout(LecturesPanel);
LecturesPanel.setLayout(LecturesPanelLayout);
LecturesPanelLayout.setHorizontalGroup(
LecturesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane4)
);
LecturesPanelLayout.setVerticalGroup(
LecturesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane4)
);
TabbedPane.addTab("Lectures", new javax.swing.ImageIcon(getClass().getResource("/res/lectures.png")), LecturesPanel, "Manage Lectures Information"); // NOI18N
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Lecturers"));
tblLecturers.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblLecturers.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblLecturersMouseClicked(evt);
}
});
jScrollPane4.setViewportView(tblLecturers);
txtSearchlecturer.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchlecturerKeyReleased(evt);
}
});
cmbLecturersearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "lecturerid", "lecturer_name", "address", "email", "phone", "description", "userid" }));
jLabel23.setText("Search In:");
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 1408, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel23)
.addGap(18, 18, 18)
.addComponent(cmbLecturersearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchlecturer, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchlecturer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbLecturersearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel23))
.addGap(18, 18, 18)
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel18.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Lecturer Record"));
jPanel18.setPreferredSize(new java.awt.Dimension(445, 229));
jLabel24.setText("Lecturer ID:");
txtLecturerid.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtLectureridKeyPressed(evt);
}
});
jLabel25.setText("Name:");
jLabel26.setText("Address:");
jLabel27.setText("Email:");
jLabel28.setText("Phone:");
jLabel29.setText("Description:");
javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
jPanel18.setLayout(jPanel18Layout);
jPanel18Layout.setHorizontalGroup(
jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel18Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel24, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel29, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel25, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel26, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel27, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(44, 44, 44)
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtLecturerphone, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtLectureremail, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtLectureraddress, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtLecturername, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtLecturerdescription)
.addComponent(txtLecturerid, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
jPanel18Layout.setVerticalGroup(
jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel18Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel24)
.addComponent(txtLecturerid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel25)
.addComponent(txtLecturername, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel26)
.addComponent(txtLectureraddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtLectureremail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel27))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel28)
.addComponent(txtLecturerphone, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel29)
.addComponent(txtLecturerdescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdatelecturer.setText("Update");
btnUpdatelecturer.setEnabled(false);
btnUpdatelecturer.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdatelecturerActionPerformed(evt);
}
});
btnDeletelecturer.setText("Delete");
btnDeletelecturer.setEnabled(false);
btnDeletelecturer.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeletelecturerActionPerformed(evt);
}
});
btnInsertlecturer.setText("Insert");
btnInsertlecturer.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertlecturerActionPerformed(evt);
}
});
javax.swing.GroupLayout LecturersPanelLayout = new javax.swing.GroupLayout(LecturersPanel);
LecturersPanel.setLayout(LecturersPanelLayout);
LecturersPanelLayout.setHorizontalGroup(
LecturersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(LecturersPanelLayout.createSequentialGroup()
.addGroup(LecturersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(LecturersPanelLayout.createSequentialGroup()
.addComponent(btnUpdatelecturer)
.addGap(18, 18, 18)
.addComponent(btnDeletelecturer)
.addGap(18, 18, 18)
.addComponent(btnInsertlecturer))
.addComponent(jPanel18, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 975, Short.MAX_VALUE))
);
LecturersPanelLayout.setVerticalGroup(
LecturersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(LecturersPanelLayout.createSequentialGroup()
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(LecturersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertlecturer)
.addComponent(btnDeletelecturer)
.addComponent(btnUpdatelecturer))
.addGap(0, 132, Short.MAX_VALUE))
);
TabbedPane.addTab("Lecturers", new javax.swing.ImageIcon(getClass().getResource("/res/lecuturer.jpg")), LecturersPanel, "Manage Lecturers Information"); // NOI18N
jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Classrooms"));
tblClassrooms.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblClassrooms.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblClassroomsMouseClicked(evt);
}
});
jScrollPane13.setViewportView(tblClassrooms);
txtSearchclassroom.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchclassroomKeyReleased(evt);
}
});
cmbClassroomsearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "classroomid", "room_name", "description", "userid" }));
jLabel70.setText("Search In:");
javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
jPanel13.setLayout(jPanel13Layout);
jPanel13Layout.setHorizontalGroup(
jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane13, javax.swing.GroupLayout.DEFAULT_SIZE, 1408, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel70)
.addGap(18, 18, 18)
.addComponent(cmbClassroomsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchclassroom, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel13Layout.setVerticalGroup(
jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchclassroom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbClassroomsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel70))
.addGap(18, 18, 18)
.addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel26.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Classroom Record"));
jPanel26.setPreferredSize(new java.awt.Dimension(445, 126));
jLabel71.setText("Classroom ID:");
jLabel72.setText("Classroom Name: ");
jLabel73.setText("Description:");
txtClassroomid.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtClassroomidKeyPressed(evt);
}
});
javax.swing.GroupLayout jPanel26Layout = new javax.swing.GroupLayout(jPanel26);
jPanel26.setLayout(jPanel26Layout);
jPanel26Layout.setHorizontalGroup(
jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel26Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel71, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel72, javax.swing.GroupLayout.DEFAULT_SIZE, 98, Short.MAX_VALUE)
.addComponent(jLabel73, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, Short.MAX_VALUE)
.addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(txtClassroomid, javax.swing.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE)
.addComponent(txtClassroomname)
.addComponent(txtClassroomdescription))
.addContainerGap())
);
jPanel26Layout.setVerticalGroup(
jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel26Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel71)
.addComponent(txtClassroomid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel72)
.addComponent(txtClassroomname, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel73)
.addComponent(txtClassroomdescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnInsertClassroom.setText("Insert");
btnInsertClassroom.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertClassroomActionPerformed(evt);
}
});
btnDeleteClassroom.setText("Delete");
btnDeleteClassroom.setEnabled(false);
btnDeleteClassroom.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteClassroomActionPerformed(evt);
}
});
btnUpdateClassroom.setText("Update");
btnUpdateClassroom.setEnabled(false);
btnUpdateClassroom.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateClassroomActionPerformed(evt);
}
});
javax.swing.GroupLayout ClassroomsPanelLayout = new javax.swing.GroupLayout(ClassroomsPanel);
ClassroomsPanel.setLayout(ClassroomsPanelLayout);
ClassroomsPanelLayout.setHorizontalGroup(
ClassroomsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(ClassroomsPanelLayout.createSequentialGroup()
.addGroup(ClassroomsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(ClassroomsPanelLayout.createSequentialGroup()
.addComponent(btnUpdateClassroom)
.addGap(18, 18, 18)
.addComponent(btnDeleteClassroom)
.addGap(18, 18, 18)
.addComponent(btnInsertClassroom))
.addComponent(jPanel26, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE))
);
ClassroomsPanelLayout.setVerticalGroup(
ClassroomsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ClassroomsPanelLayout.createSequentialGroup()
.addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel26, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(ClassroomsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertClassroom)
.addComponent(btnDeleteClassroom)
.addComponent(btnUpdateClassroom))
.addGap(0, 210, Short.MAX_VALUE))
);
TabbedPane.addTab("Classrooms", new javax.swing.ImageIcon(getClass().getResource("/res/classrooms.png")), ClassroomsPanel, "Manage Classrooms Information"); // NOI18N
jPanel27.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Batches"));
tblBatches.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblBatches.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblBatchesMouseClicked(evt);
}
});
jScrollPane14.setViewportView(tblBatches);
txtSearchbatch.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchbatchKeyReleased(evt);
}
});
cmbBatchsearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "batchid", "batch_name", "startdate", "userid" }));
jLabel77.setText("Search In:");
javax.swing.GroupLayout jPanel27Layout = new javax.swing.GroupLayout(jPanel27);
jPanel27.setLayout(jPanel27Layout);
jPanel27Layout.setHorizontalGroup(
jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane14, javax.swing.GroupLayout.DEFAULT_SIZE, 1408, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel27Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel77)
.addGap(18, 18, 18)
.addComponent(cmbBatchsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchbatch, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel27Layout.setVerticalGroup(
jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel27Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchbatch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbBatchsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel77))
.addGap(18, 18, 18)
.addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel28.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Batch Record"));
jPanel28.setPreferredSize(new java.awt.Dimension(445, 126));
jLabel78.setText("Batch ID:");
jLabel79.setText("Batch Name: ");
txtBatchid.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtBatchidKeyPressed(evt);
}
});
dteBatchstartdate.setDateFormatString("yyyy-MM-dd");
jLabel80.setText("Start Date:");
javax.swing.GroupLayout jPanel28Layout = new javax.swing.GroupLayout(jPanel28);
jPanel28.setLayout(jPanel28Layout);
jPanel28Layout.setHorizontalGroup(
jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel28Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel78, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel79, javax.swing.GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE)
.addComponent(jLabel80, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(37, 37, 37)
.addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(dteBatchstartdate, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtBatchname, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
.addComponent(txtBatchid, javax.swing.GroupLayout.Alignment.TRAILING)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel28Layout.setVerticalGroup(
jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel28Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel78)
.addComponent(txtBatchid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel79)
.addComponent(txtBatchname, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(dteBatchstartdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel80))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdateBatch.setText("Update");
btnUpdateBatch.setEnabled(false);
btnUpdateBatch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateBatchActionPerformed(evt);
}
});
btnDeleteBatch.setText("Delete");
btnDeleteBatch.setEnabled(false);
btnDeleteBatch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteBatchActionPerformed(evt);
}
});
btnInsertBatch.setText("Insert");
btnInsertBatch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertBatchActionPerformed(evt);
}
});
javax.swing.GroupLayout BatchesPanelLayout = new javax.swing.GroupLayout(BatchesPanel);
BatchesPanel.setLayout(BatchesPanelLayout);
BatchesPanelLayout.setHorizontalGroup(
BatchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel27, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(BatchesPanelLayout.createSequentialGroup()
.addGroup(BatchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(BatchesPanelLayout.createSequentialGroup()
.addComponent(btnUpdateBatch)
.addGap(18, 18, 18)
.addComponent(btnDeleteBatch)
.addGap(18, 18, 18)
.addComponent(btnInsertBatch))
.addComponent(jPanel28, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE))
);
BatchesPanelLayout.setVerticalGroup(
BatchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(BatchesPanelLayout.createSequentialGroup()
.addComponent(jPanel27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel28, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(BatchesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertBatch)
.addComponent(btnDeleteBatch)
.addComponent(btnUpdateBatch))
.addGap(0, 210, Short.MAX_VALUE))
);
TabbedPane.addTab("Batches", new javax.swing.ImageIcon(getClass().getResource("/res/batches.png")), BatchesPanel, "Manage Batches Information"); // NOI18N
jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Users"));
tblUsers.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
tblUsers.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tblUsersMouseClicked(evt);
}
});
jScrollPane11.setViewportView(tblUsers);
txtSearchuser.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchuserKeyReleased(evt);
}
});
cmbUsersearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "userid", "user_name", "email", "password", "type", "status" }));
jLabel36.setText("Search In:");
javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
jPanel11.setLayout(jPanel11Layout);
jPanel11Layout.setHorizontalGroup(
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane11, javax.swing.GroupLayout.DEFAULT_SIZE, 1408, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel36)
.addGap(18, 18, 18)
.addComponent(cmbUsersearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchuser, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel11Layout.setVerticalGroup(
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchuser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbUsersearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel36))
.addGap(18, 18, 18)
.addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel25.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "User Record"));
jPanel25.setPreferredSize(new java.awt.Dimension(445, 225));
jLabel56.setText("User ID:");
jLabel57.setText("User Name: ");
jLabel58.setText("Email:");
txtUserid.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtUseridKeyPressed(evt);
}
});
jLabel68.setText("Type:");
jLabel69.setText("Status:");
jLabel74.setText("Password:");
cmbUsertype.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "admin", "coordinator", "receptionist" }));
cmbUserstatus.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "active", "deactive" }));
javax.swing.GroupLayout jPanel25Layout = new javax.swing.GroupLayout(jPanel25);
jPanel25.setLayout(jPanel25Layout);
jPanel25Layout.setHorizontalGroup(
jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel25Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel25Layout.createSequentialGroup()
.addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel56, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel57, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE)
.addComponent(jLabel58, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(jLabel74, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel25Layout.createSequentialGroup()
.addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel68, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel69, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE))
.addGap(42, 42, 42)))
.addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(cmbUserstatus, 0, 300, Short.MAX_VALUE)
.addComponent(cmbUsertype, 0, 300, Short.MAX_VALUE)
.addComponent(txtUserpassword)
.addComponent(txtUsername, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtUserid, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtUseremail))
.addContainerGap())
);
jPanel25Layout.setVerticalGroup(
jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel25Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel56)
.addComponent(txtUserid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel57)
.addComponent(txtUsername, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel58)
.addComponent(txtUseremail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtUserpassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel74))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel68)
.addComponent(cmbUsertype, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel69)
.addComponent(cmbUserstatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
btnUpdateuser.setText("Update");
btnUpdateuser.setEnabled(false);
btnUpdateuser.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateuserActionPerformed(evt);
}
});
btnDeleteuser.setText("Delete");
btnDeleteuser.setEnabled(false);
btnDeleteuser.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteuserActionPerformed(evt);
}
});
btnInsertuser.setText("Insert");
btnInsertuser.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnInsertuserActionPerformed(evt);
}
});
javax.swing.GroupLayout UsersPanelLayout = new javax.swing.GroupLayout(UsersPanel);
UsersPanel.setLayout(UsersPanelLayout);
UsersPanelLayout.setHorizontalGroup(
UsersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(UsersPanelLayout.createSequentialGroup()
.addGroup(UsersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(UsersPanelLayout.createSequentialGroup()
.addComponent(btnUpdateuser)
.addGap(18, 18, 18)
.addComponent(btnDeleteuser)
.addGap(18, 18, 18)
.addComponent(btnInsertuser))
.addComponent(jPanel25, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 975, Short.MAX_VALUE))
);
UsersPanelLayout.setVerticalGroup(
UsersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(UsersPanelLayout.createSequentialGroup()
.addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel25, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(UsersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnInsertuser)
.addComponent(btnDeleteuser)
.addComponent(btnUpdateuser))
.addGap(0, 132, Short.MAX_VALUE))
);
TabbedPane.addTab("Users", new javax.swing.ImageIcon(getClass().getResource("/res/users.png")), UsersPanel, "Manage Users Information"); // NOI18N
jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Logs"));
tblLogs.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jScrollPane12.setViewportView(tblLogs);
txtSearchlog.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtSearchlogKeyReleased(evt);
}
});
cmbLogsearchin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "logid", "entity", "action", "userid" }));
jLabel37.setText("Search In:");
javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
jPanel12.setLayout(jPanel12Layout);
jPanel12Layout.setHorizontalGroup(
jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 1408, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel37)
.addGap(18, 18, 18)
.addComponent(cmbLogsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txtSearchlog, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel12Layout.setVerticalGroup(
jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
.addGap(0, 11, Short.MAX_VALUE)
.addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSearchlog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbLogsearchin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel37))
.addGap(18, 18, 18)
.addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
);
btnRefreshlog.setText("Refresh");
btnRefreshlog.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnRefreshlogActionPerformed(evt);
}
});
btnClearLog.setText("Clear Log");
btnClearLog.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnClearLogActionPerformed(evt);
}
});
javax.swing.GroupLayout LogsPanelLayout = new javax.swing.GroupLayout(LogsPanel);
LogsPanel.setLayout(LogsPanelLayout);
LogsPanelLayout.setHorizontalGroup(
LogsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, LogsPanelLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnClearLog)
.addGap(18, 18, 18)
.addComponent(btnRefreshlog)
.addContainerGap())
);
LogsPanelLayout.setVerticalGroup(
LogsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(LogsPanelLayout.createSequentialGroup()
.addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(LogsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnRefreshlog)
.addComponent(btnClearLog))
.addGap(0, 332, Short.MAX_VALUE))
);
TabbedPane.addTab("Logs", new javax.swing.ImageIcon(getClass().getResource("/res/logs.png")), LogsPanel, "Manage Logs Information"); // NOI18N
jPanel48.setBorder(javax.swing.BorderFactory.createTitledBorder("Students Reports"));
btnAllStudentsReport.setText("All Students Report");
btnAllStudentsReport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAllStudentsReportActionPerformed(evt);
}
});
btnStudentAssignmentsReport.setText("All Student Assignments Report");
btnStudentAssignmentsReport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnStudentAssignmentsReportActionPerformed(evt);
}
});
btnStudentExamsReport.setText("All Student Exams Report");
btnStudentExamsReport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnStudentExamsReportActionPerformed(evt);
}
});
btnStudentAssignmentReport2.setText("Student Assignments Report");
btnStudentAssignmentReport2.setActionCommand("Studnet Assignments Report");
btnStudentAssignmentReport2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnStudentAssignmentReport2ActionPerformed(evt);
}
});
jLabel91.setText("Student ID:");
jLabel91.setToolTipText("");
btnStudentExamsReport2.setText("Student Exams Report");
btnStudentExamsReport2.setActionCommand("Studnet Exams Report");
btnStudentExamsReport2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnStudentExamsReport2ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel48Layout = new javax.swing.GroupLayout(jPanel48);
jPanel48.setLayout(jPanel48Layout);
jPanel48Layout.setHorizontalGroup(
jPanel48Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel48Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel48Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(btnStudentExamsReport, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnStudentAssignmentsReport, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnAllStudentsReport, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel48Layout.createSequentialGroup()
.addComponent(jLabel91)
.addGap(18, 18, 18)
.addComponent(txtAssignmentReportStudentid))
.addComponent(btnStudentAssignmentReport2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnStudentExamsReport2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel48Layout.setVerticalGroup(
jPanel48Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel48Layout.createSequentialGroup()
.addContainerGap()
.addComponent(btnAllStudentsReport)
.addGap(18, 18, 18)
.addComponent(btnStudentAssignmentsReport)
.addGap(18, 18, 18)
.addComponent(btnStudentExamsReport)
.addGap(18, 18, 18)
.addGroup(jPanel48Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtAssignmentReportStudentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel91))
.addGap(18, 18, 18)
.addComponent(btnStudentAssignmentReport2)
.addGap(18, 18, 18)
.addComponent(btnStudentExamsReport2)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel51.setBorder(javax.swing.BorderFactory.createTitledBorder("Payments Reports"));
btnStudentPaymentsReport.setText("Student Payments Report");
btnStudentPaymentsReport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnStudentPaymentsReportActionPerformed(evt);
}
});
jLabel92.setText("Student ID:");
jLabel92.setToolTipText("");
btnAllPaymentsReport1.setText("All Payments Report");
btnAllPaymentsReport1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAllPaymentsReport1ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel51Layout = new javax.swing.GroupLayout(jPanel51);
jPanel51.setLayout(jPanel51Layout);
jPanel51Layout.setHorizontalGroup(
jPanel51Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel51Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel51Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(btnAllPaymentsReport1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel51Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(btnStudentPaymentsReport, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel51Layout.createSequentialGroup()
.addComponent(jLabel92)
.addGap(18, 18, 18)
.addComponent(txtPaymentReportStudentid, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel51Layout.setVerticalGroup(
jPanel51Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel51Layout.createSequentialGroup()
.addContainerGap()
.addComponent(btnAllPaymentsReport1)
.addGap(18, 18, 18)
.addGroup(jPanel51Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtPaymentReportStudentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel92))
.addGap(18, 18, 18)
.addComponent(btnStudentPaymentsReport)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel53.setBorder(javax.swing.BorderFactory.createTitledBorder("Courses Reports"));
btnStudentBatchReport.setText("Batch Students Report");
btnStudentBatchReport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnStudentBatchReportActionPerformed(evt);
}
});
jLabel115.setText("Batch ID:");
jLabel115.setToolTipText("");
btnAllCoursesReport.setText("All Courses Report");
btnAllCoursesReport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAllCoursesReportActionPerformed(evt);
}
});
btnAllBatchesReport.setText("All Batches Report");
btnAllBatchesReport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAllBatchesReportActionPerformed(evt);
}
});
jLabel116.setText("Course ID:");
jLabel116.setToolTipText("");
btnCourseStudentsReport.setText("Course Students Report");
btnCourseStudentsReport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCourseStudentsReportActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel53Layout = new javax.swing.GroupLayout(jPanel53);
jPanel53.setLayout(jPanel53Layout);
jPanel53Layout.setHorizontalGroup(
jPanel53Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel53Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel53Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnCourseStudentsReport, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel53Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel53Layout.createSequentialGroup()
.addComponent(jLabel116)
.addGap(18, 18, 18)
.addComponent(txtCourseStudentReportCourseid))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel53Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnAllBatchesReport, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel53Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(btnAllCoursesReport, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel53Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(btnStudentBatchReport, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel53Layout.createSequentialGroup()
.addComponent(jLabel115)
.addGap(18, 18, 18)
.addComponent(txtBatchReportStudentid, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)))))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel53Layout.setVerticalGroup(
jPanel53Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel53Layout.createSequentialGroup()
.addContainerGap()
.addComponent(btnAllCoursesReport)
.addGap(18, 18, 18)
.addComponent(btnAllBatchesReport)
.addGap(18, 18, 18)
.addGroup(jPanel53Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtBatchReportStudentid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel115))
.addGap(18, 18, 18)
.addComponent(btnStudentBatchReport)
.addGap(18, 18, 18)
.addGroup(jPanel53Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtCourseStudentReportCourseid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel116))
.addGap(18, 18, 18)
.addComponent(btnCourseStudentsReport)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout ReportsPanelLayout = new javax.swing.GroupLayout(ReportsPanel);
ReportsPanel.setLayout(ReportsPanelLayout);
ReportsPanelLayout.setHorizontalGroup(
ReportsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ReportsPanelLayout.createSequentialGroup()
.addComponent(jPanel48, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPanel53, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPanel51, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 753, Short.MAX_VALUE))
);
ReportsPanelLayout.setVerticalGroup(
ReportsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ReportsPanelLayout.createSequentialGroup()
.addGroup(ReportsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ReportsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jPanel53, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel48, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(jPanel51, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(421, Short.MAX_VALUE))
);
TabbedPane.addTab("Reports", new javax.swing.ImageIcon(getClass().getResource("/res/reports.png")), ReportsPanel, "View Reports"); // NOI18N
jPanel49.setBorder(javax.swing.BorderFactory.createTitledBorder("Send Email Notification"));
txtSenderEmail.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
txtSubject.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
txtMessage.setColumns(20);
txtMessage.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
txtMessage.setRows(5);
jScrollPane2.setViewportView(txtMessage);
txtSenderEmailPassword.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
btnSendMail.setText("Send");
btnSendMail.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSendMailActionPerformed(evt);
}
});
jLabel107.setText("Email Address:");
jLabel108.setText("Password:");
jLabel109.setText("Subject:");
jLabel110.setText("Message:");
jLabel111.setText("Send To:");
jTextField1.setText("All Students");
javax.swing.GroupLayout jPanel49Layout = new javax.swing.GroupLayout(jPanel49);
jPanel49.setLayout(jPanel49Layout);
jPanel49Layout.setHorizontalGroup(
jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel49Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel49Layout.createSequentialGroup()
.addComponent(jLabel107)
.addGap(24, 24, 24)
.addComponent(txtSenderEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel49Layout.createSequentialGroup()
.addComponent(jLabel111, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(44, 44, 44)
.addGroup(jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnSendMail, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField1)))
.addGroup(jPanel49Layout.createSequentialGroup()
.addGroup(jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel49Layout.createSequentialGroup()
.addComponent(jLabel108, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(37, 37, 37))
.addGroup(jPanel49Layout.createSequentialGroup()
.addComponent(jLabel109)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel49Layout.createSequentialGroup()
.addComponent(jLabel110, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(24, 24, 24)))
.addGroup(jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtSenderEmailPassword)
.addComponent(txtSubject)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(25, 25, 25))
);
jPanel49Layout.setVerticalGroup(
jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel49Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSenderEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel107))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSenderEmailPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel108))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSubject, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel109))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel49Layout.createSequentialGroup()
.addGap(39, 39, 39)
.addComponent(jLabel110)))
.addGap(13, 13, 13)
.addGroup(jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel111)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(btnSendMail)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel50.setBorder(javax.swing.BorderFactory.createTitledBorder("Database Backup"));
btnBackup.setText("Backup Database");
btnBackup.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnBackupActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel50Layout = new javax.swing.GroupLayout(jPanel50);
jPanel50.setLayout(jPanel50Layout);
jPanel50Layout.setHorizontalGroup(
jPanel50Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel50Layout.createSequentialGroup()
.addContainerGap()
.addComponent(btnBackup)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel50Layout.setVerticalGroup(
jPanel50Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel50Layout.createSequentialGroup()
.addContainerGap()
.addComponent(btnBackup)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel52.setBorder(javax.swing.BorderFactory.createTitledBorder("Database Restore"));
btnRestore.setText("Restore Database");
btnRestore.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnRestoreActionPerformed(evt);
}
});
jLabel5.setText("SQL Dump File:");
javax.swing.GroupLayout jPanel52Layout = new javax.swing.GroupLayout(jPanel52);
jPanel52.setLayout(jPanel52Layout);
jPanel52Layout.setHorizontalGroup(
jPanel52Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel52Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel5)
.addGap(18, 18, 18)
.addComponent(txtSqlDump, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(btnRestore)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel52Layout.setVerticalGroup(
jPanel52Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel52Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel52Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnRestore)
.addComponent(jLabel5)
.addComponent(txtSqlDump, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout ToolsPanelLayout = new javax.swing.GroupLayout(ToolsPanel);
ToolsPanel.setLayout(ToolsPanelLayout);
ToolsPanelLayout.setHorizontalGroup(
ToolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ToolsPanelLayout.createSequentialGroup()
.addComponent(jPanel49, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(ToolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jPanel52, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel50, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(0, 565, Short.MAX_VALUE))
);
ToolsPanelLayout.setVerticalGroup(
ToolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ToolsPanelLayout.createSequentialGroup()
.addGroup(ToolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel49, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(ToolsPanelLayout.createSequentialGroup()
.addComponent(jPanel50, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jPanel52, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 379, Short.MAX_VALUE))
);
jPanel50.getAccessibleContext().setAccessibleName("Backup Database");
jPanel52.getAccessibleContext().setAccessibleName("Restore Database");
TabbedPane.addTab("Tools", new javax.swing.ImageIcon(getClass().getResource("/res/tools.png")), ToolsPanel, "Tools and Options"); // NOI18N
jLabel82.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel82.setText("Europa Developers (Pvt) Ltd.");
jLabel83.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel83.setText("Rasan Samarasinghe");
jLabel84.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel84.setText("Ubaidulla Mueen");
jLabel85.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel85.setText("Kushan Ranasinghe");
jLabel112.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel112.setText("Sayona Perera");
jLabel113.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel113.setText("Kavindya Baddegama");
jLabel114.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel114.setText("Binara Navaratne");
jLabel117.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/europalogo.jpg"))); // NOI18N
javax.swing.GroupLayout AboutPanelLayout = new javax.swing.GroupLayout(AboutPanel);
AboutPanel.setLayout(AboutPanelLayout);
AboutPanelLayout.setHorizontalGroup(
AboutPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(AboutPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(AboutPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel85)
.addComponent(jLabel84)
.addComponent(jLabel83)
.addComponent(jLabel82)
.addComponent(jLabel114)
.addComponent(jLabel113)
.addComponent(jLabel112)
.addComponent(jLabel117))
.addContainerGap(1044, Short.MAX_VALUE))
);
AboutPanelLayout.setVerticalGroup(
AboutPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(AboutPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel117)
.addGap(18, 18, 18)
.addComponent(jLabel82)
.addGap(18, 18, 18)
.addComponent(jLabel83)
.addGap(18, 18, 18)
.addComponent(jLabel84)
.addGap(18, 18, 18)
.addComponent(jLabel85)
.addGap(18, 18, 18)
.addComponent(jLabel112)
.addGap(18, 18, 18)
.addComponent(jLabel113)
.addGap(18, 18, 18)
.addComponent(jLabel114)
.addContainerGap(329, Short.MAX_VALUE))
);
TabbedPane.addTab("About", new javax.swing.ImageIcon(getClass().getResource("/res/europaicon.png")), AboutPanel); // NOI18N
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(TabbedPane)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(TabbedPane, javax.swing.GroupLayout.PREFERRED_SIZE, 696, javax.swing.GroupLayout.PREFERRED_SIZE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void txtDepartmentidKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtDepartmentidKeyPressed
// TODO add your handling code here:
if(evt.getKeyChar()=='\n'){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("select * from tbldepartment where departmentid=?");
pstmt.setInt(1, Integer.parseInt(txtDepartmentid.getText()));
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
txtDepartmentname.setText(rs.getString("department_name"));
txtDepartmentdescription.setText(rs.getString("description"));
stateUpdateDepartment();
}else{
JOptionPane.showMessageDialog(rootPane, "Record not found!");
}
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in txtDepartmentidKeyPressed: " + ex.getMessage());
}
}
}//GEN-LAST:event_txtDepartmentidKeyPressed
private void btnInsertDepartmentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertDepartmentActionPerformed
// TODO add your handling code here:
if(btnInsertDepartment.getText() == "Insert"){
if(Validator.validateDepartment(null, txtDepartmentid, txtDepartmentname, txtDepartmentdescription)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tbldepartment values(?, ?, ?, ?)");
pstmt.setInt(1, Integer.parseInt(txtDepartmentid.getText()));
pstmt.setString(2, txtDepartmentname.getText());
pstmt.setString(3, txtDepartmentdescription.getText());
pstmt.setInt(4, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearDepartmentForm();
showDepartments(null, null);
Log.insert("Department", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertActionPerformed: " + ex.getMessage());
}
}
}else{
clearDepartmentForm();
stateInsertDepartment();
}
}//GEN-LAST:event_btnInsertDepartmentActionPerformed
private void btnUpdateDepartmentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateDepartmentActionPerformed
// TODO add your handling code here:
if(Validator.validateDepartment(null, txtDepartmentid, txtDepartmentname, txtDepartmentdescription)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tbldepartment set department_name=?, description=? where departmentid=?");
pstmt.setString(1, txtDepartmentname.getText());
pstmt.setString(2, txtDepartmentdescription.getText());
pstmt.setInt(3, Integer.parseInt(txtDepartmentid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showDepartments(null, null);
con.close();
Log.insert("Department", "Updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdateActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdateDepartmentActionPerformed
private void btnDeleteDepartmentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteDepartmentActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tbldepartment where departmentid=?");
pstmt.setInt(1, Integer.parseInt(txtDepartmentid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearDepartmentForm();
showDepartments(null, null);
con.close();
stateInsertDepartment();
Log.insert("Department", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeleteActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeleteDepartmentActionPerformed
private void tblDepartmentsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblDepartmentsMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblDepartments.getSelectedRow();
String selectedid = tblDepartments.getModel().getValueAt(row, 0).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tbldepartment where departmentid = " + selectedid);
if(rs.next()){
txtDepartmentid.setText(rs.getString("departmentid"));
txtDepartmentname.setText(rs.getString("department_name"));
txtDepartmentdescription.setText(rs.getString("description"));
stateUpdateDepartment();
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in jTable1MouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblDepartmentsMouseClicked
private void txtSearchdepartmentKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchdepartmentKeyReleased
// TODO add your handling code here:
showDepartments(cmbDepartmentsearchin.getSelectedItem().toString(), txtSearchdepartment.getText());
}//GEN-LAST:event_txtSearchdepartmentKeyReleased
private void txtStudentidKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtStudentidKeyPressed
// TODO add your handling code here:
if(evt.getKeyChar()=='\n'){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("select * from tblstudent where studentid=?");
pstmt.setInt(1, Integer.parseInt(txtStudentid.getText()));
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
stateUpdateStudent();
txtStudentname.setText(rs.getString("student_name"));
txtStudentaddress.setText(rs.getString("address"));
cmbStudentgender.setSelectedItem(rs.getString("gender"));
dteStudentbirthday.setDate(rs.getDate("birthday"));
txtStudentemail.setText(rs.getString("email"));
txtStudentphone.setText(rs.getString("phone"));
txtStudentbackground.setText(rs.getString("background"));
dteStudentregdate.setDate(rs.getDate("reg_date"));
cmbStudentbatchid.setSelectedItem(rs.getString("batchid"));
}else{
JOptionPane.showMessageDialog(rootPane, "Record not found!");
}
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in txtStudentidKeyPressed: " + ex.getMessage());
}
}
}//GEN-LAST:event_txtStudentidKeyPressed
private void btnUpdatestudentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdatestudentActionPerformed
// TODO add your handling code here:
if(Validator.validateStudent(null, txtStudentid, txtStudentname, txtStudentaddress, cmbStudentgender, dteStudentbirthday, txtStudentemail, txtStudentphone, txtStudentbackground, dteStudentregdate)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tblstudent set student_name=?, address=?, gender=?, birthday=?, email=?, phone=?, background=?, reg_date=?, batchid=? where studentid=?");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setString(1, txtStudentname.getText());
pstmt.setString(2, txtStudentaddress.getText());
pstmt.setString(3, cmbStudentgender.getSelectedItem().toString());
pstmt.setString(4, dt.format(dteStudentbirthday.getDate()));
pstmt.setString(5, txtStudentemail.getText());
pstmt.setString(6, txtStudentphone.getText());
pstmt.setString(7, txtStudentbackground.getText());
pstmt.setString(8, dt.format(dteStudentregdate.getDate()));
pstmt.setString(9, cmbStudentbatchid.getSelectedItem().toString());
pstmt.setInt(10, Integer.parseInt(txtStudentid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showStudents(null, null);
con.close();
Log.insert("Student", "Updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdatestudentActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdatestudentActionPerformed
private void btnDeletestudentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeletestudentActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblstudent where studentid=?");
pstmt.setInt(1, Integer.parseInt(txtStudentid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearStudentForm();
showStudents(null, null);
con.close();
stateInsertStudent();
Log.insert("Student", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeletestudentActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeletestudentActionPerformed
private void btnInsertstudentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertstudentActionPerformed
// TODO add your handling code here:
if(btnInsertstudent.getText() == "Insert"){
if(Validator.validateStudent(null, txtStudentid, txtStudentname, txtStudentaddress, cmbStudentgender, dteStudentbirthday, txtStudentemail, txtStudentphone, txtStudentbackground, dteStudentregdate)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblstudent values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setInt(1, Integer.parseInt(txtStudentid.getText()));
pstmt.setString(2, txtStudentname.getText());
pstmt.setString(3, txtStudentaddress.getText());
pstmt.setString(4, cmbStudentgender.getSelectedItem().toString());
pstmt.setString(5, dt.format(dteStudentbirthday.getDate()).toString());
pstmt.setString(6, txtStudentemail.getText());
pstmt.setString(7, txtStudentphone.getText());
pstmt.setString(8, txtStudentbackground.getText());
pstmt.setString(9, dt.format(dteStudentregdate.getDate()));
pstmt.setString(10, cmbStudentbatchid.getSelectedItem().toString());
pstmt.setInt(11, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearStudentForm();
showStudents(null, null);
Log.insert("Student", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertstudentActionPerformed(): " + ex.getMessage());
}
}
}else{
clearStudentForm();
stateInsertStudent();
}
}//GEN-LAST:event_btnInsertstudentActionPerformed
private void tblCoursesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblCoursesMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblCourses.getSelectedRow();
String selectedid = tblCourses.getModel().getValueAt(row, 0).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblcourse where courseid = " + selectedid);
if(rs.next()){
stateUpdateCourse();
txtCourseid.setText(rs.getString("courseid"));
txtCoursename.setText(rs.getString("course_name"));
txtCourseduration.setText(rs.getString("duration"));
txtCoursefee.setText(rs.getString("fee"));
txtCourselevel.setText(rs.getString("level"));
cmbCoursedepartmentid.setSelectedItem(rs.getString("departmentid"));
cmbCoursecoordinatorid.setSelectedItem(rs.getString("coordinatorid"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblCoursesMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblCoursesMouseClicked
private void txtSearchcourseKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchcourseKeyReleased
// TODO add your handling code here:
showCourses(cmbCoursesearchin.getSelectedItem().toString(), txtSearchcourse.getText());
}//GEN-LAST:event_txtSearchcourseKeyReleased
private void txtCourseidKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtCourseidKeyPressed
// TODO add your handling code here:
if(evt.getKeyChar()=='\n'){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("select * from tblcourse where courseid=?");
pstmt.setInt(1, Integer.parseInt(txtCourseid.getText()));
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
stateUpdateCourse();
txtCoursename.setText(rs.getString("course_name"));
txtCourseduration.setText(rs.getString("duration"));
txtCoursefee.setText(rs.getString("fee"));
txtCourselevel.setText(rs.getString("level"));
cmbCoursedepartmentid.setSelectedItem(rs.getString("departmentid"));
cmbCoursecoordinatorid.setSelectedItem(rs.getString("coordinatorid"));
}else{
JOptionPane.showMessageDialog(rootPane, "Record not found!");
}
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in txtCourseidKeyPressed: " + ex.getMessage());
}
}
}//GEN-LAST:event_txtCourseidKeyPressed
private void btnInsertcourseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertcourseActionPerformed
// TODO add your handling code here:
if(btnInsertcourse.getText() == "Insert"){
if(Validator.validateCourse(null, txtCourseid, txtCoursename, txtCourseduration, txtCoursefee, txtCourselevel, cmbCoursedepartmentid, cmbCoursecoordinatorid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblCourse values(?, ?, ?, ?, ?, ?, ?, ?)");
pstmt.setInt(1, Integer.parseInt(txtCourseid.getText()));
pstmt.setString(2, txtCoursename.getText());
pstmt.setString(3, txtCourseduration.getText());
pstmt.setString(4, txtCoursefee.getText());
pstmt.setString(5, txtCourselevel.getText());
pstmt.setString(6, cmbCoursedepartmentid.getSelectedItem().toString());
pstmt.setString(7, cmbCoursecoordinatorid.getSelectedItem().toString());
pstmt.setInt(8, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearCourseForm();
showCourses(null, null);
Log.insert("Course", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertcourseActionPerformed: " + ex.getMessage());
}
}
}else{
clearCourseForm();
stateInsertCourse();
}
}//GEN-LAST:event_btnInsertcourseActionPerformed
private void btnDeletecourseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeletecourseActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblcourse where courseid=?");
pstmt.setInt(1, Integer.parseInt(txtCourseid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearCourseForm();
showCourses(null, null);
con.close();
stateInsertCourse();
Log.insert("Course", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeletecourseActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeletecourseActionPerformed
private void btnUpdatecourseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdatecourseActionPerformed
// TODO add your handling code here:
if(Validator.validateCourse(null, txtCourseid, txtCoursename, txtCourseduration, txtCoursefee, txtCourselevel, cmbCoursedepartmentid, cmbCoursecoordinatorid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tblcourse set course_name=?, duration=?, fee=?, level=?, departmentid=?, coordinatorid=? where courseid=?");
pstmt.setString(1, txtCoursename.getText());
pstmt.setString(2, txtCourseduration.getText());
pstmt.setString(3, txtCoursefee.getText());
pstmt.setString(4, txtCourselevel.getText());
pstmt.setString(5, cmbCoursedepartmentid.getSelectedItem().toString());
pstmt.setString(6, cmbCoursecoordinatorid.getSelectedItem().toString());
pstmt.setInt(7, Integer.parseInt(txtCourseid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showCourses(null, null);
con.close();
Log.insert("Course", "Updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdatecourseActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdatecourseActionPerformed
private void tblLecturersMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblLecturersMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblLecturers.getSelectedRow();
String selectedid = tblLecturers.getModel().getValueAt(row, 0).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tbllecturer where lecturerid = " + selectedid);
if(rs.next()){
txtLecturerid.setText(rs.getString("lecturerid"));
txtLecturername.setText(rs.getString("lecturer_name"));
txtLectureraddress.setText(rs.getString("address"));
txtLectureremail.setText(rs.getString("email"));
txtLecturerphone.setText(rs.getString("phone"));
txtLecturerdescription.setText(rs.getString("description"));
stateUpdateLecturer();
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblLecturersMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblLecturersMouseClicked
private void txtSearchlecturerKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchlecturerKeyReleased
// TODO add your handling code here:
showLecturers(cmbLecturersearchin.getSelectedItem().toString(), txtSearchlecturer.getText());
}//GEN-LAST:event_txtSearchlecturerKeyReleased
private void txtLectureridKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtLectureridKeyPressed
// TODO add your handling code here:
if(evt.getKeyChar()=='\n'){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("select * from tbllecturer where lecturerid=?");
pstmt.setInt(1, Integer.parseInt(txtLecturerid.getText()));
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
txtLecturername.setText(rs.getString("lecturer_name"));
txtLectureraddress.setText(rs.getString("address"));
txtLectureremail.setText(rs.getString("email"));
txtLecturerphone.setText(rs.getString("phone"));
txtLecturerdescription.setText(rs.getString("description"));
}else{
JOptionPane.showMessageDialog(rootPane, "Record not found!");
}
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in txtLectureridKeyPressed: " + ex.getMessage());
}
}
}//GEN-LAST:event_txtLectureridKeyPressed
private void btnUpdatelecturerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdatelecturerActionPerformed
// TODO add your handling code here:
if(Validator.validateLecturer(null, txtLecturerid, txtLecturername, txtLectureraddress, txtLectureremail, txtLecturerphone)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tbllecturer set lecturer_name=?, address=?, email=?, phone=?, description=? where lecturerid=?");
pstmt.setString(1, txtLecturername.getText());
pstmt.setString(2, txtLectureraddress.getText());
pstmt.setString(3, txtLectureremail.getText());
pstmt.setString(4, txtLecturerphone.getText());
pstmt.setString(5, txtLecturerdescription.getText());
pstmt.setInt(6, Integer.parseInt(txtLecturerid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showLecturers(null, null);
con.close();
Log.insert("Lecturer", "Updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdatelecturerActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdatelecturerActionPerformed
private void btnDeletelecturerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeletelecturerActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tbllecturer where lecturerid=?");
pstmt.setInt(1, Integer.parseInt(txtLecturerid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearLecturerForm();
showLecturers(null, null);
con.close();
stateInsertLecturer();
Log.insert("Lecturer", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeletelecturerActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeletelecturerActionPerformed
private void btnInsertlecturerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertlecturerActionPerformed
// TODO add your handling code here:
if(btnInsertlecturer.getText() == "Insert"){
if(Validator.validateLecturer(null, txtLecturerid, txtLecturername, txtLectureraddress, txtLectureremail, txtLecturerphone)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tbllecturer values(?, ?, ?, ?, ?, ?, ?)");
pstmt.setInt(1, Integer.parseInt(txtLecturerid.getText()));
pstmt.setString(2, txtLecturername.getText());
pstmt.setString(3, txtLectureraddress.getText());
pstmt.setString(4, txtLectureremail.getText());
pstmt.setString(5, txtLecturerphone.getText());
pstmt.setString(6, txtLecturerdescription.getText());
pstmt.setInt(7, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearLecturerForm();
showLecturers(null, null);
Log.insert("Lecturer", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertlecturerActionPerformed(): " + ex.getMessage());
}
}
}else{
clearLecturerForm();
stateInsertLecturer();
}
}//GEN-LAST:event_btnInsertlecturerActionPerformed
private void tblPracticalsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblPracticalsMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblPracticals.getSelectedRow();
String selectedid = tblPracticals.getModel().getValueAt(row, 0).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblpractical where practicalid = " + selectedid);
if(rs.next()){
stateUpdatePractical();
txtPracticalid.setText(rs.getString("practicalid"));
dtePracticalstartdate.setDate(rs.getDate("starttime"));
dtePracticalenddate.setDate(rs.getDate("endtime"));
cmbPracticalstudentid.setSelectedItem(rs.getString("studentid"));
cmbPracticalclassroomid.setSelectedItem(rs.getString("classroomid"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblPracticalsMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblPracticalsMouseClicked
private void txtSearchpracticalKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchpracticalKeyReleased
// TODO add your handling code here:
showPracticals(cmbPracticalsearchin.getSelectedItem().toString(), txtSearchpractical.getText());
}//GEN-LAST:event_txtSearchpracticalKeyReleased
private void tblPaymentsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblPaymentsMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblPayments.getSelectedRow();
String selectedid = tblPayments.getModel().getValueAt(row, 0).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblpayment where paymentid = " + selectedid);
if(rs.next()){
stateUpdatePayment();
txtPaymentid.setText(rs.getString("paymentid"));
txtPaymentamount.setText(rs.getString("amount"));
dtePaymentdate.setDate(rs.getDate("time"));
cmbPaymentstudentid.setSelectedItem(rs.getString("studentid"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblPaymentsMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblPaymentsMouseClicked
private void txtSearchpaymentKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchpaymentKeyReleased
// TODO add your handling code here:
showPayments(cmbPaymentsearchin.getSelectedItem().toString(), txtSearchpayment.getText());
}//GEN-LAST:event_txtSearchpaymentKeyReleased
private void tblModulesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblModulesMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblModules.getSelectedRow();
String selectedid = tblModules.getModel().getValueAt(row, 0).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblmodule where moduleid = " + selectedid);
if(rs.next()){
stateUpdateModule();
txtModuleid.setText(rs.getString("moduleid"));
txtModulename.setText(rs.getString("module_name"));
txtModuledescription.setText(rs.getString("description"));
cmbModulelecturerid.setSelectedItem(rs.getString("lecturerid"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblModulesMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblModulesMouseClicked
private void txtSearchmoduleKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchmoduleKeyReleased
// TODO add your handling code here:
showModules(cmbModulesearchin.getSelectedItem().toString(), txtSearchmodule.getText());
}//GEN-LAST:event_txtSearchmoduleKeyReleased
private void tblExamsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblExamsMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblExams.getSelectedRow();
String selectedid = tblExams.getModel().getValueAt(row, 0).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblexam where examid = " + selectedid);
if(rs.next()){
stateUpdateExam();
txtExamid.setText(rs.getString("examid"));
dteExamstartdate.setDate(rs.getDate("starttime"));
dteExamenddate.setDate(rs.getDate("endtime"));
cmbExammoduleid.setSelectedItem(rs.getString("moduleid"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblExamsMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblExamsMouseClicked
private void txtSearchexamKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchexamKeyReleased
// TODO add your handling code here:
showExams(cmbExamsearchin.getSelectedItem().toString(), txtSearchexam.getText());
}//GEN-LAST:event_txtSearchexamKeyReleased
private void tblAssignmentsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblAssignmentsMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblAssignments.getSelectedRow();
String selectedid = tblAssignments.getModel().getValueAt(row, 0).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblassignment where assignmentid = " + selectedid);
if(rs.next()){
stateUpdateAssignment();
txtAssignmentid.setText(rs.getString("assignmentid"));
txtAssignmentname.setText(rs.getString("assignment_name"));
txtAssignmentdescription.setText(rs.getString("description"));
cmbAssignmentmoduleid.setSelectedItem(rs.getString("moduleid"));
dteAssignmentduedate.setDate(rs.getDate("duedate"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblAssignmentsMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblAssignmentsMouseClicked
private void txtSearchassignmentKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchassignmentKeyReleased
// TODO add your handling code here:
showAssignments(cmbAssignmentsearchin.getSelectedItem().toString(), txtSearchassignment.getText());
}//GEN-LAST:event_txtSearchassignmentKeyReleased
private void tblLecturesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblLecturesMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblLectures.getSelectedRow();
String selectedid = tblLectures.getModel().getValueAt(row, 0).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tbllecture where lectureid = " + selectedid);
if(rs.next()){
stateUpdateLecture();
txtLectureid.setText(rs.getString("lectureid"));
dteLecturestartdate.setDate(rs.getDate("starttime"));
dteLectureenddate.setDate(rs.getDate("endtime"));
txtLecturedescription.setText(rs.getString("description"));
txtLectureclassroomid.setText(rs.getString("classroomid"));
cmbLecturemoduleid.setSelectedItem(rs.getString("moduleid"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblLecturesMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblLecturesMouseClicked
private void txtSearchlectureKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchlectureKeyReleased
// TODO add your handling code here:
showLectures(cmbLecturessearchin.getSelectedItem().toString(), txtSearchlecture.getText());
}//GEN-LAST:event_txtSearchlectureKeyReleased
private void tblUsersMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblUsersMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblUsers.getSelectedRow();
String selectedid = tblUsers.getModel().getValueAt(row, 0).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tbluser where userid = " + selectedid);
if(rs.next()){
stateUpdateUser();
txtUserid.setText(rs.getString("userid"));
txtUsername.setText(rs.getString("user_name"));
txtUseremail.setText(rs.getString("email"));
cmbUsertype.setSelectedItem(rs.getString("type"));
cmbUserstatus.setSelectedItem(rs.getString("status"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblUsersMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblUsersMouseClicked
private void txtSearchuserKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchuserKeyReleased
// TODO add your handling code here:
showUsers(cmbUsersearchin.getSelectedItem().toString(), txtSearchuser.getText());
}//GEN-LAST:event_txtSearchuserKeyReleased
private void txtSearchlogKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchlogKeyReleased
// TODO add your handling code here:
showLogs(cmbLogsearchin.getSelectedItem().toString(), txtSearchlog.getText());
}//GEN-LAST:event_txtSearchlogKeyReleased
private void txtPracticalidKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPracticalidKeyPressed
// TODO add your handling code here:
if(evt.getKeyChar()=='\n'){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("select * from tblpractical where practicalid=?");
pstmt.setInt(1, Integer.parseInt(txtPracticalid.getText()));
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
stateUpdatePractical();
dtePracticalstartdate.setDate(rs.getDate("starttime"));
dtePracticalenddate.setDate(rs.getDate("endtime"));
cmbPracticalstudentid.setSelectedItem(rs.getString("studentid"));
cmbPracticalclassroomid.setSelectedItem(rs.getString("classroomid"));
}else{
JOptionPane.showMessageDialog(rootPane, "Record not found!");
}
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in txtPracticalidKeyPressed: " + ex.getMessage());
}
}
}//GEN-LAST:event_txtPracticalidKeyPressed
private void txtPaymentidKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPaymentidKeyPressed
// TODO add your handling code here:
if(evt.getKeyChar()=='\n'){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("select * from tblpayment where paymentid=?");
pstmt.setInt(1, Integer.parseInt(txtPaymentid.getText()));
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
stateUpdatePayment();
txtPaymentamount.setText(rs.getString("amount"));
dtePaymentdate.setDate(rs.getDate("time"));
cmbPaymentstudentid.setSelectedItem(rs.getString("studentid"));
}else{
JOptionPane.showMessageDialog(rootPane, "Record not found!");
}
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in txtPaymentidKeyPressed: " + ex.getMessage());
}
}
}//GEN-LAST:event_txtPaymentidKeyPressed
private void txtModuleidKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtModuleidKeyPressed
// TODO add your handling code here:
if(evt.getKeyChar()=='\n'){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("select * from tblmodule where moduleid=?");
pstmt.setInt(1, Integer.parseInt(txtModuleid.getText()));
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
stateUpdateModule();
txtModulename.setText(rs.getString("module_name"));
txtModuledescription.setText(rs.getString("description"));
cmbModulelecturerid.setSelectedItem(rs.getString("lecturerid"));
}else{
JOptionPane.showMessageDialog(rootPane, "Record not found!");
}
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in txtModuleidKeyPressed: " + ex.getMessage());
}
}
}//GEN-LAST:event_txtModuleidKeyPressed
private void txtExamidKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtExamidKeyPressed
// TODO add your handling code here:
if(evt.getKeyChar()=='\n'){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("select * from tblexam where examid=?");
pstmt.setInt(1, Integer.parseInt(txtExamid.getText()));
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
stateUpdateExam();
dteExamstartdate.setDate(rs.getDate("starttime"));
dteExamenddate.setDate(rs.getDate("endtime"));
cmbExammoduleid.setSelectedItem(rs.getString("moduleid"));
}else{
JOptionPane.showMessageDialog(rootPane, "Record not found!");
}
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in txtExamidKeyPressed: " + ex.getMessage());
}
}
}//GEN-LAST:event_txtExamidKeyPressed
private void txtAssignmentidKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtAssignmentidKeyPressed
// TODO add your handling code here:
if(evt.getKeyChar()=='\n'){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("select * from tblassignment where assignmentid=?");
pstmt.setInt(1, Integer.parseInt(txtAssignmentid.getText()));
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
stateUpdateAssignment();
txtAssignmentname.setText(rs.getString("assignment_name"));
txtAssignmentdescription.setText(rs.getString("description"));
cmbAssignmentmoduleid.setSelectedItem(rs.getString("moduleid"));
dteAssignmentduedate.setDate(rs.getDate("duedate"));
}else{
JOptionPane.showMessageDialog(rootPane, "Record not found!");
}
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in txtAssignmentidKeyPressed: " + ex.getMessage());
}
}
}//GEN-LAST:event_txtAssignmentidKeyPressed
private void txtLectureidKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtLectureidKeyPressed
// TODO add your handling code here:
if(evt.getKeyChar()=='\n'){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("select * from tbllecture where lectureid=?");
pstmt.setInt(1, Integer.parseInt(txtLectureid.getText()));
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
stateUpdateLecture();
dteLecturestartdate.setDate(rs.getDate("starttime"));
dteLectureenddate.setDate(rs.getDate("endtime"));
txtLecturedescription.setText(rs.getString("description"));
txtLectureclassroomid.setText(rs.getString("classroomid"));
cmbLecturemoduleid.setSelectedItem(rs.getString("moduleid"));
}else{
JOptionPane.showMessageDialog(rootPane, "Record not found!");
}
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in txtLectureidKeyPressed: " + ex.getMessage());
}
}
}//GEN-LAST:event_txtLectureidKeyPressed
private void txtUseridKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtUseridKeyPressed
// TODO add your handling code here:
if(evt.getKeyChar()=='\n'){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("select * from tbluser where userid=?");
pstmt.setInt(1, Integer.parseInt(txtUserid.getText()));
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
stateUpdateUser();
txtUsername.setText(rs.getString("user_name"));
txtUseremail.setText(rs.getString("email"));
cmbUsertype.setSelectedItem(rs.getString("type"));
cmbUserstatus.setSelectedItem(rs.getString("status"));
}else{
JOptionPane.showMessageDialog(rootPane, "Record not found!");
}
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in txtUseridKeyPressed: " + ex.getMessage());
}
}
}//GEN-LAST:event_txtUseridKeyPressed
private void btnUpdatepracticalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdatepracticalActionPerformed
// TODO add your handling code here:
if(Validator.validatePractical(null, txtPracticalid, dtePracticalstartdate, dtePracticalenddate, cmbPracticalstudentid, cmbPracticalclassroomid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tblpractical set starttime=?, endtime=?, studentid=?, classroomid=? where practicalid=?");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setString(1, dt.format(dtePracticalstartdate.getDate()).toString()+ " " + cmbPracticalstarttime.getSelectedItem());
pstmt.setString(2, dt.format(dtePracticalenddate.getDate()).toString()+ " " + cmbPracticalendtime.getSelectedItem());
pstmt.setString(3, cmbPracticalstudentid.getSelectedItem().toString());
pstmt.setString(4, cmbPracticalclassroomid.getSelectedItem().toString());
pstmt.setInt(5, Integer.parseInt(txtPracticalid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showPracticals(null, null);
con.close();
Log.insert("Practical", "Updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdatepracticalActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdatepracticalActionPerformed
private void btnDeletepracticalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeletepracticalActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblpractical where practicalid=?");
pstmt.setInt(1, Integer.parseInt(txtPracticalid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearPracticalForm();
showPracticals(null, null);
con.close();
stateInsertPractical();
Log.insert("Practical", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeletepracticalActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeletepracticalActionPerformed
private void btnInsertpracticalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertpracticalActionPerformed
// TODO add your handling code here:
if(btnInsertpractical.getText() == "Insert"){
if(Validator.validatePractical(null, txtPracticalid, dtePracticalstartdate, dtePracticalenddate, cmbPracticalstudentid, cmbPracticalclassroomid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblpractical values(?, ?, ?, ?, ?, ?)");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setInt(1, Integer.parseInt(txtPracticalid.getText()));
pstmt.setString(2, dt.format(dtePracticalstartdate.getDate()).toString()+ " " + cmbPracticalstarttime.getSelectedItem());
pstmt.setString(3, dt.format(dtePracticalenddate.getDate()).toString()+ " " + cmbPracticalendtime.getSelectedItem());
pstmt.setString(4, cmbPracticalstudentid.getSelectedItem().toString());
pstmt.setString(5, cmbPracticalclassroomid.getSelectedItem().toString());
pstmt.setInt(6, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearPracticalForm();
showPracticals(null, null);
Log.insert("Practical", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertpracticalActionPerformed(): " + ex.getMessage());
}
}
}else{
clearPracticalForm();
stateInsertPractical();
}
}//GEN-LAST:event_btnInsertpracticalActionPerformed
private void btnUpdatepaymentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdatepaymentActionPerformed
// TODO add your handling code here:
if(Validator.validatePayment(null, txtPaymentid, txtPaymentamount, dtePaymentdate, cmbPaymentstudentid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tblpayment set amount=?, time=?, studentid=? where paymentid=?");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setString(1, txtPaymentamount.getText());
pstmt.setString(2, dt.format(dtePaymentdate.getDate()).toString()+ " " + cmbPaymenttime.getSelectedItem());
pstmt.setString(3, cmbPaymentstudentid.getSelectedItem().toString());
pstmt.setInt(4, Integer.parseInt(txtPaymentid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showPayments(null, null);
con.close();
Log.insert("Payment", "Updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdatepaymentActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdatepaymentActionPerformed
private void btnDeletepaymentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeletepaymentActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblpayment where paymentid=?");
pstmt.setInt(1, Integer.parseInt(txtPaymentid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearPaymentForm();
showPayments(null, null);
con.close();
stateInsertPayment();
Log.insert("Payment", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeletepaymentActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeletepaymentActionPerformed
private void btnInsertpaymentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertpaymentActionPerformed
// TODO add your handling code here:
if(btnInsertpayment.getText() == "Insert"){
if(Validator.validatePayment(null, txtPaymentid, txtPaymentamount, dtePaymentdate, cmbPaymentstudentid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblpayment values(?, ?, ?, ?, ?)");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setInt(1, Integer.parseInt(txtPaymentid.getText()));
pstmt.setString(2, txtPaymentamount.getText());
pstmt.setString(3, dt.format(dtePaymentdate.getDate()).toString()+ " " + cmbPaymenttime.getSelectedItem());
pstmt.setString(4, cmbPaymentstudentid.getSelectedItem().toString());
pstmt.setInt(5, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearPaymentForm();
showPayments(null, null);
Log.insert("Payment", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertpaymentActionPerformed(): " + ex.getMessage());
}
}
}else{
clearPaymentForm();
stateInsertPayment();
}
}//GEN-LAST:event_btnInsertpaymentActionPerformed
private void btnUpdatemoduleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdatemoduleActionPerformed
// TODO add your handling code here:
if(Validator.validateModule(null, txtModuleid, txtModulename, cmbModulelecturerid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tblmodule set module_name=?, description=?, lecturerid=? where moduleid=?");
pstmt.setString(1, txtModulename.getText());
pstmt.setString(2, txtModuledescription.getText());
pstmt.setString(3, cmbModulelecturerid.getSelectedItem().toString());
pstmt.setInt(4, Integer.parseInt(txtModuleid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showModules(null, null);
con.close();
Log.insert("Module", "Updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdatemoduleActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdatemoduleActionPerformed
private void btnDeletemoduleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeletemoduleActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblmodule where moduleid=?");
pstmt.setInt(1, Integer.parseInt(txtModuleid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearModuleForm();
showModules(null, null);
con.close();
stateInsertModule();
Log.insert("Module", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeletemoduleActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeletemoduleActionPerformed
private void btnInsertmoduleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertmoduleActionPerformed
// TODO add your handling code here:
if(btnInsertmodule.getText() == "Insert"){
if(Validator.validateModule(null, txtModuleid, txtModulename, cmbModulelecturerid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblmodule values(?, ?, ?, ?, ?)");
pstmt.setInt(1, Integer.parseInt(txtModuleid.getText()));
pstmt.setString(2, txtModulename.getText());
pstmt.setString(3, txtModuledescription.getText());
pstmt.setString(4, cmbModulelecturerid.getSelectedItem().toString());
pstmt.setInt(5, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearModuleForm();
showModules(null, null);
Log.insert("Module", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertmoduleActionPerformed(): " + ex.getMessage());
}
}
}else{
clearModuleForm();
stateInsertModule();
}
}//GEN-LAST:event_btnInsertmoduleActionPerformed
private void btnUpdateexamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateexamActionPerformed
// TODO add your handling code here:
if(Validator.validateExam(null, txtExamid, dteExamstartdate, dteExamenddate, cmbExammoduleid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tblexam set starttime=?, endtime=?, moduleid=? where examid=?");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setString(1, dt.format(dteExamstartdate.getDate()).toString()+ " " + cmbExamstarttime.getSelectedItem());
pstmt.setString(2, dt.format(dteExamenddate.getDate()).toString()+ " " + cmbExamendtime.getSelectedItem());
pstmt.setString(3, cmbExammoduleid.getSelectedItem().toString());
pstmt.setInt(4, Integer.parseInt(txtExamid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showExams(null, null);
con.close();
Log.insert("Exam", "Updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdateexamActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdateexamActionPerformed
private void btnDeleteexamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteexamActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblexam where examid=?");
pstmt.setInt(1, Integer.parseInt(txtExamid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearExamForm();
showExams(null, null);
con.close();
stateInsertExam();
Log.insert("Exam", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeleteexamActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeleteexamActionPerformed
private void btnInsertexamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertexamActionPerformed
// TODO add your handling code here:
if(btnInsertexam.getText() == "Insert"){
if(Validator.validateExam(null, txtExamid, dteExamstartdate, dteExamenddate, cmbExammoduleid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblexam values(?, ?, ?, ?, ?)");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setInt(1, Integer.parseInt(txtExamid.getText()));
pstmt.setString(2, dt.format(dteExamstartdate.getDate()).toString()+ " " + cmbExamstarttime.getSelectedItem());
pstmt.setString(3, dt.format(dteExamenddate.getDate()).toString()+ " " + cmbExamendtime.getSelectedItem());
pstmt.setString(4, cmbExammoduleid.getSelectedItem().toString());
pstmt.setInt(5, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearExamForm();
showExams(null, null);
Log.insert("Exam", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertexamActionPerformed(): " + ex.getMessage());
}
}
}else{
clearExamForm();
stateInsertExam();
}
}//GEN-LAST:event_btnInsertexamActionPerformed
private void btnUpdateassignmentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateassignmentActionPerformed
// TODO add your handling code here:
if(Validator.validateAssignment(null, txtAssignmentid, txtAssignmentname, cmbAssignmentmoduleid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tblassignment set assignment_name=?, description=?, moduleid=?, duedate=? where assignmentid=?");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setString(1, txtAssignmentname.getText());
pstmt.setString(2, txtAssignmentdescription.getText());
pstmt.setString(3, cmbAssignmentmoduleid.getSelectedItem().toString());
pstmt.setString(4, dt.format(dteAssignmentduedate.getDate()).toString()+ " " + cmbAssignmentduetime.getSelectedItem());
pstmt.setInt(5, Integer.parseInt(txtAssignmentid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showAssignments(null, null);
con.close();
Log.insert("Assignment", "Updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdateassignmentActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdateassignmentActionPerformed
private void btnDeleteassignmentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteassignmentActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblassignment where examid=?");
pstmt.setInt(1, Integer.parseInt(txtAssignmentid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearAssignmentForm();
showAssignments(null, null);
con.close();
stateInsertAssignment();
Log.insert("Assignment", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeleteassignmentActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeleteassignmentActionPerformed
private void btnInsertassignmentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertassignmentActionPerformed
// TODO add your handling code here:
if(btnInsertassignment.getText() == "Insert"){
if(Validator.validateAssignment(null, txtAssignmentid, txtAssignmentname, cmbAssignmentmoduleid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblassignment values(?, ?, ?, ?, ?, ?)");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setInt(1, Integer.parseInt(txtAssignmentid.getText()));
pstmt.setString(2, txtAssignmentname.getText());
pstmt.setString(3, txtAssignmentdescription.getText());
pstmt.setString(4, cmbAssignmentmoduleid.getSelectedItem().toString());
pstmt.setString(5, dt.format(dteAssignmentduedate.getDate()).toString()+ " " + cmbAssignmentduetime.getSelectedItem());
pstmt.setInt(6, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearAssignmentForm();
showAssignments(null, null);
Log.insert("Assignment", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertassignmentActionPerformed(): " + ex.getMessage());
}
}
}else{
clearAssignmentForm();
stateInsertAssignment();
}
}//GEN-LAST:event_btnInsertassignmentActionPerformed
private void btnUpdatelectureActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdatelectureActionPerformed
// TODO add your handling code here:
if(Validator.validateLecture(null, txtLectureid, dteLecturestartdate, dteLectureenddate, txtLecturedescription, txtLectureclassroomid, cmbLecturemoduleid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tbllecture set starttime=?, endtime=?, description=?, classroomid=?, moduleid=? where lectureid=?");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setString(1, dt.format(dteLecturestartdate.getDate()).toString()+ " " + cmbLecturestarttime.getSelectedItem());
pstmt.setString(2, dt.format(dteLectureenddate.getDate()).toString()+ " " + cmbLectureendtime.getSelectedItem());
pstmt.setString(3, txtLecturedescription.getText());
pstmt.setString(4, txtLectureclassroomid.getText());
pstmt.setString(5, cmbLecturemoduleid.getSelectedItem().toString());
pstmt.setInt(6, Integer.parseInt(txtLectureid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showLectures(null, null);
con.close();
Log.insert("Lecture", "Updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdatelectureActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdatelectureActionPerformed
private void btnDeletelectureActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeletelectureActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tbllecture where lectureid=?");
pstmt.setInt(1, Integer.parseInt(txtLectureid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearLectureForm();
showLectures(null, null);
con.close();
stateInsertLecture();
Log.insert("Lecture", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeletelectureActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeletelectureActionPerformed
private void btnInsertlectureActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertlectureActionPerformed
// TODO add your handling code here:
if(btnInsertlecture.getText() == "Insert"){
if(Validator.validateLecture(null, txtLectureid, dteLecturestartdate, dteLectureenddate, txtLecturedescription, txtLectureclassroomid, cmbLecturemoduleid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tbllecture values(?, ?, ?, ?, ?, ?, ?)");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setInt(1, Integer.parseInt(txtLectureid.getText()));
pstmt.setString(2, dt.format(dteLecturestartdate.getDate()).toString()+ " " + cmbLecturestarttime.getSelectedItem());
pstmt.setString(3, dt.format(dteLectureenddate.getDate()).toString()+ " " + cmbLectureendtime.getSelectedItem());
pstmt.setString(4, txtLecturedescription.getText());
pstmt.setString(5, txtLectureclassroomid.getText());
pstmt.setString(6, cmbLecturemoduleid.getSelectedItem().toString());
pstmt.setInt(7, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearLectureForm();
showLectures(null, null);
Log.insert("Lecture", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertlectureActionPerformed(): " + ex.getMessage());
}
}
}else{
clearLectureForm();
stateInsertLecture();
}
}//GEN-LAST:event_btnInsertlectureActionPerformed
private void btnUpdateuserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateuserActionPerformed
// TODO add your handling code here:
if(Validator.validateUser(null, txtUserid, txtUsername, txtUseremail, txtUserpassword, cmbUsertype, cmbUserstatus)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tbluser set user_name=?, email=?, password=?, type=?, status=? where userid=?");
pstmt.setString(1, txtUsername.getText());
pstmt.setString(2, txtUseremail.getText());
pstmt.setString(3, txtUserpassword.getText());
pstmt.setString(4, cmbUsertype.getSelectedItem().toString());
pstmt.setString(5, cmbUserstatus.getSelectedItem().toString());
pstmt.setInt(6, Integer.parseInt(txtUserid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showUsers(null, null);
con.close();
Log.insert("User", "Updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdateuserActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdateuserActionPerformed
private void btnDeleteuserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteuserActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tbluser where userid=?");
pstmt.setInt(1, Integer.parseInt(txtUserid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearUserForm();
showUsers(null, null);
con.close();
stateInsertUser();
Log.insert("User", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeleteuserActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeleteuserActionPerformed
private void btnInsertuserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertuserActionPerformed
// TODO add your handling code here:
if(btnInsertuser.getText() == "Insert"){
if(Validator.validateUser(null, txtUserid, txtUsername, txtUseremail, txtUserpassword, cmbUsertype, cmbUserstatus)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tbluser values(?, ?, ?, ?, ?, ?)");
pstmt.setInt(1, Integer.parseInt(txtUserid.getText()));
pstmt.setString(2, txtUsername.getText());
pstmt.setString(3, txtUseremail.getText());
pstmt.setString(4, txtUserpassword.getText());
pstmt.setString(5, cmbUsertype.getSelectedItem().toString());
pstmt.setString(6, cmbUserstatus.getSelectedItem().toString());
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearUserForm();
showUsers(null, null);
Log.insert("User", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertuserActionPerformed(): " + ex.getMessage());
}
}
}else{
clearUserForm();
stateInsertUser();
}
}//GEN-LAST:event_btnInsertuserActionPerformed
private void tblClassroomsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblClassroomsMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblClassrooms.getSelectedRow();
String selectedid = tblClassrooms.getModel().getValueAt(row, 0).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblclassroom where classroomid = " + selectedid);
if(rs.next()){
txtClassroomid.setText(rs.getString("classroomid"));
txtClassroomname.setText(rs.getString("room_name"));
txtClassroomdescription.setText(rs.getString("description"));
stateUpdateClassroom();
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblClassroomsMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblClassroomsMouseClicked
private void txtSearchclassroomKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchclassroomKeyReleased
// TODO add your handling code here:
showClassrooms(cmbClassroomsearchin.getSelectedItem().toString(), txtSearchclassroom.getText());
}//GEN-LAST:event_txtSearchclassroomKeyReleased
private void txtClassroomidKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtClassroomidKeyPressed
// TODO add your handling code here:
if(evt.getKeyChar()=='\n'){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("select * from tblclassroom where classroomid=?");
pstmt.setInt(1, Integer.parseInt(txtClassroomid.getText()));
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
txtClassroomname.setText(rs.getString("room_name"));
txtClassroomdescription.setText(rs.getString("description"));
}else{
JOptionPane.showMessageDialog(rootPane, "Record not found!");
}
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in txtClassroomidKeyPressed: " + ex.getMessage());
}
}
}//GEN-LAST:event_txtClassroomidKeyPressed
private void btnInsertClassroomActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertClassroomActionPerformed
// TODO add your handling code here:
if(btnInsertClassroom.getText() == "Insert"){
if(Validator.validateClassroom(null, txtClassroomid, txtClassroomname)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblclassroom values(?, ?, ?, ?)");
pstmt.setInt(1, Integer.parseInt(txtClassroomid.getText()));
pstmt.setString(2, txtClassroomname.getText());
pstmt.setString(3, txtClassroomdescription.getText());
pstmt.setInt(4, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearClassroomForm();
showClassrooms(null, null);
Log.insert("Classroom", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertClassroomActionPerformed(): " + ex.getMessage());
}
}
}else{
clearClassroomForm();
stateInsertClassroom();
}
}//GEN-LAST:event_btnInsertClassroomActionPerformed
private void btnDeleteClassroomActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteClassroomActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblclassroom where classroomid=?");
pstmt.setInt(1, Integer.parseInt(txtClassroomid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearClassroomForm();
showClassrooms(null, null);
con.close();
stateInsertClassroom();
Log.insert("Classroom", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeleteClassroomActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeleteClassroomActionPerformed
private void btnUpdateClassroomActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateClassroomActionPerformed
// TODO add your handling code here:
if(Validator.validateClassroom(null, txtClassroomid, txtClassroomname)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tblclassroom set room_name=?, description=? where classroomid=?");
pstmt.setString(1, txtClassroomname.getText());
pstmt.setString(2, txtClassroomdescription.getText());
pstmt.setInt(3, Integer.parseInt(txtClassroomid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showClassrooms(null, null);
con.close();
Log.insert("Classroom", "updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdateClassroomActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdateClassroomActionPerformed
private void btnRefreshlogActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshlogActionPerformed
// TODO add your handling code here:
showLogs(null, null);
}//GEN-LAST:event_btnRefreshlogActionPerformed
private void tblBatchesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblBatchesMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblBatches.getSelectedRow();
String selectedid = tblBatches.getModel().getValueAt(row, 0).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblbatch where batchid = " + selectedid);
if(rs.next()){
stateUpdateBatch();
txtBatchid.setText(rs.getString("batchid"));
txtBatchname.setText(rs.getString("batch_name"));
dteBatchstartdate.setDate(rs.getDate("startdate"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblBatchesMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblBatchesMouseClicked
private void txtSearchbatchKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchbatchKeyReleased
// TODO add your handling code here:
showBatches(cmbBatchsearchin.getSelectedItem().toString(), txtSearchbatch.getText());
}//GEN-LAST:event_txtSearchbatchKeyReleased
private void txtBatchidKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtBatchidKeyPressed
// TODO add your handling code here:
if(evt.getKeyChar()=='\n'){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("select * from tblbatch where batchid=?");
pstmt.setInt(1, Integer.parseInt(txtBatchid.getText()));
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
txtBatchname.setText(rs.getString("batch_name"));
dteBatchstartdate.setDate(rs.getDate("startdate"));
}else{
JOptionPane.showMessageDialog(rootPane, "Record not found!");
}
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in txtBatchidKeyPressed: " + ex.getMessage());
}
}
}//GEN-LAST:event_txtBatchidKeyPressed
private void btnUpdateBatchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateBatchActionPerformed
// TODO add your handling code here:
if(Validator.validateBatch(null, txtBatchid, txtBatchname, dteBatchstartdate)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tblbatch set batch_name=?, startdate=? where batchid=?");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setString(1, txtBatchname.getText());
pstmt.setString(2, dt.format(dteBatchstartdate.getDate()).toString());
pstmt.setInt(3, Integer.parseInt(txtBatchid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showBatches(null, null);
con.close();
Log.insert("Batch", "updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdateBatchActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdateBatchActionPerformed
private void btnDeleteBatchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteBatchActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblbatch where batchid=?");
pstmt.setInt(1, Integer.parseInt(txtBatchid.getText()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearBatchForm();
showBatches(null, null);
con.close();
stateInsertBatch();
Log.insert("Batch", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeleteBatchActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeleteBatchActionPerformed
private void btnInsertBatchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertBatchActionPerformed
// TODO add your handling code here:
if(btnInsertBatch.getText() == "Insert"){
if(Validator.validateBatch(null, txtBatchid, txtBatchname, dteBatchstartdate)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblbatch values(?, ?, ?, ?)");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setInt(1, Integer.parseInt(txtBatchid.getText()));
pstmt.setString(2, txtBatchname.getText());
pstmt.setString(3, dt.format(dteBatchstartdate.getDate()).toString());
pstmt.setInt(4, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearBatchForm();
showBatches(null, null);
Log.insert("Batch", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertBatchActionPerformed(): " + ex.getMessage());
}
}
}else{
clearBatchForm();
stateInsertBatch();
}
}//GEN-LAST:event_btnInsertBatchActionPerformed
private void tblStudentsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblStudentsMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblStudents.getSelectedRow();
String selectedid = tblStudents.getModel().getValueAt(row, 0).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblstudent where studentid = " + selectedid);
if(rs.next()){
stateUpdateStudent();
txtStudentid.setText(rs.getString("studentid"));
txtStudentname.setText(rs.getString("student_name"));
txtStudentaddress.setText(rs.getString("address"));
cmbStudentgender.setSelectedItem(rs.getString("gender"));
dteStudentbirthday.setDate(rs.getDate("birthday"));
txtStudentemail.setText(rs.getString("email"));
txtStudentphone.setText(rs.getString("phone"));
txtStudentbackground.setText(rs.getString("background"));
cmbStudentbatchid.setSelectedItem(rs.getString("batchid"));
dteStudentregdate.setDate(rs.getDate("reg_date"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblStudentsMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblStudentsMouseClicked
private void txtSearchstudentKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchstudentKeyReleased
// TODO add your handling code here:
showStudents(cmbStudentsearchin.getSelectedItem().toString(), txtSearchstudent.getText());
}//GEN-LAST:event_txtSearchstudentKeyReleased
private void btnSendMailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSendMailActionPerformed
String email, pwd, subject, msg;
email= txtSenderEmail.getText();
ResultSet to = null;
ResultSet rs = null;
Connection con = DB.getConnection();
PreparedStatement pst = null;
try{
String sql="SELECT email FROM tblstudent";
pst=con.prepareStatement(sql);
rs=pst.executeQuery();
while(rs.next())
{
to=rs;
}
} catch (SQLException ex) {
Logger.getLogger(MainUI.class.getName()).log(Level.SEVERE, null, ex);
}
pwd= new String (txtSenderEmailPassword.getPassword());
subject= txtSubject.getText();
msg= txtMessage.getText();
try {
EmailClass.sendFromGMail(email, pwd, to, subject, msg);
} catch (MessagingException ex) {
Logger.getLogger(MainUI.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(MainUI.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_btnSendMailActionPerformed
private void tblStAssMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblStAssMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblStAss.getSelectedRow();
String selectedid1 = tblStAss.getModel().getValueAt(row, 0).toString();
String selectedid2 = tblStAss.getModel().getValueAt(row, 1).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblstudent_assignment where studentid = " + selectedid1 + " and assignmentid = " + selectedid2);
if(rs.next()){
stateUpdateStAss();
cmbStAssStudentid.setSelectedItem(rs.getString("studentid"));
cmbStAssAssignmentid.setSelectedItem(rs.getString("assignmentid"));
txtStAssMarks.setText(rs.getString("marks"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblStAssMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblStAssMouseClicked
private void txtSearchstassKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchstassKeyReleased
// TODO add your handling code here:
showStAss(cmbStAsssearchin.getSelectedItem().toString(), txtSearchstass.getText());
}//GEN-LAST:event_txtSearchstassKeyReleased
private void btnUpdateStAssActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateStAssActionPerformed
// TODO add your handling code here:
if(Validator.validateStAss(null, txtStAssMarks)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tblstudent_assignment set marks=? where studentid=? and assignmentid=?");
pstmt.setInt(1, Integer.parseInt(txtStAssMarks.getText()));
pstmt.setInt(2, Integer.parseInt(cmbStAssStudentid.getSelectedItem().toString()));
pstmt.setInt(3, Integer.parseInt(cmbStAssAssignmentid.getSelectedItem().toString()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showStAss(null, null);
con.close();
Log.insert("Student Assignment", "updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdateStAssActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdateStAssActionPerformed
private void btnDeleteStAssActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteStAssActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblstudent_assignment where studentid=? and assignmentid=?");
pstmt.setInt(1, Integer.parseInt(cmbStAssStudentid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbStAssAssignmentid.getSelectedItem().toString()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearStAssForm();
showStAss(null, null);
con.close();
stateInsertStAss();
Log.insert("Student Assignment", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeleteStAssActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeleteStAssActionPerformed
private void btnInsertStAssActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertStAssActionPerformed
// TODO add your handling code here:
if(btnInsertStAss.getText() == "Insert"){
if(Validator.validateStAss(null, txtStAssMarks)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblstudent_assignment values(?, ?, ?, ?)");
pstmt.setInt(1, Integer.parseInt(cmbStAssStudentid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbStAssAssignmentid.getSelectedItem().toString()));
pstmt.setDouble(3, Integer.parseInt(txtStAssMarks.getText()));
pstmt.setInt(4, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearStAssForm();
showStAss(null, null);
Log.insert("Student Assignment", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertStAssActionPerformed(): " + ex.getMessage());
}
}
}else{
clearStAssForm();
stateInsertStAss();
}
}//GEN-LAST:event_btnInsertStAssActionPerformed
private void btnUpdateStExamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateStExamActionPerformed
// TODO add your handling code here:
if(Validator.validateStExam(null, txtStExamMarks)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tblstudent_exam set marks=? where studentid=? and examid=?");
pstmt.setInt(1, Integer.parseInt(txtStExamMarks.getText()));
pstmt.setInt(2, Integer.parseInt(cmbStExamStudentid.getSelectedItem().toString()));
pstmt.setInt(3, Integer.parseInt(cmbStExamExamid.getSelectedItem().toString()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showStExams(null, null);
con.close();
Log.insert("Student Exam", "updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdateStExamActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdateStExamActionPerformed
private void btnDeleteStExamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteStExamActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblstudent_exam where studentid=? and examid=?");
pstmt.setInt(1, Integer.parseInt(cmbStExamStudentid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbStExamExamid.getSelectedItem().toString()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearStExamForm();
showStExams(null, null);
con.close();
stateInsertStExam();
Log.insert("Student Exam", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeleteStExamActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeleteStExamActionPerformed
private void btnInsertStExamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertStExamActionPerformed
// TODO add your handling code here:
if(btnInsertStExam.getText() == "Insert"){
if(Validator.validateStExam(null, txtStExamMarks)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblstudent_exam values(?, ?, ?, ?)");
pstmt.setInt(1, Integer.parseInt(cmbStExamStudentid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbStExamExamid.getSelectedItem().toString()));
pstmt.setDouble(3, Integer.parseInt(txtStExamMarks.getText()));
pstmt.setInt(4, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearStExamForm();
showStExams(null, null);
Log.insert("Student Exam", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertStExamActionPerformed(): " + ex.getMessage());
}
}
}else{
clearStExamForm();
stateInsertStExam();
}
}//GEN-LAST:event_btnInsertStExamActionPerformed
private void tblStExamMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblStExamMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblStExam.getSelectedRow();
String selectedid1 = tblStExam.getModel().getValueAt(row, 0).toString();
String selectedid2 = tblStExam.getModel().getValueAt(row, 1).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblstudent_exam where studentid = " + selectedid1 + " and examid = " + selectedid2);
if(rs.next()){
stateUpdateStExam();
cmbStExamStudentid.setSelectedItem(rs.getString("studentid"));
cmbStExamExamid.setSelectedItem(rs.getString("examid"));
txtStExamMarks.setText(rs.getString("marks"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblStExamMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblStExamMouseClicked
private void txtSearchstexamKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchstexamKeyReleased
// TODO add your handling code here:
showStExams(cmbStExamsearchin.getSelectedItem().toString(), txtSearchstexam.getText());
}//GEN-LAST:event_txtSearchstexamKeyReleased
private void tblCourseModulesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblCourseModulesMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblCourseModules.getSelectedRow();
String selectedid1 = tblCourseModules.getModel().getValueAt(row, 0).toString();
String selectedid2 = tblCourseModules.getModel().getValueAt(row, 1).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblcourse_module where courseid = " + selectedid1 + " and moduleid = " + selectedid2);
if(rs.next()){
stateUpdateCourseModule();
cmbCourseModuleCourseid.setSelectedItem(rs.getString("courseid"));
cmbCourseModuleModuleid.setSelectedItem(rs.getString("moduleid"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblCourseModulesMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblCourseModulesMouseClicked
private void txtSearchcoursemoduleKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchcoursemoduleKeyReleased
// TODO add your handling code here:
showCourseModules(cmbCourseModulesearchin.getSelectedItem().toString(), txtSearchcoursemodule.getText());
}//GEN-LAST:event_txtSearchcoursemoduleKeyReleased
private void btnDeleteCourseModuleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteCourseModuleActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblcourse_module where courseid=? and moduleid=?");
pstmt.setInt(1, Integer.parseInt(cmbCourseModuleCourseid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbCourseModuleModuleid.getSelectedItem().toString()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearCourseModuleForm();
showCourseModules(null, null);
con.close();
stateInsertCourseModule();
Log.insert("Course Module", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeleteCourseModuleActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeleteCourseModuleActionPerformed
private void btnInsertCourseModuleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertCourseModuleActionPerformed
// TODO add your handling code here:
if(btnInsertCourseModule.getText() == "Insert"){
if(Validator.validateCourseModule(null, cmbCourseModuleCourseid, cmbCourseModuleModuleid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblcourse_module values(?, ?, ?)");
pstmt.setInt(1, Integer.parseInt(cmbCourseModuleCourseid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbCourseModuleModuleid.getSelectedItem().toString()));
pstmt.setInt(3, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearCourseModuleForm();
showCourseModules(null, null);
Log.insert("Course Module", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertCourseModuleActionPerformed(): " + ex.getMessage());
}
}
}else{
clearCourseModuleForm();
stateInsertCourseModule();
}
}//GEN-LAST:event_btnInsertCourseModuleActionPerformed
private void btnUpdateStAttendanceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateStAttendanceActionPerformed
// TODO add your handling code here:
if(Validator.validateAttendance(null, cmbStAttendanceStudentid, cmbStAttendanceLectureid, dteStAttendancedate)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tblattendance set time=? where studentid=? and lectureid=?");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setString(1, dt.format(dteStAttendancedate.getDate()).toString()+ " " + cmbStAttendancetime.getSelectedItem());
pstmt.setString(2, cmbStAttendanceStudentid.getSelectedItem().toString());
pstmt.setString(3, cmbStAttendanceLectureid.getSelectedItem().toString());
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showStAttendance(null, null);
con.close();
Log.insert("Student Attendance", "updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdateStAttendanceActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdateStAttendanceActionPerformed
private void btnDeleteStAttendanceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteStAttendanceActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblattendance where studentid=? and lectureid=?");
pstmt.setInt(1, Integer.parseInt(cmbStAttendanceStudentid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbStAttendanceLectureid.getSelectedItem().toString()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearStAttendanceForm();
showStAttendance(null, null);
con.close();
stateInsertStAttendance();
Log.insert("Student Attendance", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeleteStAttendanceActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeleteStAttendanceActionPerformed
private void btnInsertStAttendanceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertStAttendanceActionPerformed
// TODO add your handling code here:
if(btnInsertStAttendance.getText() == "Insert"){
if(Validator.validateAttendance(null, cmbStAttendanceStudentid, cmbStAttendanceLectureid, dteStAttendancedate)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblattendance values(?, ?, ?, ?)");
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
pstmt.setInt(1, Integer.parseInt(cmbStAttendanceStudentid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbStAttendanceLectureid.getSelectedItem().toString()));
pstmt.setString(3, dt.format(dteStAttendancedate.getDate()).toString()+ " " + cmbStAttendancetime.getSelectedItem());
pstmt.setInt(4, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearStAttendanceForm();
showStAttendance(null, null);
Log.insert("Student Attendance", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertStAttendanceActionPerformed(): " + ex.getMessage());
}
}
}else{
clearStAttendanceForm();
stateInsertStAttendance();
}
}//GEN-LAST:event_btnInsertStAttendanceActionPerformed
private void tblStAttendanceMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblStAttendanceMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblStAttendance.getSelectedRow();
String selectedid1 = tblStAttendance.getModel().getValueAt(row, 0).toString();
String selectedid2 = tblStAttendance.getModel().getValueAt(row, 1).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblattendance where studentid = " + selectedid1 + " and lectureid = " + selectedid2);
if(rs.next()){
stateUpdateStAttendance();
cmbStAttendanceStudentid.setSelectedItem(rs.getString("studentid"));
cmbStAttendanceLectureid.setSelectedItem(rs.getString("lectureid"));
dteStAttendancedate.setDate(rs.getDate("time"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblStAttendanceMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblStAttendanceMouseClicked
private void txtSearchstattendanceKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchstattendanceKeyReleased
// TODO add your handling code here:
showStAttendance(cmbStAttendancesearchin.getSelectedItem().toString(), txtSearchstattendance.getText());
}//GEN-LAST:event_txtSearchstattendanceKeyReleased
private void btnUpdateStCourseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateStCourseActionPerformed
// TODO add your handling code here:
if(Validator.validateStCourse(null, txtStCourseFee)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("update tblstudent_course set fee=? where studentid=? and courseid=?");
pstmt.setInt(1, Integer.parseInt(txtStCourseFee.getText()));
pstmt.setInt(2, Integer.parseInt(cmbStCourseStudentid.getSelectedItem().toString()));
pstmt.setInt(3, Integer.parseInt(cmbStCourseCourseid.getSelectedItem().toString()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record updated successfully!");
showStCourses(null, null);
con.close();
Log.insert("Student Course", "updated", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnUpdateStCourseActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnUpdateStCourseActionPerformed
private void btnDeleteStCourseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteStCourseActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblstudent_course where studentid=? and courseid=?");
pstmt.setInt(1, Integer.parseInt(cmbStCourseStudentid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbStCourseCourseid.getSelectedItem().toString()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearStCourseForm();
showStCourses(null, null);
con.close();
stateInsertStCourse();
Log.insert("Student Course", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeleteStCourseActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeleteStCourseActionPerformed
private void btnInsertStCourseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertStCourseActionPerformed
// TODO add your handling code here:
if(btnInsertStCourse.getText() == "Insert"){
if(Validator.validateStCourse(null, txtStCourseFee)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblstudent_course values(?, ?, ?, ?)");
pstmt.setInt(1, Integer.parseInt(cmbStCourseCourseid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbStCourseStudentid.getSelectedItem().toString()));
pstmt.setDouble(3, Integer.parseInt(txtStCourseFee.getText()));
pstmt.setInt(4, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearStCourseForm();
showStCourses(null, null);
Log.insert("Student Course", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertStCourseActionPerformed(): " + ex.getMessage());
}
}
}else{
clearStCourseForm();
stateInsertStCourse();
}
}//GEN-LAST:event_btnInsertStCourseActionPerformed
private void tblStCourseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblStCourseMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblStCourse.getSelectedRow();
String selectedid1 = tblStCourse.getModel().getValueAt(row, 0).toString();
String selectedid2 = tblStCourse.getModel().getValueAt(row, 1).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblstudent_course where courseid = " + selectedid1 + " and studentid = " + selectedid2);
if(rs.next()){
stateUpdateStCourse();
cmbStCourseStudentid.setSelectedItem(rs.getString("studentid"));
cmbStCourseCourseid.setSelectedItem(rs.getString("courseid"));
txtStCourseFee.setText(rs.getString("fee"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblStCourseMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblStCourseMouseClicked
private void txtSearchstcourseKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchstcourseKeyReleased
// TODO add your handling code here:
showStCourses(cmbStCoursesearchin.getSelectedItem().toString(), txtSearchstcourse.getText());
}//GEN-LAST:event_txtSearchstcourseKeyReleased
private void btnAllStudentsReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAllStudentsReportActionPerformed
// TODO add your handling code here:
//getClass().getResource("/res/lectures.png")
ViewReport r = new ViewReport("C:\\Users\\koshila\\Documents\\NetBeansProjects\\Academy Management System\\src\\jreport\\rptAllStudents.jasper");
r.setVisible(true);
}//GEN-LAST:event_btnAllStudentsReportActionPerformed
private void btnStudentAssignmentsReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStudentAssignmentsReportActionPerformed
// TODO add your handling code here:
ViewReport r = new ViewReport("C:\\Users\\koshila\\Documents\\NetBeansProjects\\Academy Management System\\src\\jreport\\rptStudentAssignments.jasper");
r.setVisible(true);
}//GEN-LAST:event_btnStudentAssignmentsReportActionPerformed
private void btnStudentExamsReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStudentExamsReportActionPerformed
// TODO add your handling code here:
ViewReport r = new ViewReport("C:\\Users\\koshila\\Documents\\NetBeansProjects\\Academy Management System\\src\\jreport\\rptStudentExams.jasper");
r.setVisible(true);
}//GEN-LAST:event_btnStudentExamsReportActionPerformed
private void btnStudentAssignmentReport2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStudentAssignmentReport2ActionPerformed
// TODO add your handling code here:
HashMap para = new HashMap();
para.put("studentid", txtAssignmentReportStudentid.getText());
ViewReport r = new ViewReport("C:\\Users\\koshila\\Documents\\NetBeansProjects\\Academy Management System\\src\\jreport\\rptStudentAssignment2.jasper", para);
r.setVisible(true);
}//GEN-LAST:event_btnStudentAssignmentReport2ActionPerformed
private void btnStudentExamsReport2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStudentExamsReport2ActionPerformed
// TODO add your handling code here:
HashMap para = new HashMap();
para.put("studentid", txtAssignmentReportStudentid.getText());
ViewReport r = new ViewReport("C:\\Users\\koshila\\Documents\\NetBeansProjects\\Academy Management System\\src\\jreport\\StudentExamsReport2.jasper", para);
r.setVisible(true);
}//GEN-LAST:event_btnStudentExamsReport2ActionPerformed
private void btnStudentPaymentsReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStudentPaymentsReportActionPerformed
// TODO add your handling code here:
HashMap para = new HashMap();
para.put("studentid", txtPaymentReportStudentid.getText());
ViewReport r = new ViewReport("C:\\Users\\koshila\\Documents\\NetBeansProjects\\Academy Management System\\src\\jreport\\rptStudentPayments.jasper", para);
r.setVisible(true);
}//GEN-LAST:event_btnStudentPaymentsReportActionPerformed
private void btnAllPaymentsReport1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAllPaymentsReport1ActionPerformed
// TODO add your handling code here:
ViewReport r = new ViewReport("C:\\Users\\koshila\\Documents\\NetBeansProjects\\Academy Management System\\src\\jreport\\rptAllPayments.jasper");
r.setVisible(true);
}//GEN-LAST:event_btnAllPaymentsReport1ActionPerformed
private void btnBackupActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBackupActionPerformed
// TODO add your handling code here:
Backup.Backupdbtosql();
}//GEN-LAST:event_btnBackupActionPerformed
private void btnRestoreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRestoreActionPerformed
// TODO add your handling code here:
Backup.Restoredbfromsql(txtSqlDump.getText());
}//GEN-LAST:event_btnRestoreActionPerformed
private void btnStudentBatchReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStudentBatchReportActionPerformed
// TODO add your handling code here:
HashMap para = new HashMap();
para.put("batchid", txtBatchReportStudentid.getText());
ViewReport r = new ViewReport("C:\\Users\\koshila\\Documents\\NetBeansProjects\\Academy Management System\\src\\jreport\\rptBatchStudents.jasper", para);
r.setVisible(true);
}//GEN-LAST:event_btnStudentBatchReportActionPerformed
private void btnAllCoursesReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAllCoursesReportActionPerformed
// TODO add your handling code here:
ViewReport r = new ViewReport("C:\\Users\\koshila\\Documents\\NetBeansProjects\\Academy Management System\\src\\jreport\\rptAllCourses.jasper");
r.setVisible(true);
}//GEN-LAST:event_btnAllCoursesReportActionPerformed
private void btnAllBatchesReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAllBatchesReportActionPerformed
// TODO add your handling code here:
ViewReport r = new ViewReport("C:\\Users\\koshila\\Documents\\NetBeansProjects\\Academy Management System\\src\\jreport\\rptAllBatches.jasper");
r.setVisible(true);
}//GEN-LAST:event_btnAllBatchesReportActionPerformed
private void btnCourseStudentsReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCourseStudentsReportActionPerformed
// TODO add your handling code here:
HashMap para = new HashMap();
para.put("courseid", txtCourseStudentReportCourseid.getText());
ViewReport r = new ViewReport("C:\\Users\\koshila\\Documents\\NetBeansProjects\\Academy Management System\\src\\jreport\\rptCourseStudents.jasper", para);
r.setVisible(true);
}//GEN-LAST:event_btnCourseStudentsReportActionPerformed
private void tblStBatchMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblStBatchMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblStBatch.getSelectedRow();
String selectedid1 = tblStBatch.getModel().getValueAt(row, 0).toString();
String selectedid2 = tblStBatch.getModel().getValueAt(row, 1).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblstudent_batch where batchid = " + selectedid1 + " and studentid = " + selectedid2);
if(rs.next()){
stateUpdateStBatch();
cmbStBatchStudentid.setSelectedItem(rs.getString("studentid"));
cmbStBatchBatchid.setSelectedItem(rs.getString("batchid"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblStBatchMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblStBatchMouseClicked
private void txtSearchstbatchKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchstbatchKeyReleased
// TODO add your handling code here:
showStBatches(cmbStBatchsearchin.getSelectedItem().toString(), txtSearchstbatch.getText());
}//GEN-LAST:event_txtSearchstbatchKeyReleased
private void btnDeleteStBatchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteStBatchActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblstudent_batch where studentid=? and batchid=?");
pstmt.setInt(1, Integer.parseInt(cmbStBatchStudentid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbStBatchBatchid.getSelectedItem().toString()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearStBatchForm();
showStBatches(null, null);
con.close();
stateInsertStBatch();
Log.insert("Student Batch", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeleteStBatchActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeleteStBatchActionPerformed
private void btnInsertStBatchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertStBatchActionPerformed
// TODO add your handling code here:
if(btnInsertStBatch.getText() == "Insert"){
if(Validator.validateStudentBatch(null, cmbStBatchStudentid, cmbStBatchBatchid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblstudent_batch values(?, ?, ?)");
pstmt.setInt(1, Integer.parseInt(cmbStBatchBatchid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbStBatchStudentid.getSelectedItem().toString()));
pstmt.setInt(3, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearStBatchForm();
showStBatches(null, null);
Log.insert("Student Batch", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertStBatchActionPerformed(): " + ex.getMessage());
}
}
}else{
clearStBatchForm();
stateInsertStBatch();
}
}//GEN-LAST:event_btnInsertStBatchActionPerformed
private void btnDeleteCourseBatchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteCourseBatchActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tblcourse_batch where courseid=? and batchid=?");
pstmt.setInt(1, Integer.parseInt(cmbCourseBatchCourseid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbCourseBatchBatchid.getSelectedItem().toString()));
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
clearCourseBatchForm();
showCourseBatches(null, null);
con.close();
stateInsertCourseBatch();
Log.insert("Course Batch", "Deleted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnDeleteCourseBatchActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnDeleteCourseBatchActionPerformed
private void btnInsertCourseBatchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertCourseBatchActionPerformed
// TODO add your handling code here:
if(btnInsertCourseBatch.getText() == "Insert"){
if(Validator.validateCourseBatch(null, cmbCourseBatchCourseid, cmbCourseBatchBatchid)){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("insert into tblcourse_batch values(?, ?, ?)");
pstmt.setInt(1, Integer.parseInt(cmbCourseBatchCourseid.getSelectedItem().toString()));
pstmt.setInt(2, Integer.parseInt(cmbCourseBatchBatchid.getSelectedItem().toString()));
pstmt.setInt(3, userid);
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(this, n + " record inserted successfully!");
con.close();
clearCourseBatchForm();
showCourseBatches(null, null);
Log.insert("Course Batch", "Inserted", userid);
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in btnInsertCourseBatchActionPerformed(): " + ex.getMessage());
}
}
}else{
clearCourseBatchForm();
stateInsertCourseBatch();
}
}//GEN-LAST:event_btnInsertCourseBatchActionPerformed
private void tblCourseBatchesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblCourseBatchesMouseClicked
// TODO add your handling code here:
try{
con = DB.getConnection();
int row = tblCourseBatches.getSelectedRow();
String selectedid1 = tblCourseBatches.getModel().getValueAt(row, 0).toString();
String selectedid2 = tblCourseBatches.getModel().getValueAt(row, 1).toString();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tblcourse_batch where courseid = " + selectedid1 + " and batchid = " + selectedid2);
if(rs.next()){
stateUpdateCourseBatch();
cmbCourseBatchCourseid.setSelectedItem(rs.getString("courseid"));
cmbCourseBatchBatchid.setSelectedItem(rs.getString("batchid"));
}else{
JOptionPane.showMessageDialog(this, "No record found");
}
}catch(Exception ex){
JOptionPane.showMessageDialog(this, "Exception in tblCourseBatchesMouseClicked: " + ex.getMessage());
}
}//GEN-LAST:event_tblCourseBatchesMouseClicked
private void txtSearchcoursebatchKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchcoursebatchKeyReleased
// TODO add your handling code here:
showCourseBatches(cmbCourseBatchsearchin.getSelectedItem().toString(), txtSearchcoursebatch.getText());
}//GEN-LAST:event_txtSearchcoursebatchKeyReleased
private void btnClearLogActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClearLogActionPerformed
// TODO add your handling code here:
int respond = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete this record?", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(respond == 0){
try{
con = DB.getConnection();
PreparedStatement pstmt = con.prepareStatement("delete from tbllog");
int n = pstmt.executeUpdate();
JOptionPane.showMessageDialog(rootPane, n + " record deleted successfully!");
showLogs(null, null);
con.close();
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, "Exception in btnClearLogActionPerformed: " + ex.getMessage());
}
}
}//GEN-LAST:event_btnClearLogActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
/*try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(MainUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MainUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MainUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MainUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}*/
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MainUI(usertype, userid).setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel AboutPanel;
private javax.swing.JPanel AssignmentsPanel;
private javax.swing.JPanel BatchesPanel;
private javax.swing.JPanel ClassroomsPanel;
private javax.swing.JPanel CoursesPanel;
private javax.swing.JPanel DepartmentsPanel;
private javax.swing.JPanel ExamsPanel;
private javax.swing.JPanel LecturersPanel;
private javax.swing.JPanel LecturesPanel;
private javax.swing.JPanel LogsPanel;
private javax.swing.JPanel ModulesPanel;
private javax.swing.JPanel PaymentsPanel;
private javax.swing.JPanel PracticalsPanel;
private javax.swing.JPanel ReportsPanel;
private javax.swing.JPanel StudentsPanel;
private javax.swing.JTabbedPane TabbedPane;
private javax.swing.JPanel ToolsPanel;
private javax.swing.JPanel UsersPanel;
private javax.swing.JButton btnAllBatchesReport;
private javax.swing.JButton btnAllCoursesReport;
private javax.swing.JButton btnAllPaymentsReport1;
private javax.swing.JButton btnAllStudentsReport;
private javax.swing.JButton btnBackup;
private javax.swing.JButton btnClearLog;
private javax.swing.JButton btnCourseStudentsReport;
private javax.swing.JButton btnDeleteBatch;
private javax.swing.JButton btnDeleteClassroom;
private javax.swing.JButton btnDeleteCourseBatch;
private javax.swing.JButton btnDeleteCourseModule;
private javax.swing.JButton btnDeleteDepartment;
private javax.swing.JButton btnDeleteStAss;
private javax.swing.JButton btnDeleteStAttendance;
private javax.swing.JButton btnDeleteStBatch;
private javax.swing.JButton btnDeleteStCourse;
private javax.swing.JButton btnDeleteStExam;
private javax.swing.JButton btnDeleteassignment;
private javax.swing.JButton btnDeletecourse;
private javax.swing.JButton btnDeleteexam;
private javax.swing.JButton btnDeletelecture;
private javax.swing.JButton btnDeletelecturer;
private javax.swing.JButton btnDeletemodule;
private javax.swing.JButton btnDeletepayment;
private javax.swing.JButton btnDeletepractical;
private javax.swing.JButton btnDeletestudent;
private javax.swing.JButton btnDeleteuser;
private javax.swing.JButton btnInsertBatch;
private javax.swing.JButton btnInsertClassroom;
private javax.swing.JButton btnInsertCourseBatch;
private javax.swing.JButton btnInsertCourseModule;
private javax.swing.JButton btnInsertDepartment;
private javax.swing.JButton btnInsertStAss;
private javax.swing.JButton btnInsertStAttendance;
private javax.swing.JButton btnInsertStBatch;
private javax.swing.JButton btnInsertStCourse;
private javax.swing.JButton btnInsertStExam;
private javax.swing.JButton btnInsertassignment;
private javax.swing.JButton btnInsertcourse;
private javax.swing.JButton btnInsertexam;
private javax.swing.JButton btnInsertlecture;
private javax.swing.JButton btnInsertlecturer;
private javax.swing.JButton btnInsertmodule;
private javax.swing.JButton btnInsertpayment;
private javax.swing.JButton btnInsertpractical;
private javax.swing.JButton btnInsertstudent;
private javax.swing.JButton btnInsertuser;
private javax.swing.JButton btnRefreshlog;
private javax.swing.JButton btnRestore;
private javax.swing.JButton btnSendMail;
private javax.swing.JButton btnStudentAssignmentReport2;
private javax.swing.JButton btnStudentAssignmentsReport;
private javax.swing.JButton btnStudentBatchReport;
private javax.swing.JButton btnStudentExamsReport;
private javax.swing.JButton btnStudentExamsReport2;
private javax.swing.JButton btnStudentPaymentsReport;
private javax.swing.JButton btnUpdateBatch;
private javax.swing.JButton btnUpdateClassroom;
private javax.swing.JButton btnUpdateDepartment;
private javax.swing.JButton btnUpdateStAss;
private javax.swing.JButton btnUpdateStAttendance;
private javax.swing.JButton btnUpdateStCourse;
private javax.swing.JButton btnUpdateStExam;
private javax.swing.JButton btnUpdateassignment;
private javax.swing.JButton btnUpdatecourse;
private javax.swing.JButton btnUpdateexam;
private javax.swing.JButton btnUpdatelecture;
private javax.swing.JButton btnUpdatelecturer;
private javax.swing.JButton btnUpdatemodule;
private javax.swing.JButton btnUpdatepayment;
private javax.swing.JButton btnUpdatepractical;
private javax.swing.JButton btnUpdatestudent;
private javax.swing.JButton btnUpdateuser;
private javax.swing.JComboBox cmbAssignmentduetime;
private javax.swing.JComboBox cmbAssignmentmoduleid;
private javax.swing.JComboBox cmbAssignmentsearchin;
private javax.swing.JComboBox cmbBatchsearchin;
private javax.swing.JComboBox cmbClassroomsearchin;
private javax.swing.JComboBox cmbCourseBatchBatchid;
private javax.swing.JComboBox cmbCourseBatchCourseid;
private javax.swing.JComboBox cmbCourseBatchsearchin;
private javax.swing.JComboBox cmbCourseModuleCourseid;
private javax.swing.JComboBox cmbCourseModuleModuleid;
private javax.swing.JComboBox cmbCourseModulesearchin;
private javax.swing.JComboBox cmbCoursecoordinatorid;
private javax.swing.JComboBox cmbCoursedepartmentid;
private javax.swing.JComboBox cmbCoursesearchin;
private javax.swing.JComboBox cmbDepartmentsearchin;
private javax.swing.JComboBox cmbExamendtime;
private javax.swing.JComboBox cmbExammoduleid;
private javax.swing.JComboBox cmbExamsearchin;
private javax.swing.JComboBox cmbExamstarttime;
private javax.swing.JComboBox cmbLectureendtime;
private javax.swing.JComboBox cmbLecturemoduleid;
private javax.swing.JComboBox cmbLecturersearchin;
private javax.swing.JComboBox cmbLecturessearchin;
private javax.swing.JComboBox cmbLecturestarttime;
private javax.swing.JComboBox cmbLogsearchin;
private javax.swing.JComboBox cmbModulelecturerid;
private javax.swing.JComboBox cmbModulesearchin;
private javax.swing.JComboBox cmbPaymentsearchin;
private javax.swing.JComboBox cmbPaymentstudentid;
private javax.swing.JComboBox cmbPaymenttime;
private javax.swing.JComboBox cmbPracticalclassroomid;
private javax.swing.JComboBox cmbPracticalendtime;
private javax.swing.JComboBox cmbPracticalsearchin;
private javax.swing.JComboBox cmbPracticalstarttime;
private javax.swing.JComboBox cmbPracticalstudentid;
private javax.swing.JComboBox cmbStAssAssignmentid;
private javax.swing.JComboBox cmbStAssStudentid;
private javax.swing.JComboBox cmbStAsssearchin;
private javax.swing.JComboBox cmbStAttendanceLectureid;
private javax.swing.JComboBox cmbStAttendanceStudentid;
private javax.swing.JComboBox cmbStAttendancesearchin;
private javax.swing.JComboBox cmbStAttendancetime;
private javax.swing.JComboBox cmbStBatchBatchid;
private javax.swing.JComboBox cmbStBatchStudentid;
private javax.swing.JComboBox cmbStBatchsearchin;
private javax.swing.JComboBox cmbStCourseCourseid;
private javax.swing.JComboBox cmbStCourseStudentid;
private javax.swing.JComboBox cmbStCoursesearchin;
private javax.swing.JComboBox cmbStExamExamid;
private javax.swing.JComboBox cmbStExamStudentid;
private javax.swing.JComboBox cmbStExamsearchin;
private javax.swing.JComboBox cmbStudentbatchid;
private javax.swing.JComboBox cmbStudentgender;
private javax.swing.JComboBox cmbStudentsearchin;
private javax.swing.JComboBox cmbUsersearchin;
private javax.swing.JComboBox cmbUserstatus;
private javax.swing.JComboBox cmbUsertype;
private com.toedter.calendar.JDateChooser dteAssignmentduedate;
private com.toedter.calendar.JDateChooser dteBatchstartdate;
private com.toedter.calendar.JDateChooser dteExamenddate;
private com.toedter.calendar.JDateChooser dteExamstartdate;
private com.toedter.calendar.JDateChooser dteLectureenddate;
private com.toedter.calendar.JDateChooser dteLecturestartdate;
private com.toedter.calendar.JDateChooser dtePaymentdate;
private com.toedter.calendar.JDateChooser dtePracticalenddate;
private com.toedter.calendar.JDateChooser dtePracticalstartdate;
private com.toedter.calendar.JDateChooser dteStAttendancedate;
private com.toedter.calendar.JDateChooser dteStudentbirthday;
private com.toedter.calendar.JDateChooser dteStudentregdate;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel100;
private javax.swing.JLabel jLabel101;
private javax.swing.JLabel jLabel102;
private javax.swing.JLabel jLabel103;
private javax.swing.JLabel jLabel104;
private javax.swing.JLabel jLabel105;
private javax.swing.JLabel jLabel106;
private javax.swing.JLabel jLabel107;
private javax.swing.JLabel jLabel108;
private javax.swing.JLabel jLabel109;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel110;
private javax.swing.JLabel jLabel111;
private javax.swing.JLabel jLabel112;
private javax.swing.JLabel jLabel113;
private javax.swing.JLabel jLabel114;
private javax.swing.JLabel jLabel115;
private javax.swing.JLabel jLabel116;
private javax.swing.JLabel jLabel117;
private javax.swing.JLabel jLabel118;
private javax.swing.JLabel jLabel119;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel120;
private javax.swing.JLabel jLabel121;
private javax.swing.JLabel jLabel122;
private javax.swing.JLabel jLabel123;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel22;
private javax.swing.JLabel jLabel23;
private javax.swing.JLabel jLabel24;
private javax.swing.JLabel jLabel25;
private javax.swing.JLabel jLabel26;
private javax.swing.JLabel jLabel27;
private javax.swing.JLabel jLabel28;
private javax.swing.JLabel jLabel29;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel30;
private javax.swing.JLabel jLabel31;
private javax.swing.JLabel jLabel32;
private javax.swing.JLabel jLabel33;
private javax.swing.JLabel jLabel34;
private javax.swing.JLabel jLabel35;
private javax.swing.JLabel jLabel36;
private javax.swing.JLabel jLabel37;
private javax.swing.JLabel jLabel38;
private javax.swing.JLabel jLabel39;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel40;
private javax.swing.JLabel jLabel41;
private javax.swing.JLabel jLabel42;
private javax.swing.JLabel jLabel43;
private javax.swing.JLabel jLabel44;
private javax.swing.JLabel jLabel45;
private javax.swing.JLabel jLabel46;
private javax.swing.JLabel jLabel47;
private javax.swing.JLabel jLabel48;
private javax.swing.JLabel jLabel49;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel50;
private javax.swing.JLabel jLabel51;
private javax.swing.JLabel jLabel52;
private javax.swing.JLabel jLabel53;
private javax.swing.JLabel jLabel54;
private javax.swing.JLabel jLabel55;
private javax.swing.JLabel jLabel56;
private javax.swing.JLabel jLabel57;
private javax.swing.JLabel jLabel58;
private javax.swing.JLabel jLabel59;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel60;
private javax.swing.JLabel jLabel61;
private javax.swing.JLabel jLabel62;
private javax.swing.JLabel jLabel63;
private javax.swing.JLabel jLabel64;
private javax.swing.JLabel jLabel65;
private javax.swing.JLabel jLabel66;
private javax.swing.JLabel jLabel67;
private javax.swing.JLabel jLabel68;
private javax.swing.JLabel jLabel69;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel70;
private javax.swing.JLabel jLabel71;
private javax.swing.JLabel jLabel72;
private javax.swing.JLabel jLabel73;
private javax.swing.JLabel jLabel74;
private javax.swing.JLabel jLabel75;
private javax.swing.JLabel jLabel76;
private javax.swing.JLabel jLabel77;
private javax.swing.JLabel jLabel78;
private javax.swing.JLabel jLabel79;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel80;
private javax.swing.JLabel jLabel81;
private javax.swing.JLabel jLabel82;
private javax.swing.JLabel jLabel83;
private javax.swing.JLabel jLabel84;
private javax.swing.JLabel jLabel85;
private javax.swing.JLabel jLabel86;
private javax.swing.JLabel jLabel87;
private javax.swing.JLabel jLabel88;
private javax.swing.JLabel jLabel89;
private javax.swing.JLabel jLabel9;
private javax.swing.JLabel jLabel90;
private javax.swing.JLabel jLabel91;
private javax.swing.JLabel jLabel92;
private javax.swing.JLabel jLabel93;
private javax.swing.JLabel jLabel94;
private javax.swing.JLabel jLabel95;
private javax.swing.JLabel jLabel96;
private javax.swing.JLabel jLabel97;
private javax.swing.JLabel jLabel98;
private javax.swing.JLabel jLabel99;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel10;
private javax.swing.JPanel jPanel11;
private javax.swing.JPanel jPanel12;
private javax.swing.JPanel jPanel13;
private javax.swing.JPanel jPanel14;
private javax.swing.JPanel jPanel15;
private javax.swing.JPanel jPanel16;
private javax.swing.JPanel jPanel17;
private javax.swing.JPanel jPanel18;
private javax.swing.JPanel jPanel19;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel20;
private javax.swing.JPanel jPanel21;
private javax.swing.JPanel jPanel22;
private javax.swing.JPanel jPanel23;
private javax.swing.JPanel jPanel24;
private javax.swing.JPanel jPanel25;
private javax.swing.JPanel jPanel26;
private javax.swing.JPanel jPanel27;
private javax.swing.JPanel jPanel28;
private javax.swing.JPanel jPanel29;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel30;
private javax.swing.JPanel jPanel31;
private javax.swing.JPanel jPanel32;
private javax.swing.JPanel jPanel33;
private javax.swing.JPanel jPanel34;
private javax.swing.JPanel jPanel35;
private javax.swing.JPanel jPanel36;
private javax.swing.JPanel jPanel37;
private javax.swing.JPanel jPanel38;
private javax.swing.JPanel jPanel39;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel40;
private javax.swing.JPanel jPanel41;
private javax.swing.JPanel jPanel42;
private javax.swing.JPanel jPanel43;
private javax.swing.JPanel jPanel44;
private javax.swing.JPanel jPanel45;
private javax.swing.JPanel jPanel46;
private javax.swing.JPanel jPanel47;
private javax.swing.JPanel jPanel48;
private javax.swing.JPanel jPanel49;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel50;
private javax.swing.JPanel jPanel51;
private javax.swing.JPanel jPanel52;
private javax.swing.JPanel jPanel53;
private javax.swing.JPanel jPanel54;
private javax.swing.JPanel jPanel55;
private javax.swing.JPanel jPanel56;
private javax.swing.JPanel jPanel57;
private javax.swing.JPanel jPanel58;
private javax.swing.JPanel jPanel59;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
private javax.swing.JPanel jPanel9;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane10;
private javax.swing.JScrollPane jScrollPane11;
private javax.swing.JScrollPane jScrollPane12;
private javax.swing.JScrollPane jScrollPane13;
private javax.swing.JScrollPane jScrollPane14;
private javax.swing.JScrollPane jScrollPane15;
private javax.swing.JScrollPane jScrollPane16;
private javax.swing.JScrollPane jScrollPane17;
private javax.swing.JScrollPane jScrollPane18;
private javax.swing.JScrollPane jScrollPane19;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane20;
private javax.swing.JScrollPane jScrollPane21;
private javax.swing.JScrollPane jScrollPane22;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JScrollPane jScrollPane5;
private javax.swing.JScrollPane jScrollPane6;
private javax.swing.JScrollPane jScrollPane7;
private javax.swing.JScrollPane jScrollPane8;
private javax.swing.JScrollPane jScrollPane9;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTabbedPane jTabbedPane2;
private javax.swing.JTabbedPane jTabbedPane3;
private javax.swing.JTabbedPane jTabbedPane4;
private javax.swing.JTabbedPane jTabbedPane5;
private javax.swing.JTextField jTextField1;
private javax.swing.JTable tblAssignments;
private javax.swing.JTable tblBatches;
private javax.swing.JTable tblClassrooms;
private javax.swing.JTable tblCourseBatches;
private javax.swing.JTable tblCourseModules;
private javax.swing.JTable tblCourses;
private javax.swing.JTable tblDepartments;
private javax.swing.JTable tblExams;
private javax.swing.JTable tblLecturers;
private javax.swing.JTable tblLectures;
private javax.swing.JTable tblLogs;
private javax.swing.JTable tblModules;
private javax.swing.JTable tblPayments;
private javax.swing.JTable tblPracticals;
private javax.swing.JTable tblStAss;
private javax.swing.JTable tblStAttendance;
private javax.swing.JTable tblStBatch;
private javax.swing.JTable tblStCourse;
private javax.swing.JTable tblStExam;
private javax.swing.JTable tblStudents;
private javax.swing.JTable tblUsers;
private javax.swing.JTextField txtAssignmentReportStudentid;
private javax.swing.JTextField txtAssignmentdescription;
private javax.swing.JTextField txtAssignmentid;
private javax.swing.JTextField txtAssignmentname;
private javax.swing.JTextField txtBatchReportStudentid;
private javax.swing.JTextField txtBatchid;
private javax.swing.JTextField txtBatchname;
private javax.swing.JTextField txtClassroomdescription;
private javax.swing.JTextField txtClassroomid;
private javax.swing.JTextField txtClassroomname;
private javax.swing.JTextField txtCourseStudentReportCourseid;
private javax.swing.JTextField txtCourseduration;
private javax.swing.JTextField txtCoursefee;
private javax.swing.JTextField txtCourseid;
private javax.swing.JTextField txtCourselevel;
private javax.swing.JTextField txtCoursename;
private javax.swing.JTextField txtDepartmentdescription;
private javax.swing.JTextField txtDepartmentid;
private javax.swing.JTextField txtDepartmentname;
private javax.swing.JTextField txtExamid;
private javax.swing.JTextField txtLectureclassroomid;
private javax.swing.JTextField txtLecturedescription;
private javax.swing.JTextField txtLectureid;
private javax.swing.JTextField txtLectureraddress;
private javax.swing.JTextField txtLecturerdescription;
private javax.swing.JTextField txtLectureremail;
private javax.swing.JTextField txtLecturerid;
private javax.swing.JTextField txtLecturername;
private javax.swing.JTextField txtLecturerphone;
private javax.swing.JTextArea txtMessage;
private javax.swing.JTextField txtModuledescription;
private javax.swing.JTextField txtModuleid;
private javax.swing.JTextField txtModulename;
private javax.swing.JTextField txtPaymentReportStudentid;
private javax.swing.JTextField txtPaymentamount;
private javax.swing.JTextField txtPaymentid;
private javax.swing.JTextField txtPracticalid;
private javax.swing.JTextField txtSearchassignment;
private javax.swing.JTextField txtSearchbatch;
private javax.swing.JTextField txtSearchclassroom;
private javax.swing.JTextField txtSearchcourse;
private javax.swing.JTextField txtSearchcoursebatch;
private javax.swing.JTextField txtSearchcoursemodule;
private javax.swing.JTextField txtSearchdepartment;
private javax.swing.JTextField txtSearchexam;
private javax.swing.JTextField txtSearchlecture;
private javax.swing.JTextField txtSearchlecturer;
private javax.swing.JTextField txtSearchlog;
private javax.swing.JTextField txtSearchmodule;
private javax.swing.JTextField txtSearchpayment;
private javax.swing.JTextField txtSearchpractical;
private javax.swing.JTextField txtSearchstass;
private javax.swing.JTextField txtSearchstattendance;
private javax.swing.JTextField txtSearchstbatch;
private javax.swing.JTextField txtSearchstcourse;
private javax.swing.JTextField txtSearchstexam;
private javax.swing.JTextField txtSearchstudent;
private javax.swing.JTextField txtSearchuser;
private javax.swing.JTextField txtSenderEmail;
private javax.swing.JPasswordField txtSenderEmailPassword;
private javax.swing.JTextField txtSqlDump;
private javax.swing.JTextField txtStAssMarks;
private javax.swing.JTextField txtStCourseFee;
private javax.swing.JTextField txtStExamMarks;
private javax.swing.JTextField txtStudentaddress;
private javax.swing.JTextField txtStudentbackground;
private javax.swing.JTextField txtStudentemail;
private javax.swing.JTextField txtStudentid;
private javax.swing.JTextField txtStudentname;
private javax.swing.JTextField txtStudentphone;
private javax.swing.JTextField txtSubject;
private javax.swing.JTextField txtUseremail;
private javax.swing.JTextField txtUserid;
private javax.swing.JTextField txtUsername;
private javax.swing.JTextField txtUserpassword;
// End of variables declaration//GEN-END:variables
}
| [
"rasansmn@gmail.com"
] | rasansmn@gmail.com |
bbcf671e3976a16561e280e0c3d0fe77ceff3ef4 | a8828367cedff13aa67acca7f562bb15f0784df6 | /Suport curs - ZeroToHero/ZeroToHeroWebApp - pasul 14/src/main/java/ro/zerotohero/model/Employee.java | 6404560cf2044a72ee68af89fadc433f8f0101e6 | [] | no_license | TeamnetGroup/FromZeroToHero | fa26e9ec7838b11b6025383c1a08f1b19ef011c4 | b28d584c503b6b7b9770eaf6bd23c3d72c9a1fd6 | refs/heads/master | 2016-09-06T20:04:55.455963 | 2014-01-07T09:48:02 | 2014-01-07T09:48:02 | 14,399,152 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,216 | java | package ro.zerotohero.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
@Entity
@Table(name = "Employee")
public class Employee implements Serializable {
private static final long serialVersionUID = 1L;
private int employeeId;
private String firstName;
private String lastName;
private String email;
private String password;
private List<Role> roleList = new ArrayList<Role>();
@ManyToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST }, fetch=FetchType.EAGER)
@JoinTable(name = "EMPLOYEE_ROLE", joinColumns = { @JoinColumn(name = "EMPLOYEE_ID") }, inverseJoinColumns = { @JoinColumn(name = "ROLE_ID") })
public List<Role> getRoleList() {
return roleList;
}
public void setRoleList(List<Role> roleList) {
this.roleList = roleList;
}
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "EMPLOYEE_ID", unique = true, nullable = false)
public int getEmployeeId() {
return employeeId;
}
public void setEmployeeId(int employeeId) {
this.employeeId = employeeId;
}
@Column(name = "PASSWORD", unique = false, nullable = false)
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Column(name = "FIRST_NAME", unique = false, nullable = false)
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
@Column(name = "LAST_NAME", unique = false, nullable = false)
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
@Column(name = "EMAIL", unique = true, nullable = false)
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
| [
"liviu.spiroiu@liviuspi-mbl.intranet.teamnet.ro"
] | liviu.spiroiu@liviuspi-mbl.intranet.teamnet.ro |
1a28962a017c0d9aa58e29c1230c11359d3458b8 | 648140c37af354b05d6dbc52e48cd3de89c9ba92 | /common/src/main/java/com/codefinity/microcontinuum/common/notification/NotificationLogReader.java | 1fb05cb1b594e55820e8ca38cfe54f9dda2e7634 | [
"MIT"
] | permissive | codefinity/micro-continuum | 242b530d8f08c1a7d3a745012450cffb122b2e71 | 59f0b426faaf6faa551f2bda1c305040e2a8d31d | refs/heads/master | 2021-03-30T21:20:01.295883 | 2018-07-22T10:18:06 | 2018-07-22T10:18:06 | 124,922,490 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,912 | java | /*package com.codefinity.microcontinuum.common.notification;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.NoSuchElementException;
import com.codefinity.microcontinuum.common.media.AbstractJSONMediaReader;
import com.codefinity.microcontinuum.common.media.Link;
import com.codefinity.microcontinuum.common.media.RepresentationReader;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
public class NotificationLogReader
extends AbstractJSONMediaReader
implements List<NotificationReader>, Iterable<NotificationReader> {
private JsonArray array;
public NotificationLogReader(String aJSONRepresentation) {
super(aJSONRepresentation);
this.array = this.array("notifications");
if (this.array == null) {
this.array = new JsonArray();
}
if (!this.array.isJsonArray()) {
throw new IllegalStateException("There are no notifications, and the representation may not be a log.");
}
}
public boolean isArchived() {
return this.booleanValue("archived");
}
public String id() {
return this.stringValue("id");
}
public Iterator<NotificationReader> notifications() {
return this.iterator();
}
public boolean hasNext() {
return this.next() != null;
}
public Link next() {
return this.linkNamed("linkNext");
}
public boolean hasPrevious() {
return this.previous() != null;
}
public Link previous() {
return this.linkNamed("linkPrevious");
}
public boolean hasSelf() {
return this.self() != null;
}
public Link self() {
return this.linkNamed("linkSelf");
}
///////////////////////////////////////////////
// Iterable and Collection implementations
///////////////////////////////////////////////
@Override
public Iterator<NotificationReader> iterator() {
return new NotificationReaderIterator();
}
@Override
public int size() {
return this.array.size();
}
@Override
public boolean isEmpty() {
return this.size() > 0;
}
@Override
public boolean contains(Object o) {
throw new UnsupportedOperationException("Cannot ask contains.");
}
@Override
public Object[] toArray() {
List<NotificationReader> readers = new ArrayList<NotificationReader>();
for (NotificationReader reader : this) {
readers.add(reader);
}
return readers.toArray();
}
@Override
@SuppressWarnings("unchecked")
public <T> T[] toArray(T[] a) {
return (T[]) this.toArray();
}
@Override
public boolean add(NotificationReader e) {
throw new UnsupportedOperationException("Cannot add.");
}
@Override
public boolean remove(Object o) {
throw new UnsupportedOperationException("Cannot remove.");
}
@Override
public boolean containsAll(Collection<?> c) {
throw new UnsupportedOperationException("Cannot ask containsAll.");
}
@Override
public boolean addAll(Collection<? extends NotificationReader> c) {
throw new UnsupportedOperationException("Cannot addAll.");
}
@Override
public boolean addAll(int index, Collection<? extends NotificationReader> c) {
throw new UnsupportedOperationException("Cannot addAll.");
}
@Override
public boolean removeAll(Collection<?> c) {
throw new UnsupportedOperationException("Cannot removeAll.");
}
@Override
public boolean retainAll(Collection<?> c) {
throw new UnsupportedOperationException("Cannot retainAll.");
}
@Override
public void clear() {
throw new UnsupportedOperationException("Cannot clear.");
}
@Override
public NotificationReader get(int index) {
JsonElement element = this.array.get(index);
NotificationReader reader =
new NotificationReader(element.getAsJsonObject());
return reader;
}
@Override
public NotificationReader set(int index, NotificationReader element) {
throw new UnsupportedOperationException("Cannot set.");
}
@Override
public void add(int index, NotificationReader element) {
throw new UnsupportedOperationException("Cannot add.");
}
@Override
public NotificationReader remove(int index) {
throw new UnsupportedOperationException("Cannot remove.");
}
@Override
public int indexOf(Object o) {
throw new UnsupportedOperationException("Cannot ask indexOf.");
}
@Override
public int lastIndexOf(Object o) {
throw new UnsupportedOperationException("Cannot ask lastIndexOf.");
}
@Override
public ListIterator<NotificationReader> listIterator() {
return new NotificationReaderIterator();
}
@Override
public ListIterator<NotificationReader> listIterator(int index) {
return new NotificationReaderIterator();
}
@Override
public List<NotificationReader> subList(int fromIndex, int toIndex) {
// this implementation is not a typical subList(), but
// provides only an immutable subset of the orginal list
List<NotificationReader> readers = new ArrayList<NotificationReader>();
for (int idx = fromIndex; idx < toIndex; ++idx) {
NotificationReader reader = this.get(idx);
readers.add(reader);
}
return Collections.unmodifiableList(readers);
}
private Link linkNamed(String aLinkName) {
Link link = null;
JsonElement linkElement = this.elementFrom(this.representation(), aLinkName);
if (linkElement.isJsonObject()) {
RepresentationReader rep = new RepresentationReader(linkElement.getAsJsonObject());
link =
new Link(
rep.stringValue("href"),
rep.stringValue("rel"),
rep.stringValue("title"),
rep.stringValue("type"));
}
return link;
}
private class NotificationReaderIterator implements ListIterator<NotificationReader> {
private int index;
NotificationReaderIterator() {
super();
}
@Override
public boolean hasNext() {
return this.nextIndex() < size();
}
@Override
public NotificationReader next() {
if (!this.hasNext()) {
throw new NoSuchElementException("No such next element.");
}
NotificationReader reader = get(this.index++);
return reader;
}
@Override
public void remove() {
throw new UnsupportedOperationException("Cannot remove.");
}
@Override
public boolean hasPrevious() {
return this.previousIndex() >= 0;
}
@Override
public NotificationReader previous() {
if (!this.hasPrevious()) {
throw new NoSuchElementException("No such previous element.");
}
NotificationReader reader = get(--this.index);
return reader;
}
@Override
public int nextIndex() {
return this.index;
}
@Override
public int previousIndex() {
return this.index - 1;
}
@Override
public void set(NotificationReader e) {
throw new UnsupportedOperationException("Cannot set.");
}
@Override
public void add(NotificationReader e) {
throw new UnsupportedOperationException("Cannot add.");
}
}
}
*/ | [
"nikhilpat@gmail.com"
] | nikhilpat@gmail.com |
dc4f7300ed77ac9ac7fae85151575cd965135b37 | 7e34a7041306f87d79efa1aee4ed2a806362f16c | /Chapter 13/StringReverse.java | f420711032a006317ad434f366f6079139916b22 | [] | no_license | alsutton1/unit7ObjectOrientedDesign | 40fb2063766b0df36f880e7aad075b02ec588d99 | a1e3486a709377609620d844f2ae0b783f1ff679 | refs/heads/master | 2021-01-18T19:15:28.535006 | 2015-03-12T16:30:52 | 2015-03-12T16:30:52 | 30,422,742 | 0 | 0 | null | 2015-02-06T16:55:33 | 2015-02-06T16:55:33 | null | UTF-8 | Java | false | false | 467 | java |
public class StringReverse
{
public static String reverse(String text)
{
if(text.length() <= 1)
{
return text;
}
char c = text.charAt(0);
String rest = new String(text.substring(1));
String reverseText = reverse(rest) + c;
return reverseText;
}
public static void main(String[] args)
{
System.out.println(reverse("Happiness"));
}
}
| [
"AlexSutton2011@gmail.com"
] | AlexSutton2011@gmail.com |
d379526aac6c11e8c2a5c29f264ab4b5f6baeac7 | 421f0a75a6b62c5af62f89595be61f406328113b | /generated_tests/no_seeding/8_gfarcegestionfa-fr.unice.gfarce.interGraph.ChoixDB4O-1.0-10/fr/unice/gfarce/interGraph/ChoixDB4O_ESTest.java | a06729ede5100662312370e9dc00b85661f4fd7a | [] | no_license | tigerqiu712/evosuite-model-seeding-empirical-evaluation | c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6 | 11a920b8213d9855082d3946233731c843baf7bc | refs/heads/master | 2020-12-23T21:04:12.152289 | 2019-10-30T08:02:29 | 2019-10-30T08:02:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 650 | java | /*
* This file was automatically generated by EvoSuite
* Mon Oct 28 23:41:42 GMT 2019
*/
package fr.unice.gfarce.interGraph;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
public class ChoixDB4O_ESTest extends ChoixDB4O_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pderakhshanfar@bsr01.win.tue.nl"
] | pderakhshanfar@bsr01.win.tue.nl |
96856133a64b7b940bf6f1690f9ae2ecf33167fe | 2da111b62f7ffbe718b6bcc7de7574cc90b79bc7 | /src/team/sulv/mybatis/dao/CommentDao.java | 071f1e06892f5eefd1a82134c09238046ce51120 | [] | no_license | yosora1/Sulv | b48b6d866f3c8eb18b7272b405b56ae8963ab7a2 | 48615fe5ce72e42d011121702db43419eb851a46 | refs/heads/master | 2020-03-22T21:11:08.420639 | 2018-07-20T08:02:47 | 2018-07-20T08:02:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,921 | java | package team.sulv.mybatis.dao;
import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import team.sulv.mybatis.Idao.CollectionMapper;
import team.sulv.mybatis.Idao.CommentMapper;
import team.sulv.mybatis.po.Collection;
import team.sulv.mybatis.po.CollectionKey;
import team.sulv.mybatis.po.Comment;
import team.sulv.mybatis.po.CommentKey;
import team.sulv.tool.DatabaseConnect;
public class CommentDao {
DatabaseConnect dbcon=new DatabaseConnect();
private CommentMapper commap;
public List<Comment> selectComment(int articleId) throws IOException{
SqlSession session=dbcon.Connect();
commap=session.getMapper(CommentMapper.class);
List<Comment> comList=commap.selectComment(articleId);
session.commit();
session.close();
return comList;
}
public Boolean addComment(Comment comment) throws IOException{
SqlSession session=dbcon.Connect();
commap=session.getMapper(CommentMapper.class);
int a=commap.insert(comment);
session.commit();
session.close();
if(a>0)
return true;
else
return false;
}
public Boolean deleteComment(CommentKey key) throws IOException{
SqlSession session=dbcon.Connect();
commap=session.getMapper(CommentMapper.class);
int a=commap.deleteByPrimaryKey(key);
session.commit();
session.close();
if(a>0)
return true;
else
return false;
}
public List<Comment> getMessageP(CommentKey key) throws IOException{
SqlSession session=dbcon.Connect();
commap=session.getMapper(CommentMapper.class);
List<Comment> commentList=commap.getComment(key);
session.commit();
session.close();
return commentList;
}
public Boolean clearP(CommentKey key) throws IOException{
SqlSession session=dbcon.Connect();
commap=session.getMapper(CommentMapper.class);
int a=commap.clearP(key);
session.commit();
session.close();
if(a>0)
return true;
else
return false;
}
}
| [
"41095544+yosola1@users.noreply.github.com"
] | 41095544+yosola1@users.noreply.github.com |
5c33a76509338e6feb4ddfb88cd1fd5f79f119ef | 1d759fea7875bfd403c23be5112ac3696a955df4 | /app/src/main/java/jonathan/fall/foodmed/PresentMeal/MealMain.java | ac0d15ad78bdf529789a6ab8a1c1a3ab2201f0b9 | [] | no_license | johnny550/food_med_And | fcab9441c49b56971e06fac3650619f4adf45f38 | 3670e09bddcef1a0a2fae93117c63e3bd71b2bb4 | refs/heads/master | 2020-06-20T12:54:56.941085 | 2019-09-02T14:11:18 | 2019-09-02T14:11:18 | 197,129,645 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 28,180 | java | package jonathan.fall.foodmed.PresentMeal;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.database.sqlite.SQLiteException;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.content.FileProvider;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONStringer;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.URL;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
import databaseSettings.DatabaseHelper;
import jonathan.fall.foodmed.Dashboard.Dashboard;
import jonathan.fall.foodmed.R;
import static android.app.Activity.RESULT_OK;
public class MealMain extends Fragment {
static final int REQUEST_IMAGE_CAPTURE = 1;
public ImageView myThumbnail, photoAdding, photoTaking;
public TextView previous, submit;
private static final String TAG = "MyActivity";
static final int REQUEST_TAKE_PHOTO = 1;
private File photoFile = null;
public Bitmap myBitmap;
private ProgressDialog progress;
public EditText mealComments;
public Map<String, String> questions;
public String appetite, condition, volumeMeal;
public String freeComments;
public static final String SHARED_PREF = "shPrefs";
public DatabaseHelper myDBHelper;
public String patientIDRetrievied;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_present_meal, container, false);
try {
getQuestions();
} catch (JSONException e) {
e.printStackTrace();
}
//initializing the database helper
myDBHelper = new DatabaseHelper(getActivity());
//Linking myThumbnail to the imageView thumbnail on our layout
myThumbnail = v.findViewById(R.id.thumbnail);
//SAME
photoAdding = v.findViewById(R.id.add_photo);
photoTaking = v.findViewById(R.id.take_photo);
//a listener for taking pictures
photoTaking.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dispatchTakePictureIntent();
}
});
patientIDRetrievied = getPatientID();
mealComments = v.findViewById(R.id.meal_comments);
previous = v.findViewById(R.id.PreviousBFinal);
previous.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
deletePreviouslySavedData();
Objects.requireNonNull(getFragmentManager())
.beginTransaction()
.replace(R.id.fragment_container, new ConditionStatement())
.addToBackStack(null)
.commit();
}
});
submit = v.findViewById(R.id.submit);
submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
imageSender start_task = new imageSender();
readMyData();
start_task.execute();
}
});
return v;
}
/**
* Method to verify if the device is connected to the Internet
*/
private boolean isNetworkAvailable() {
ConnectivityManager connectivityManager
= (ConnectivityManager) getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
}
public void readMyData() {
SharedPreferences sharedPref = getActivity().getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE);
String mealsList[] = getResources().getStringArray(R.array.meal_propositions);
String fullQuestionsList[] = getResources().getStringArray(R.array.first_questions_block);
String questionsList[] = new String[8];
for (int i = 0; i < fullQuestionsList.length - 1; i++) {
questionsList[i] = fullQuestionsList[i];
}
questions = new HashMap<>();
for (String item : mealsList) {
Boolean meal = sharedPref.getBoolean(item, false);
//Log.d("TAG", "--"+item+": "+meal);
if (meal) {
//TODO
//question8 = meal;
}
}
for (int i = 0; i < questionsList.length; i++) {
Boolean question = sharedPref.getBoolean(questionsList[i], false);
int newIndex = i + 1;
questions.put("question" + newIndex, Boolean.toString(question));
}
appetite = String.valueOf(sharedPref.getFloat("Appetite", 0));
condition = String.valueOf(sharedPref.getFloat("Condition", 0));
volumeMeal = sharedPref.getString("volume_meal", "0");
freeComments = mealComments.getText().toString();
}
public void deletePreviouslySavedData() {
SharedPreferences sharedPref = getActivity().getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE);
String mealsList[] = getResources().getStringArray(R.array.meal_propositions);
SharedPreferences.Editor editor = sharedPref.edit();
for (String item : mealsList) {
// if(sharedPref.getString(item,"")){
editor.putBoolean(item, false);
//}
}
editor.commit();
}
public void dispatchTakePictureIntent() {
//No need to save the image
/* Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePictureIntent.resolveActivity(getActivity().getPackageManager()) != null) {
startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
}
*/
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
// Ensure that there's a camera activity to handle the intent
if (takePictureIntent.resolveActivity(Objects.requireNonNull(getActivity()).getPackageManager()) != null) {
// Create the File where the photo should go
try {
photoFile = createImageFile();
} catch (Exception ex) {
// Error occurred while creating the File
Log.i(TAG, "We are in-----------------------------------------------");
}
// Continue only if the File was successfully created
if (photoFile != null) {
Uri photoURI = FileProvider.getUriForFile(getActivity().getApplicationContext(),
"jonathan.fall.foodmed.fileprovider",
photoFile);
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);
//startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
}
}
}
//for saving the photo as a full size image
private File createImageFile() throws IOException {
// Create an image file name
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String imageFileName = "JPEG_" + timeStamp + "_";
File storageDir = Objects.requireNonNull(getActivity()).getExternalFilesDir(Environment.DIRECTORY_PICTURES);
File image = File.createTempFile(
imageFileName, /* prefix */
".jpg", /* suffix */
storageDir /* directory */
);
// Save a file: path for use with ACTION_VIEW intents
// String currentPhotoPath = image.getAbsolutePath();
return image;
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {
/* Bundle extras = data.getExtras();
assert extras != null;
Bitmap imageBitmap = (Bitmap) Objects.requireNonNull(extras).get("data");
myThumbnail.setImageBitmap(imageBitmap);*/
myBitmap = BitmapFactory.decodeFile(photoFile.getAbsolutePath());
myThumbnail.setImageBitmap(myBitmap);
submit.setVisibility(View.VISIBLE);
}
}
public static byte[] getBitmapAsByteArray(Bitmap bitmap) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 0, outputStream);
return outputStream.toByteArray();
}
public String getPatientID() {
SharedPreferences sharedPref = getActivity().getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE);
String patientID = sharedPref.getString("patientID", "0000");
return patientID;
}
public JSONObject getQuestions() throws JSONException {
SharedPreferences sharedPref = getActivity().getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE);
String questionsList[] = new String[8];
questionsList = getResources().getStringArray(R.array.first_questions_block);
JSONObject mu = new JSONObject();
for (int i = 0; i < questionsList.length; i++) {
Boolean question = sharedPref.getBoolean(questionsList[i], false);
int newIndex = i + 1;
mu.put("question" + newIndex, question);
// Toast.makeText(getActivity().getApplicationContext(), "question "+newIndex+" : "+question, Toast.LENGTH_SHORT).show();
}
return mu;
}
public class imageSender extends AsyncTask<Void, Void, Void> {
private String reqResponse;
@Override
protected void onPreExecute() {
progress = new ProgressDialog(getActivity());
progress.setTitle("Uploading....");
progress.setMessage("Please wait until the process is finished");
progress.setCancelable(false); // disable dismiss by tapping outside of the dialog
progress.show();
}
@Override
protected Void doInBackground(Void... params) {
String realPath = photoFile.getAbsolutePath();
try {
if (isNetworkAvailable()) {
/* try {
JSONObject toSend = getDatabaseContent();
}catch (SQLiteException ex){
ex.getMessage();
}*/
/* try {
sendDBContent(getDatabaseContent());
} catch (Exception ex) {
//set reqReponse as an error
reqResponse = "error";
ex.getMessage();
}*/
//get the patient ID from the shared pref
if (checkIfSomethingInDB() > 0) {
reqResponse = postImage(realPath, true, getDatabaseContent());
//empty the database
deleteDBContent();
checkIfSomethingInDB();
reqResponse = postImage(realPath, false, new JSONObject());
//deleteDBContent();
} else {
reqResponse = postImage(realPath, false, new JSONObject());
}
} else {
//set reqReponse as an error
reqResponse = "error";
//turn the image form bitmap to an array of bytes
//byte[] dataFromPic = getBitmapAsByteArray(myBitmap);
//get the patientID
//Insert in the database
try {
AddData(patientIDRetrievied, realPath, Double.parseDouble(condition), Double.parseDouble(appetite),
Double.parseDouble(volumeMeal),
freeComments,
questions);
//Reinitialize the shared preferences
spReinitialization();
reqResponse = "DB ok";
} catch (Exception e) {
e.getMessage();
}
}
} catch (Exception e) {
e.getMessage();
progress.dismiss();
}
return null;
}
@Override
protected void onPostExecute(Void result) {
progress.dismiss();
if (reqResponse.contains("DB ok")) {
new AlertDialog.Builder(getActivity())
.setIcon(android.R.drawable.ic_dialog_info)
.setTitle("Data saving")
.setMessage("Your data has been saved!")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Objects.requireNonNull(getFragmentManager())
.beginTransaction()
.replace(R.id.fragment_container, new Dashboard())
.commit();
}
}).show();
} else if (reqResponse.contains("success")) {
new AlertDialog.Builder(getActivity())
.setIcon(android.R.drawable.ic_dialog_info)
.setTitle("Data uploading")
.setMessage("Your data has been uploaded!")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Objects.requireNonNull(getFragmentManager())
.beginTransaction()
.replace(R.id.fragment_container, new Dashboard())
.commit();
}
}).show();
} else {
new AlertDialog.Builder(getActivity())
.setIcon(android.R.drawable.ic_dialog_info)
.setTitle("Data uploading")
.setMessage("Oups! An error happened!")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}).show();
}
}
}
public void deleteDBContent() {
try {
myDBHelper.deleteFromDB(patientIDRetrievied);
} catch (Exception e) {
e.getMessage();
}
}
public void spReinitialization() {
SharedPreferences sharedPref = getActivity().getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
//the questions
String fullQuestionsList[] = getResources().getStringArray(R.array.first_questions_block);
for (String question : fullQuestionsList) {
editor.putBoolean(question, false);
}
//the meal quantity, condition and appetite...--not needed because they take a single value
editor.commit();
}
public int checkIfSomethingInDB() {
return myDBHelper.getCount(patientIDRetrievied);
}
public String postImage(String filepath, boolean fromDB, JSONObject parameters) throws Exception {
String UPLOAD_SERVER = getURL(); //"http://210.146.64.139:8080/MealRecorder/save_file";
HttpURLConnection connection;
DataOutputStream outputStream;
InputStream inputStream;
//int patientID=00001;
String dashes = "-----------------------------";
String boundary = Long.toString(System.currentTimeMillis());
StringBuffer response = new StringBuffer();
//Initializing
URL url = new URL(UPLOAD_SERVER);
connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setUseCaches(false);
connection.setConnectTimeout(1000 * 15);
connection.setRequestMethod("POST");
connection.setRequestProperty("Connection", "Keep-Alive");
connection.setRequestProperty("User-Agent", "Android Multipart HTTP Client 1.0");
connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + dashes + boundary);
//Initializing x
outputStream = new DataOutputStream(connection.getOutputStream());
if (!fromDB) {
int bytesRead, bytesAvailable, bufferSize;
byte[] buffer;
String[] q = filepath.split("/");
int idx = q.length - 1;
File imageFile = new File(filepath);
FileInputStream fileInputStream = new FileInputStream(imageFile);
//hereYYYYYYYYYYYYYYYYYYYYYYYY
//hereXXXXXXXXXXXXXXXXXXXXXXXXXX
outputStream.writeBytes("--" + dashes + boundary + "\r\n");
outputStream.writeBytes("Content-Disposition: form-data; name=\"" + "imageFile" + "\"; filename=\"" + q[idx] + "\"" + "\r\n");
outputStream.writeBytes("Content-Type: image/jpeg" + "\r\n");
//outputStream.writeBytes("Content-Transfer-Encoding: binary" + "\r\n");
outputStream.writeBytes("\r\n");
bytesAvailable = fileInputStream.available();
bufferSize = Math.min(bytesAvailable, 1048576);
buffer = new byte[bufferSize];
bytesRead = fileInputStream.read(buffer, 0, bufferSize);
while (bytesRead > 0) {
outputStream.write(buffer, 0, bufferSize);
bytesAvailable = fileInputStream.available();
bufferSize = Math.min(bytesAvailable, 1048576);
bytesRead = fileInputStream.read(buffer, 0, bufferSize);
}
outputStream.writeBytes("\r\n");
outputStream.writeBytes("--" + dashes + boundary + "\r\n");
// outputStream.writeBytes("patientID="+String.valueOf(patientID));
//Map<String, String> params = new HashMap<>(2);
//params.put("patientID", "00002");
// params.put("bar", caption);
//JSONObject parameters = new JSONObject();
parameters.put("Patient_ID", patientIDRetrievied);
//retrieve the data from the shared preferences
parameters.put("appetite", appetite);
parameters.put("condition", condition);
parameters.put("volume_meal", volumeMeal);
parameters.put("free_comments", freeComments);
parameters.put("datetime", new Timestamp(new Date().getTime()));
for (Map.Entry<String, String> entry : questions.entrySet()) {
parameters.put(entry.getKey(), entry.getValue());
}
} else {
//get the image file path from the non empty json object
String imageFilePath = parameters.getString("photo");
int bytesRead, bytesAvailable, bufferSize;
byte[] buffer;
String[] q = filepath.split("/");
int idx = q.length - 1;
File imageFile = new File(imageFilePath);
FileInputStream fileInputStream = new FileInputStream(imageFile);
//
outputStream.writeBytes("--" + dashes + boundary + "\r\n");
outputStream.writeBytes("Content-Disposition: form-data; name=\"" + "imageFile" + "\"; filename=\"" + q[idx] + "\"" + "\r\n");
outputStream.writeBytes("Content-Type: image/jpeg" + "\r\n");
outputStream.writeBytes("\r\n");
bytesAvailable = fileInputStream.available();
bufferSize = Math.min(bytesAvailable, 1048576);
buffer = new byte[bufferSize];
bytesRead = fileInputStream.read(buffer, 0, bufferSize);
while (bytesRead > 0) {
outputStream.write(buffer, 0, bufferSize);
bytesAvailable = fileInputStream.available();
bufferSize = Math.min(bytesAvailable, 1048576);
bytesRead = fileInputStream.read(buffer, 0, bufferSize);
}
outputStream.writeBytes("\r\n");
outputStream.writeBytes("--" + dashes + boundary + "\r\n");
///
// parameters = getDatabaseContent();
}
outputStream.writeBytes("Content-Disposition: form-data; name=\"parameters\"" + "\r\n");
outputStream.writeBytes("\r\n" + parameters.toString());
outputStream.writeBytes("\r\n" + "--" + dashes + boundary + "--" + "\r\n");
inputStream = connection.getInputStream();
int status = connection.getResponseCode();
if (status == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
response.append("success");
inputStream.close();
connection.disconnect();
//fileInputStream.close();
outputStream.flush();
outputStream.close();
} else {
response = new StringBuffer();
response.append("error");
}
return response.toString();
}
//for saving in the database
public void AddData(String xPatientId, String xPhoto, double xCondition, double xAppetite, double xVolume_meal,
String xFreeComments, Map<String, String> xQuestions) {
myDBHelper.addData(
xPatientId,
xPhoto,
xCondition,
xAppetite,
xVolume_meal,
xFreeComments,
xQuestions
);
}
//Called when there is a valid internet connection, right before sending anything in it
public JSONObject getDatabaseContent() {
Cursor data = myDBHelper.getData(patientIDRetrievied);
JSONObject myData = new JSONObject();
while (data.moveToNext()) {
try {
myData.put(data.getColumnName(0), data.getString(0));
myData.put(data.getColumnName(1), data.getString(1));
myData.put(data.getColumnName(2), data.getString(2));
myData.put(data.getColumnName(3), data.getString(3));
myData.put(data.getColumnName(4), data.getString(4));
myData.put(data.getColumnName(5), data.getString(5));
myData.put(data.getColumnName(6), data.getString(6));
myData.put(data.getColumnName(7), data.getString(7));
myData.put(data.getColumnName(8), data.getString(8));
myData.put(data.getColumnName(9), data.getString(9));
myData.put(data.getColumnName(10), data.getString(10));
myData.put(data.getColumnName(11), data.getString(11));
myData.put(data.getColumnName(12), data.getString(12));
myData.put(data.getColumnName(13), data.getString(13));
myData.put(data.getColumnName(14), data.getString(14));
} catch (JSONException e) {
e.printStackTrace();
}
}
return myData;
}
public String getURL(){
SharedPreferences sharedPref = getActivity().getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE);
String desURL = sharedPref.getString("destinationURL", "no url");
return desURL;
}
public String sendDBContent(JSONObject whatToSend) throws IOException {
StringBuffer response;
if (whatToSend.length() > 0) {
//call postImage with a true bool parameter
try {
postImage(new String(), true, whatToSend);
} catch (Exception e) {
e.printStackTrace();
}
String UPLOAD_SERVER = "http://210.146.64.139:8080/MealRecorder/save_file";
HttpURLConnection connection;
DataOutputStream outputStream;
InputStream inputStream;
String dashes = "-----------------------------";
String boundary = Long.toString(System.currentTimeMillis());
URL url = new URL(UPLOAD_SERVER);
connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setUseCaches(false);
connection.setConnectTimeout(1000 * 15);
connection.setRequestMethod("POST");
connection.setRequestProperty("Connection", "Keep-Alive");
// connection.setRequestProperty("User-Agent", "Android Multipart HTTP Client 1.0");
//connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + dashes + boundary);
//connection.setRequestProperty("Content-Type", "application/json; utf-8");
//connection.setRequestProperty("Accept", "application/json");
outputStream = new DataOutputStream(connection.getOutputStream());
outputStream.writeBytes("Content-Disposition: form-data; name=\"parameters\"" + "\r\n");
outputStream.writeBytes("\r\n" + whatToSend.toString());
//byte[] input = whatToSend.toString().getBytes("utf-8");
//outputStream.write(input, 0, input.length);
outputStream.writeBytes("\r\n" + "--" + dashes + boundary + "--" + "\r\n");
inputStream = connection.getInputStream();
int status = connection.getResponseCode();
if (status == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
response.append("success");
inputStream.close();
connection.disconnect();
outputStream.flush();
outputStream.close();
} else {
response = new StringBuffer();
response.append("error");
}
} else {
response = new StringBuffer();
response.append("empty");
}
return response.toString();
}
} | [
"sergeijohnny@gmail.com"
] | sergeijohnny@gmail.com |
541f25306be27f3bcce9f3a9c8af3bd1d98024c2 | 097df92ce1bfc8a354680725c7d10f0d109b5b7d | /com/amazon/ws/emr/hadoop/fs/shaded/com/amazonaws/services/kms/model/transform/AliasListEntryJsonUnmarshaller.java | cc93124b519e9cb42910a19ffc501f076169128f | [] | no_license | cozos/emrfs-hadoop | 7a1a1221ffc3aa8c25b1067cf07d3b46e39ab47f | ba5dfa631029cb5baac2f2972d2fdaca18dac422 | refs/heads/master | 2022-10-14T15:03:51.500050 | 2022-10-06T05:38:49 | 2022-10-06T05:38:49 | 233,979,996 | 2 | 2 | null | 2022-10-06T05:41:46 | 2020-01-15T02:24:16 | Java | UTF-8 | Java | false | false | 2,691 | java | package com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.services.kms.model.transform;
import com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.services.kms.model.AliasListEntry;
import com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.transform.JsonUnmarshallerContext;
import com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.transform.Unmarshaller;
import com.amazon.ws.emr.hadoop.fs.shaded.com.fasterxml.jackson.core.JsonToken;
public class AliasListEntryJsonUnmarshaller
implements Unmarshaller<AliasListEntry, JsonUnmarshallerContext>
{
private static AliasListEntryJsonUnmarshaller instance;
public AliasListEntry unmarshall(JsonUnmarshallerContext context)
throws Exception
{
AliasListEntry aliasListEntry = new AliasListEntry();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null) {
token = context.nextToken();
}
if (token == JsonToken.VALUE_NULL) {
return null;
}
while (token != null)
{
if ((token == JsonToken.FIELD_NAME) || (token == JsonToken.START_OBJECT))
{
if (context.testExpression("AliasName", targetDepth))
{
context.nextToken();
aliasListEntry.setAliasName((String)context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("AliasArn", targetDepth))
{
context.nextToken();
aliasListEntry.setAliasArn((String)context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("TargetKeyId", targetDepth))
{
context.nextToken();
aliasListEntry.setTargetKeyId((String)context.getUnmarshaller(String.class).unmarshall(context));
}
}
else
{
if (((token == JsonToken.END_ARRAY) || (token == JsonToken.END_OBJECT)) &&
((context.getLastParsedParentElement() == null) || (context.getLastParsedParentElement().equals(currentParentElement))) &&
(context.getCurrentDepth() <= originalDepth)) {
break;
}
}
token = context.nextToken();
}
return aliasListEntry;
}
public static AliasListEntryJsonUnmarshaller getInstance()
{
if (instance == null) {
instance = new AliasListEntryJsonUnmarshaller();
}
return instance;
}
}
/* Location:
* Qualified Name: com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.services.kms.model.transform.AliasListEntryJsonUnmarshaller
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"Arwin.tio@adroll.com"
] | Arwin.tio@adroll.com |
19d984a6e60c8d66809d26a822d53cc4877c2e70 | 26a43a7bdea69efb2479d5bdedef72db64614aff | /src/main/java/com/jsan/mvc/adapter/StrictSimpleRestMappingAdapter.java | dac44b565b41591109148444f74d702971620139 | [] | no_license | rihillver/jsan | e053f0893bb63040abeb9f3998c20eb2e3afcdf4 | 1baf3c90abe429f07e2744e2e2939435e4a63334 | refs/heads/master | 2022-04-01T10:59:37.073519 | 2022-02-08T07:22:18 | 2022-02-08T07:22:18 | 93,006,737 | 1 | 0 | null | 2020-10-12T20:09:30 | 2017-06-01T02:09:24 | Java | UTF-8 | Java | false | false | 2,635 | java | package com.jsan.mvc.adapter;
import javax.servlet.http.HttpServletRequest;
import com.jsan.mvc.MappingInfo;
import com.jsan.mvc.MvcConfig;
/**
* 严谨的轻度 REST 风格的映射适配器。
* <p>
* 该模式下 URL 的结尾有反斜杠和没有反斜杠将映射到不同的控制器,这种模式的好处在于视图上的链接可以使用相对路径。
*
*/
public class StrictSimpleRestMappingAdapter implements MappingAdapter {
private static final String defaultClassName = "index";
private static final String defaultMethodName = "index";
@Override
public MappingInfo getMappingInfo(MvcConfig config, HttpServletRequest request) {
String uri = request.getRequestURI();
String contextPath = config.getContextPath();
if (contextPath != null && uri.startsWith(contextPath)) {
uri = uri.substring(contextPath.length());
}
String suffix;
int dotIndex = uri.indexOf('.'); // 以点(.)作为区分请求的后缀
if (dotIndex > -1) {
suffix = uri.substring(dotIndex); // 必须在前
uri = uri.substring(0, dotIndex);
} else {
suffix = "";
}
// if (uri.endsWith("/")) { // 如果以 "/" 结尾则去掉结尾的 "/"
// if (uri.length() == 1) {
// uri += defaultMethodName; // 如果 uri 刚好是 "/" ,则加上默认方法名
// } else {
// uri = uri.substring(0, uri.length() - 1);
// }
// }
if (uri.endsWith("/")) { // 如果以 "/" 结尾则加上默认方法
uri += defaultMethodName; // 默认方法名
}
String methodValue = null;
// String methodDelimiter = config.getMethodDelimiter();
// if (methodDelimiter != null) {
// int delimiterIndex = uri.indexOf(methodDelimiter.charAt(0));
// if (delimiterIndex != -1) {
// methodValue = uri.substring(delimiterIndex + 1);
// uri = uri.substring(0, delimiterIndex);
// }else {
// methodValue = defaultMethodName; // 默认方法名
// }
// } else {
// methodValue = request.getParameter(config.getMethodKey());
// if (methodValue == null || methodValue.isEmpty()) {
// methodValue = defaultMethodName; // 默认方法名
// }
// }
String methodDelimiter = "/";
int delimiterIndex = uri.lastIndexOf(methodDelimiter.charAt(0));
if (delimiterIndex > -1) {
methodValue = uri.substring(delimiterIndex + 1);
uri = uri.substring(0, delimiterIndex + 1) + defaultClassName; // 默认类名
}
MappingInfo mappingInfo = new MappingInfo();
mappingInfo.setUri(uri);
mappingInfo.setSuffix(suffix);
mappingInfo.setMethodValue(methodValue);
return mappingInfo;
}
}
| [
"rihillver@163.com"
] | rihillver@163.com |
acf15833d2e368e2125b373367fe41deb4b9984f | 36ada653c8229611acc300300b436ea3139ec0aa | /FeedMeAppStaffAdmin/app/src/main/java/com/danny/feedmeappadminstaff/Remote/APIService.java | 7c0b3418308bdf9552b8b5eeae8066683e9ecbf7 | [] | no_license | Mamata2507/G03_39-FEED-ME-APP-STAFF-ADMIN | faaa7f1eaba6041193548d5e4b05f6cdac0cb839 | 8667fd4afea99e26b8aae448097f2d299e427252 | refs/heads/master | 2023-03-16T03:00:25.331474 | 2020-10-09T11:01:32 | 2020-10-09T11:01:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 79 | java | package com.danny.feedmeappadminstaff.Remote;
public interface APIService {
}
| [
"wanmohddanialhakim@gmail.com"
] | wanmohddanialhakim@gmail.com |
855b92f2af7d318790bdcc96192ca9167a822463 | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/tencent/mm/plugin/wallet_index/c/g.java | 8f33bc400d91caabbd214a8d208b249a80860dc1 | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 2,823 | java | package com.tencent.mm.plugin.wallet_index.c;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ai.b;
import com.tencent.mm.ai.b.a;
import com.tencent.mm.ai.b.b;
import com.tencent.mm.ai.f;
import com.tencent.mm.network.q;
import com.tencent.mm.opensdk.modelpay.PayReq;
import com.tencent.mm.plugin.wallet_core.model.k;
import com.tencent.mm.protocal.protobuf.bin;
import com.tencent.mm.protocal.protobuf.bio;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.wallet_core.c.i;
import com.tencent.mm.wallet_core.c.u;
public class g extends u
implements i
{
public b ehh;
private f ehi;
public g(PayReq paramPayReq, String paramString1, String paramString2, String paramString3, String paramString4)
{
AppMethodBeat.i(48187);
Object localObject = new b.a();
((b.a)localObject).fsJ = new bin();
((b.a)localObject).fsK = new bio();
((b.a)localObject).uri = getUri();
((b.a)localObject).fsI = getType();
((b.a)localObject).fsL = 188;
((b.a)localObject).fsM = 1000000188;
((b.a)localObject).fsO = com.tencent.mm.wallet_core.ui.e.atB(paramPayReq.prepayId);
this.ehh = ((b.a)localObject).acD();
localObject = (bin)this.ehh.fsG.fsP;
((bin)localObject).fKh = paramPayReq.appId;
((bin)localObject).wLU = paramPayReq.partnerId;
((bin)localObject).wlb = paramPayReq.prepayId;
((bin)localObject).vYO = paramPayReq.nonceStr;
((bin)localObject).wLV = paramPayReq.timeStamp;
((bin)localObject).vYP = paramPayReq.packageValue;
((bin)localObject).vYQ = paramPayReq.sign;
((bin)localObject).vYR = paramPayReq.signType;
((bin)localObject).wLW = paramString1;
((bin)localObject).mZu = paramString2;
((bin)localObject).ncH = paramString3;
((bin)localObject).vRP = k.cPy();
((bin)localObject).wLY = paramString4;
AppMethodBeat.o(48187);
}
public final int a(com.tencent.mm.network.e parame, f paramf)
{
AppMethodBeat.i(48188);
this.ehi = paramf;
int i = a(parame, this.ehh, this);
AppMethodBeat.o(48188);
return i;
}
public final void e(int paramInt1, int paramInt2, String paramString, q paramq)
{
AppMethodBeat.i(48189);
ab.d("MicroMsg.NetScenePayAuthApp", "errType:" + paramInt1 + ",errCode:" + paramInt2 + ",errMsg" + paramString);
this.ehi.onSceneEnd(paramInt1, paramInt2, paramString, this);
AppMethodBeat.o(48189);
}
public int getType()
{
return 397;
}
public String getUri()
{
return "/cgi-bin/mmpay-bin/payauthapp";
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes8-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.wallet_index.c.g
* JD-Core Version: 0.6.2
*/ | [
"172601673@qq.com"
] | 172601673@qq.com |
50c8f0177b29a13440d135ba605bbc469b96ef80 | 6cd22ce8aadd4d58af83db29c15946baf1ffebf8 | /src/main/java/com/shubham/dataStructures/ddArray/NQueens.java | 6f9609e7335a19f529b20c6e42d85193eb400b9e | [] | no_license | shubhm-agrwl/dataStructures-algorithms | b095ab3a297f565c27fdb12af5d8c468384ef09d | 726631159746d79a54e72a19c8cccd49e64fc821 | refs/heads/master | 2021-06-23T09:28:51.828025 | 2021-06-15T23:04:53 | 2021-06-15T23:04:53 | 225,211,919 | 1 | 0 | null | 2020-10-13T17:53:17 | 2019-12-01T18:53:23 | Java | UTF-8 | Java | false | false | 2,117 | java | package com.shubham.dataStructures.ddArray;
import java.util.ArrayList;
import java.util.List;
public class NQueens {
int rows[];
// "hill" diagonals
int hills[];
// "dale" diagonals
int dales[];
int n;
// output
List<List<String>> output = new ArrayList();
// queens positions
int queens[];
public boolean isNotUnderAttack(int row, int col) {
int res = rows[col] + hills[row - col + 2 * n] + dales[row + col];
return (res == 0) ? true : false;
}
public void placeQueen(int row, int col) {
queens[row] = col;
rows[col] = 1;
hills[row - col + 2 * n] = 1; // "hill" diagonals
dales[row + col] = 1; //"dale" diagonals
}
public void removeQueen(int row, int col) {
queens[row] = 0;
rows[col] = 0;
hills[row - col + 2 * n] = 0;
dales[row + col] = 0;
}
public void addSolution() {
List<String> solution = new ArrayList<String>();
for (int i = 0; i < n; ++i) {
int col = queens[i];
StringBuilder sb = new StringBuilder();
for (int j = 0; j < col; ++j) {
sb.append(".");
}
sb.append("Q");
for (int j = 0; j < n - col - 1; ++j) {
sb.append(".");
}
solution.add(sb.toString());
}
output.add(solution);
}
public void backtrack(int row) {
for (int col = 0; col < n; col++) {
if (isNotUnderAttack(row, col)) {
placeQueen(row, col);
// if n queens are already placed
if (row + 1 == n) {
addSolution();
}
// if not proceed to place the rest
else {
backtrack(row + 1);
}
// backtrack
removeQueen(row, col);
}
}
}
public List<List<String>> solveNQueens(int n) {
this.n = n;
rows = new int[n];
hills = new int[4 * n - 1];
dales = new int[2 * n - 1];
queens = new int[n];
backtrack(0);
return output;
}
public int totalNQueens(int n) {
this.n = n;
rows = new int[n];
hills = new int[4 * n - 1];
dales = new int[2 * n - 1];
queens = new int[n];
backtrack(0);
return output.size();
}
}
| [
"agrawalshubham1103@gmail.com"
] | agrawalshubham1103@gmail.com |
56c2d5cbfcf0b3bbd60e3dde1864f2139e6b3772 | 9c5a122b877b7b22680b913fe25cf26e315ff954 | /src/main/java/it/polito/ezshop/data/ReturnTransaction.java | 58a692472c7439f2e717ed48aca1251e092bebd3 | [] | no_license | GigSam/EzSoftware1 | 3ebc8f3e696ae5dd944536eeff6566296613d819 | 4964387e014ee37faebf3db1d18e9a003903facf | refs/heads/main | 2023-08-24T10:33:08.324501 | 2021-11-04T11:32:52 | 2021-11-04T11:32:52 | 424,566,738 | 0 | 0 | null | 2021-11-04T11:25:54 | 2021-11-04T11:15:10 | null | UTF-8 | Java | false | false | 486 | java | package it.polito.ezshop.data;
import java.time.LocalDate;
import java.util.Map;
public interface ReturnTransaction {
Integer getReturnId();
void setReturnId(Integer balanceId);
Map<ProductType, Integer> getReturnedProduct();
void setReturnedProduct(Map<ProductType,Integer> returnedProduct) ;
SaleTransaction getSaleTransaction();
void setSaleTransaction(SaleTransaction saleTransaction);
String getStatus() ;
void setStatus(String status);
}
| [
"s290156@studenti.polito.it"
] | s290156@studenti.polito.it |
caa78c6d0f073a79d0ae5939536b49b58ef56a79 | d8baa628c94de379f916f711f0a5fc8076674da6 | /src/main/java/com/fuelfinder/model/User.java | cc810c1d4ec3953c360c73ce24f49fe6dc4399c7 | [] | no_license | saifalam/FuelFinderService | 7b61eb4161abcae5335c2dc9374372a221b55f66 | f477975b657a8efd9f19b8744a712a0db923b412 | refs/heads/master | 2020-03-21T11:06:09.016123 | 2017-12-05T20:26:44 | 2017-12-05T20:26:44 | 135,369,409 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 960 | java | package com.fuelfinder.model;
import java.io.Serializable;
import javax.persistence.*;
@Entity
public class User implements Serializable {
@Id
@GeneratedValue
private Long id;
private String accessToken;
private String firstname;
private String lastname;
private String email;
public User() {
}
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
} | [
"nikson_kanti.paul@mailbox.tu-dresden.de"
] | nikson_kanti.paul@mailbox.tu-dresden.de |
fe37b3b7d692ea563aa2b0daacbef83f13943635 | 687aa03dcd89ad493e69a610e52fbb37c002e440 | /app/src/main/java/com/xzy/forestSystem/gogisapi/IOData/DXF/pojo/Writer.java | e05ab9c9c1848965f1616c2d2a5d8b3d62825943 | [] | no_license | liner0211/STFby-Android | b1fc4412b01394f6cd2e6f8905fc8acd6507435c | f7b0f448263a4d5bac5c2dcd4dc9b9a0b1628cfc | refs/heads/master | 2023-05-06T02:41:19.719147 | 2021-05-31T07:12:06 | 2021-05-31T07:12:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,235 | java | package com.xzy.forestSystem.gogisapi.IOData.DXF.pojo;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
public class Writer {
public static void Write(Document d, OutputStream s) throws IOException {
OutputStreamWriter sr = new OutputStreamWriter(s);
WriteHeader(d.header, sr);
WriteTables(d.tables, sr);
WriteBlocks(d.blocks, sr);
WriteEntities(d.entities, sr);
WriteData(new Data(0, "EOF"), sr);
sr.close();
}
private static void WriteHeader(Header h, OutputStreamWriter sr) throws IOException {
if (h != null) {
WriteElement(h, sr);
}
}
private static void WriteEntities(Entities e, OutputStreamWriter sr) throws IOException {
if (e != null) {
WriteElement(e, sr);
}
}
private static void WriteBlocks(Blocks b, OutputStreamWriter sr) throws IOException {
if (b != null) {
WriteElement(b, sr);
}
}
private static void WriteTables(Tables t, OutputStreamWriter sr) throws IOException {
if (t != null) {
WriteElement(t, sr);
}
}
private static void WriteElement(Element e, OutputStreamWriter sr) throws IOException {
if (e != null) {
if (e.f500s != null) {
sr.write(e.f500s);
return;
}
WriteData(e.startTag, sr);
for (int i = 0; i < e.DataCount(); i++) {
WriteData(e.GetData(i), sr);
}
for (int i2 = 0; i2 < e.ElementCount(); i2++) {
WriteElement(e.GetElement(i2), sr);
}
WriteData(e.endTag, sr);
}
}
private static void WriteData(Data d, OutputStreamWriter sr) throws IOException {
if (d.code != -10) {
sr.write(new StringBuilder(String.valueOf(d.code)).toString());
sr.write("\n");
if (d.data instanceof String) {
sr.write(((String) d.data).toString());
} else {
sr.write(new StringBuilder(String.valueOf(d.data.toString())).toString());
}
sr.write("\n");
}
}
}
| [
"czhgithub.com"
] | czhgithub.com |
db1211eb1460dc0ae2c8ebbde74dd942de25ad5c | 4016885f4c8e4c8738d41e24eb882aebd913abe7 | /src/main/java/tech/sqlclub/common/net/ByteUnit.java | 9d4dabd9b6833b8cf0d117950ae8cf691870fa62 | [] | no_license | bebee4java/common-utils | a27ddd77e2af56730edab2a256f13b9266399f90 | 02844e604bc15a5953956ad1575305369e19c17f | refs/heads/master | 2023-06-25T09:24:02.976360 | 2023-06-12T16:10:09 | 2023-06-12T16:10:09 | 230,719,240 | 0 | 1 | null | 2022-12-14T20:43:19 | 2019-12-29T07:42:04 | Scala | UTF-8 | Java | false | false | 1,868 | java | package tech.sqlclub.common.net;
/**
* 字节单位处理
* 参考 org.apache.spark.network.util.ByteUnit
* Created by songgr on 2022/02/22.
*/
public enum ByteUnit {
BYTE(1),
KiB(1L << 10),
MiB(1L << 20),
GiB(1L << 30),
TiB(1L << 40),
PiB(1L << 50);
ByteUnit(long multiplier) {
this.multiplier = multiplier;
}
// Interpret the provided number (d) with suffix (u) as this unit type.
// E.g. KiB.interpret(1, MiB) interprets 1MiB as its KiB representation = 1024k
public long convertFrom(long d, ByteUnit u) {
return u.convertTo(d, this);
}
// Convert the provided number (d) interpreted as this unit type to unit type (u).
public long convertTo(long d, ByteUnit u) {
if (multiplier > u.multiplier) {
long ratio = multiplier / u.multiplier;
if (Long.MAX_VALUE / ratio < d) {
throw new IllegalArgumentException("Conversion of " + d + " exceeds Long.MAX_VALUE in "
+ name() + ". Try a larger unit (e.g. MiB instead of KiB)");
}
return d * ratio;
} else {
// Perform operations in this order to avoid potential overflow
// when computing d * multiplier
return d / (u.multiplier / multiplier);
}
}
public long toBytes(long d) {
if (d < 0) {
throw new IllegalArgumentException("Negative size value. Size must be positive: " + d);
}
return d * multiplier;
}
public long toKiB(long d) { return convertTo(d, KiB); }
public long toMiB(long d) { return convertTo(d, MiB); }
public long toGiB(long d) { return convertTo(d, GiB); }
public long toTiB(long d) { return convertTo(d, TiB); }
public long toPiB(long d) { return convertTo(d, PiB); }
private final long multiplier;
}
| [
"grsong.cn@gmail.com"
] | grsong.cn@gmail.com |
24b95364c4994a08c73f49cff09f0415bbeadf1d | 02372f8a6bde7e78b61ae418d6f91abf7c03a24b | /APT/ioc-compiler/src/main/java/com/example/DIProcessor.java | 5dfd4968b382481fcd84eac2fd2dc17e57a29218 | [] | no_license | whyalwaysmea/AndroidDemos | b5622b791789b28158017c9a8de9d0e9d3258d0c | 38aa0c43ab0870f981bbe67faf0320eca0c1a7c6 | refs/heads/master | 2020-12-01T17:57:09.646925 | 2017-08-01T10:02:37 | 2017-08-01T10:02:37 | 67,411,667 | 35 | 16 | null | null | null | null | UTF-8 | Java | false | false | 3,828 | java | package com.example;
import com.google.auto.service.AutoService;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Filer;
import javax.annotation.processing.Messager;
import javax.annotation.processing.ProcessingEnvironment;
import javax.annotation.processing.Processor;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;
/**
* Created by Long
* on 2017/1/13.
*/
@AutoService(Processor.class)
public class DIProcessor extends AbstractProcessor {
private Filer mFileUtils;
private Elements mElementUtils;
private Messager mMessager;
private static class TypeUtil {
static final ClassName BINDER = ClassName.get("com.whyalwaysmea.ioc_api", "ViewBinder");
static final ClassName PROVIDER = ClassName.get("com.whoislcj.appapi", "ViewFinder");
}
@Override
public Set<String> getSupportedAnnotationTypes() {
return Collections.singleton(DIActivity.class.getCanonicalName());
}
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
System.out.println("DIProcessor");
Set<? extends Element> elements = roundEnv.getElementsAnnotatedWith(DIActivity.class);
for (Element element : elements) {
// 判断是否Class
TypeElement typeElement = (TypeElement) element;
List<? extends Element> members = mElementUtils.getAllMembers(typeElement);
MethodSpec.Builder bindViewMethodSpecBuilder = MethodSpec.methodBuilder("bindView")
.addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.returns(TypeName.VOID)
.addParameter(ClassName.get(typeElement.asType()), "activity");
for (Element item : members) {
DIView diView = item.getAnnotation(DIView.class);
if (diView == null){
continue;
}
bindViewMethodSpecBuilder.addStatement(String.format("activity.%s = (%s) activity.findViewById(%s)",item.getSimpleName(),ClassName.get(item.asType()).toString(),diView.value()));
}
TypeSpec typeSpec = TypeSpec.classBuilder(element.getSimpleName() + "$$ViewBinder")
.addModifiers(Modifier.PUBLIC, Modifier.FINAL)
.addSuperinterface(ParameterizedTypeName.get(TypeUtil.BINDER, TypeName.get(typeElement.asType())))
.addMethod(bindViewMethodSpecBuilder.build())
.build();
JavaFile javaFile = JavaFile.builder(getPackageName(typeElement), typeSpec).build();
try {
javaFile.writeTo(processingEnv.getFiler());
} catch (IOException e) {
e.printStackTrace();
}
}
return true;
}
private String getPackageName(TypeElement type) {
return mElementUtils.getPackageOf(type).getQualifiedName().toString();
}
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
super.init(processingEnv);
mElementUtils = processingEnv.getElementUtils();
}
@Override
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.RELEASE_7;
}
}
| [
"404402223@qq.com"
] | 404402223@qq.com |
39449dd29ad92b844beb8fb59ed9ad44952e7a4d | 9c3c82c0f675bd015c501c0fd52821a96fc127ec | /src/main/java/com/majia/classloader/breakparentclassloader/SimpleObject.java | 86b801b3c12927764c62869bf3dbab762464a57a | [] | no_license | majia666/multi-threads | f65d94c4eac2bbaf51156a30946676d3f0881cb5 | bfade3c0fdd7af14d12c2125e192824c035d1b37 | refs/heads/master | 2022-01-13T06:51:53.795081 | 2021-12-28T15:12:37 | 2021-12-28T15:12:37 | 247,425,358 | 0 | 0 | null | 2020-10-13T20:22:12 | 2020-03-15T08:05:22 | Java | UTF-8 | Java | false | false | 85 | java | package com.majia.classloader.breakparentclassloader;
public class SimpleObject {
}
| [
"614640021@qq.com"
] | 614640021@qq.com |
09571e9f5db75e670caadbd52544c46195c2dd5c | f1e6f042df22f398d785f6820ba54afa0e18fd40 | /src/main/java/com/akshay/jenkins/App.java | 5cf69438f2db97a7bdc0c0ffa58799b20bc93dcf | [] | no_license | akshyapurohit/jenkins | 6e5600f575f301c361dee4296ad3ef4ced25c8f9 | 2cef5605a71ccfe2649db3091b1a535cd551b560 | refs/heads/master | 2021-10-16T08:27:13.871249 | 2019-02-09T13:12:37 | 2019-02-09T13:12:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 268 | java | package com.akshay.jenkins;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println(sample());
}
public static String sample() {
return "Hello World!";
}
}
| [
"noreply@github.com"
] | akshyapurohit.noreply@github.com |
4f2e8964222ca038e976967637a7eac7a9c82b2c | 5ef9541a27d60327076134941d262aa25e80a990 | /berbon-owner-facade/src/test/java/berbon/owner/facade/AppTest.java | dc618b9a287bfb656445e6f8f7aff7381b894415 | [] | no_license | baijt/myproj | 1dededcd435b3573c02fa9255f8b47f8d29fd1b8 | 7a08dface757da09cbce2d930c5a04eeefe0f4ca | refs/heads/master | 2016-09-14T10:26:57.843822 | 2016-05-11T03:01:13 | 2016-05-11T03:01:13 | 57,288,009 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 647 | java | package berbon.owner.facade;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
| [
"317347607@qq.com"
] | 317347607@qq.com |
294449dbe7a444a446c940117745f5345b08db70 | d3f18f9820832c8d44ca2fa45425275d27d58bb3 | /okex-api/src/main/java/com/kevin/gateway/okexapi/swap/model/SwapPlaceAlgoOrderRequest.java | 739f47f7bbe31a8610f5e98d2be325ba92a97a33 | [] | no_license | ssh352/exchange-gateway | e5c1289e87184e68b1b2bcf01ffa07c53269437f | ecccf6aa1a42b3fe576fccb01f5939dcf4cae25d | refs/heads/master | 2023-05-06T01:24:25.062703 | 2021-06-03T02:44:35 | 2021-06-03T02:44:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,482 | java | package com.kevin.gateway.okexapi.swap.model;
import com.kevin.gateway.okexapi.future.type.OpenCloseLongShortType;
import com.kevin.gateway.okexapi.spot.model.SpotPlaceAlgoType;
import com.kevin.gateway.okexapi.swap.SwapMarketId;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.math.BigDecimal;
/**
* 策略委托下单参数实体
*/
@Data
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "order_type"
)
@JsonSubTypes({
@JsonSubTypes.Type(value = SwapPlaceAlgoOrderRequest.SwapPlaceAlgoTriggerOrderRequest.class, name = "1"),
@JsonSubTypes.Type(value = SwapPlaceAlgoOrderRequest.SwapPlaceAlgoTrailOrderRequest.class, name = "2"),
@JsonSubTypes.Type(value = SwapPlaceAlgoOrderRequest.SwapPlaceAlgoIcebergOrderRequest.class, name = "3"),
@JsonSubTypes.Type(value = SwapPlaceAlgoOrderRequest.SwapPlaceAlgoTwapOrderRequest.class, name = "4"),
@JsonSubTypes.Type(value = SwapPlaceAlgoOrderRequest.SwapPlaceAlgoFullStopOrderRequest.class, name = "5")
})
public class SwapPlaceAlgoOrderRequest {
/**
* 合约
*/
private SwapMarketId instrumentId;
/**
* 1:开多
* 2:开空
* 3:平多
* 4:平空
*/
private OpenCloseLongShortType type;
//1:计划委托
//2:跟踪委托
//3:冰山委托
//4:时间加权
//5:止盈止损
/* @JsonProperty(value = "order_type")
private String orderType;*/
/**
* 委托总数,填写值1\<=X\<=1000000的整数
*/
private BigDecimal size;
/**
* 计划委托参数
*/
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Data
public static class SwapPlaceAlgoTriggerOrderRequest extends SwapPlaceAlgoOrderRequest {
/**
* 触发价格,填写值0\<X\<=1000000
* 跟踪委托参数: 激活价格 ,填写值0\<X\<=1000000
*/
private BigDecimal triggerPrice;
/**
* 委托价格,填写值0\<X\<=1000000
*/
private BigDecimal algoPrice;
/**
* 1:限价 2:市场价;触发价格类型,默认是1:限价,为2:市场价时,委托价格不必填;
*/
private SpotPlaceAlgoType algoType;
}
/**
* 跟踪委托参数
*/
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Data
public static class SwapPlaceAlgoTrailOrderRequest extends SwapPlaceAlgoOrderRequest {
/**
* 激活价格 ,填写值0\<X\<=1000000
*/
private BigDecimal triggerPrice;
/**
* 回调幅度,填写值0.001(0.1%)\<=X\<=0.05(5%)
*/
private BigDecimal callbackRate;
}
/**
* 冰山委托参数(最多同时存在6单)
*/
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Data
public static class SwapPlaceAlgoIcebergOrderRequest extends SwapPlaceAlgoOrderRequest {
/**
* 委托深度,填写值0.0001(0.01%)\<=X\<=0.01(1%)
*/
private BigDecimal algoVariance;
/**
* 单笔均值,填写值 本次委托总量的1/1000\<=X\<=本次委托总量
*/
private BigDecimal avgAmount;
/**
* 价格限制 ,填写值0\<X\<=1000000
*/
private BigDecimal limitPrice;
}
/**
* 时间加权参数(最多同时存在6单)
*/
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Data
public static class SwapPlaceAlgoTwapOrderRequest extends SwapPlaceAlgoOrderRequest {
/**
* 扫单范围,填写值0.005(0.5%)\<=X\<=0.01(1%)
*/
private BigDecimal sweepRange;
/**
* 扫单比例,填写值 0.01\<=X\<=1
*/
private BigDecimal sweepRatio;
/**
* 单笔上限,填写值 本次委托总量的1/1000\<=X\<=本次委托总量
*/
private BigDecimal singleLimit;
/**
* 价格限制 ,填写值0\<X\<=1000000
*/
private BigDecimal limitPrice;
/**
* 委托间隔,填写值5\<=X\<=120
*/
private BigDecimal timeInterval;
}
/**
* 止盈止损参数
*/
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Data
public static class SwapPlaceAlgoFullStopOrderRequest extends SwapPlaceAlgoOrderRequest {
/**
* 止盈触发价格,填写值0\<X\<=1000000
*/
private BigDecimal tpTriggerPrice;
/**
* 止盈委托价格,填写值0\<X\<=1000000
*/
private BigDecimal tpPrice;
/**
* 1:限价 2:市场价;止盈触发价格类型,默认是限价;为市场价时,委托价格不必填;
*/
private SpotPlaceAlgoType tpTriggerType;
/**
* 1:限价 2:市场价;止损触发价格类型,默认是限价;为市场价时,委托价格不必填;
*/
private SpotPlaceAlgoType slTriggerType;
/**
* 止损触发价格,填写值0\<X\<=1000000
*/
private BigDecimal slTriggerPrice;
/**
* 止损委托价格,填写值0\<X\<=1000000
*/
private BigDecimal slPrice;
}
}
| [
"kevinchen19888@163.com"
] | kevinchen19888@163.com |
67debcf308a2ff4c2da5885dbc809ccff80a5392 | 8262f80de83852537c79a0abbf0b722e38d540df | /src/main/java/com/maycon/coursomc/CursomcApplication.java | aa1ff6964767e469d3305788875f9aaece5d1cbb | [] | no_license | mayconjovan/cursomc | 6ca07ce631e0edeea89f3f2edc602a27c2f2e180 | 7a23d84039544e82f1a5b53c3eb25893e6f8f056 | refs/heads/master | 2022-12-27T20:15:09.938583 | 2020-10-11T18:11:20 | 2020-10-11T18:11:20 | 302,717,244 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,041 | java | package com.maycon.coursomc;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.maycon.coursomc.domain.Adress;
import com.maycon.coursomc.domain.BilletPayment;
import com.maycon.coursomc.domain.CardPayment;
import com.maycon.coursomc.domain.Category;
import com.maycon.coursomc.domain.City;
import com.maycon.coursomc.domain.Client;
import com.maycon.coursomc.domain.Order;
import com.maycon.coursomc.domain.OrderItem;
import com.maycon.coursomc.domain.Payment;
import com.maycon.coursomc.domain.Product;
import com.maycon.coursomc.domain.State;
import com.maycon.coursomc.domain.enums.StatusPayment;
import com.maycon.coursomc.domain.enums.TypeClient;
import com.maycon.coursomc.repositories.AdressRepository;
import com.maycon.coursomc.repositories.CategoryRepository;
import com.maycon.coursomc.repositories.CityRepository;
import com.maycon.coursomc.repositories.ClientRepository;
import com.maycon.coursomc.repositories.OrderItensRepository;
import com.maycon.coursomc.repositories.OrderRepository;
import com.maycon.coursomc.repositories.PaymentRepository;
import com.maycon.coursomc.repositories.ProductRepository;
import com.maycon.coursomc.repositories.StateRepository;
@SpringBootApplication
public class CursomcApplication implements CommandLineRunner {
@Autowired
private CategoryRepository categoryRepository;
@Autowired
private ProductRepository productRepository;
@Autowired
private StateRepository stateRepository;
@Autowired
private CityRepository cityrepository;
@Autowired
private ClientRepository clientRepository;
@Autowired
private AdressRepository adressRepository;
@Autowired
private OrderRepository orderRepository;
@Autowired
private PaymentRepository paymentRepository;
@Autowired
private OrderItensRepository orderItensRepository;
public static void main(String[] args) {
SpringApplication.run(CursomcApplication.class, args);
}
@Override
public void run(String... args) throws Exception {
Category cat1 = new Category(null, "Informática");
Category cat2 = new Category(null, "Escritório");
Product p1 = new Product(null, "Computador", 2000.00);
Product p2 = new Product(null, "Impressora", 800.00);
Product p3 = new Product(null, "Mouse", 80.00);
cat1.getProducts().addAll(Arrays.asList(p1, p2, p3));
cat2.getProducts().addAll(Arrays.asList(p2));
p1.getCategories().addAll(Arrays.asList(cat1));
p2.getCategories().addAll(Arrays.asList(cat1, cat2));
p3.getCategories().addAll(Arrays.asList(cat1));
categoryRepository.saveAll(Arrays.asList(cat1, cat2));
productRepository.saveAll(Arrays.asList(p1, p2, p3));
State est1 = new State(null, "Minas Gerais");
State est2 = new State(null, "São Paulo");
City c1 = new City(null, "Uberlândia", est1);
City c2 = new City(null, "São Paulo", est2);
City c3 = new City(null, "Campinas", est2);
est1.getCities().addAll(Arrays.asList(c1));
est2.getCities().addAll(Arrays.asList(c2, c3));
stateRepository.saveAll(Arrays.asList(est1, est2));
cityrepository.saveAll(Arrays.asList(c1, c2, c3));
Client cli1 = new Client(null, "Maria Silva", "maria@gmail.com", "9949593845", TypeClient.PESSOAFISICA);
cli1.getPhones().addAll(Arrays.asList("47 3374-0453", "47 9934-9302"));
Adress a1 = new Adress(null, "Rua Flores", "300", "Apto 303", "Jardim", "89238923", cli1, c1);
Adress a2 = new Adress(null, "Avenida Matos", "105", "Sala 800", "Centro", "89340233", cli1, c2);
cli1.getAdress().addAll(Arrays.asList(a1, a2));
clientRepository.saveAll(Arrays.asList(cli1));
adressRepository.saveAll(Arrays.asList(a1, a2));
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm");
Order ord1 = new Order(null, sdf.parse("30/09/2017 10:32"), cli1, a1);
Order ord2 = new Order(null, sdf.parse("10/10/2017 19:35"), cli1, a2);
Payment pay1 = new CardPayment(null, StatusPayment.QUITADO, ord1, 6);
ord1.setPayment(pay1);
Payment pay2 = new BilletPayment(null, StatusPayment.PENDENTE, ord2, sdf.parse("20/10/2017 00:00"), null);
ord2.setPayment(pay2);
cli1.getOrders().addAll(Arrays.asList(ord1, ord2));
orderRepository.saveAll(Arrays.asList(ord1, ord2));
paymentRepository.saveAll(Arrays.asList(pay1, pay2));
OrderItem ordItem1 = new OrderItem(ord1, p1, 0.00, 1, 2000.00);
OrderItem ordItem2 = new OrderItem(ord1, p3, 0.00, 2, 80.00);
OrderItem ordItem3 = new OrderItem(ord2, p2, 100.00, 1, 800.00);
ord1.getOrderItens().addAll(Arrays.asList(ordItem1, ordItem2));
ord2.getOrderItens().addAll(Arrays.asList(ordItem3));
p1.getOrderItens().addAll(Arrays.asList(ordItem1));
p2.getOrderItens().addAll(Arrays.asList(ordItem3));
p3.getOrderItens().addAll(Arrays.asList(ordItem2));
orderItensRepository.saveAll(Arrays.asList(ordItem1, ordItem2, ordItem3));
}
}
| [
"mayconjovan@gmail.com"
] | mayconjovan@gmail.com |
b506a319246c56ee328d47d00a15235482c2f715 | 15e1d11adea4fa288c0087a19db23b70280a7f4a | /src/main/java/com/plus/core/PlusMetadataReader.java | fa87c2929a9e5e283b10e35384274c1ed0f12adb | [] | no_license | wwxname/MyPlus | 8f9a1a0760138badcbc45f4a795636bd82cdb2b3 | 3255d51acdab0b1b819295234c2c4d419c9e8f64 | refs/heads/master | 2020-03-23T17:53:31.058087 | 2018-10-30T09:47:00 | 2018-10-30T09:47:00 | 141,880,143 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,044 | java | package com.plus.core;
import org.springframework.asm.ClassReader;
import org.springframework.core.NestedIOException;
import org.springframework.core.io.Resource;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.core.type.ClassMetadata;
import org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.lang.Nullable;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
public class PlusMetadataReader implements MetadataReader {
private final Resource resource;
private final ClassMetadata classMetadata;
private final AnnotationMetadata annotationMetadata;
public PlusMetadataReader(Resource resource, @Nullable ClassLoader classLoader) throws IOException {
InputStream is = new BufferedInputStream(resource.getInputStream());
ClassReader classReader;
try {
classReader = new ClassReader(is);
}
catch (IllegalArgumentException ex) {
throw new NestedIOException("ASM ClassReader failed to parse class file - " +
"probably due to a new Java class file version that isn't supported yet: " + resource, ex);
}
finally {
is.close();
}
AnnotationMetadataReadingVisitor visitor = new AnnotationMetadataReadingVisitor(classLoader);
classReader.accept(visitor, ClassReader.SKIP_DEBUG);
this.annotationMetadata = visitor;
// (since AnnotationMetadataReadingVisitor extends ClassMetadataReadingVisitor)
this.classMetadata = visitor;
this.resource = resource;
}
@Override
public Resource getResource() {
return this.resource;
}
@Override
public ClassMetadata getClassMetadata() {
return this.classMetadata;
}
@Override
public AnnotationMetadata getAnnotationMetadata() {
return this.annotationMetadata;
}
}
| [
"1074424012@qq.com"
] | 1074424012@qq.com |
dc770bc4672d8f5498b2b3f27fdf7fbcebb691cf | 4e3dd214467e38a639e4a7e893f83b265d2dffc9 | /src/Vistas/Busqueda_PresAct.java | 0f71aababbd3ea81a1b5eebf6bca23bfeab5f9fa | [] | no_license | ArtDugarte/RI_Incret_2.0 | 5a3aa1720fdfdc4d44d5e84cfd8fd0d7f9960ec4 | ef3e00d0c014e303d27f3965b9735407860fd9c6 | refs/heads/master | 2023-04-30T06:00:48.454633 | 2021-05-17T14:25:56 | 2021-05-17T14:25:56 | 368,213,589 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,155 | java | package Vistas;
import Modelos.DesplegableMarca;
import Modelos.DesplegableNombre;
import Modelos.Modelo;
import Modelos.OperarEstudiante;
import Modelos.OperarInstrumento;
import Modelos.OperarNombreInstrumento;
import Modelos.OperarPrestamo;
import java.awt.Toolkit;
import java.awt.event.ItemEvent;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
public class Busqueda_PresAct extends javax.swing.JInternalFrame {
public Busqueda_PresAct() {
initComponents();
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLayeredPane1 = new javax.swing.JLayeredPane();
Base = new javax.swing.JPanel();
BusquedaPresAct = new javax.swing.JPanel();
jLabel108 = new javax.swing.JLabel();
jLabel109 = new javax.swing.JLabel();
jLabel110 = new javax.swing.JLabel();
jLabel111 = new javax.swing.JLabel();
jLabel112 = new javax.swing.JLabel();
jLabel114 = new javax.swing.JLabel();
jLabel115 = new javax.swing.JLabel();
direccionBPA = new javax.swing.JTextField();
cedulaBPA = new javax.swing.JTextField();
nombreEBPA = new javax.swing.JTextField();
apellidoBPA = new javax.swing.JTextField();
numerotlfBPA = new javax.swing.JTextField();
jLabel116 = new javax.swing.JLabel();
jLabel117 = new javax.swing.JLabel();
jLabel118 = new javax.swing.JLabel();
jLabel120 = new javax.swing.JLabel();
jLabel121 = new javax.swing.JLabel();
jLabel122 = new javax.swing.JLabel();
nombreIBPA = new javax.swing.JTextField();
serialBPA = new javax.swing.JTextField();
marcaBPA = new javax.swing.JTextField();
colorBPA = new javax.swing.JTextField();
fechaDBPA = new javax.swing.JTextField();
jLabel104 = new javax.swing.JLabel();
usuBPA = new javax.swing.JTextField();
fechaEBPA = new javax.swing.JTextField();
limpiarBPA = new javax.swing.JButton();
LupaBPA = new javax.swing.JButton();
letra_cedulaBPA = new javax.swing.JComboBox<>();
jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jLabel17 = new javax.swing.JLabel();
setClosable(true);
setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
setTitle("Búsqueda de Préstamos Activos");
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/Imaganes/prestamo.png"))); // NOI18N
setMinimumSize(new java.awt.Dimension(1024, 700));
setPreferredSize(new java.awt.Dimension(1024, 700));
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLayeredPane1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
Base.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));
Base.setOpaque(false);
Base.setLayout(new java.awt.CardLayout());
BusquedaPresAct.setOpaque(false);
BusquedaPresAct.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel108.setFont(new java.awt.Font("Arial", 1, 36)); // NOI18N
jLabel108.setText("Préstamo Activo");
BusquedaPresAct.add(jLabel108, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 10, -1, -1));
jLabel109.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel109.setText("Ingrese la Cédula del");
BusquedaPresAct.add(jLabel109, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 70, -1, -1));
jLabel110.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel110.setText("Estudiante a Buscar");
BusquedaPresAct.add(jLabel110, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 100, -1, -1));
jLabel111.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel111.setText("Nombre del Estudiante");
BusquedaPresAct.add(jLabel111, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 160, -1, -1));
jLabel112.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel112.setText("Apellido del Estudiante");
BusquedaPresAct.add(jLabel112, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 220, -1, -1));
jLabel114.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel114.setText("Dirección");
BusquedaPresAct.add(jLabel114, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 340, -1, -1));
jLabel115.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel115.setText("Número Telefónico");
BusquedaPresAct.add(jLabel115, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 280, -1, -1));
direccionBPA.setEditable(false);
direccionBPA.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
BusquedaPresAct.add(direccionBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 370, 250, -1));
cedulaBPA.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
cedulaBPA.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
cedulaBPAKeyTyped(evt);
}
});
BusquedaPresAct.add(cedulaBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 130, 250, -1));
nombreEBPA.setEditable(false);
nombreEBPA.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
BusquedaPresAct.add(nombreEBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 190, 250, -1));
apellidoBPA.setEditable(false);
apellidoBPA.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
BusquedaPresAct.add(apellidoBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 250, 250, -1));
numerotlfBPA.setEditable(false);
numerotlfBPA.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
BusquedaPresAct.add(numerotlfBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 310, 250, -1));
jLabel116.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel116.setText("Registrado por");
BusquedaPresAct.add(jLabel116, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 340, -1, -1));
jLabel117.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel117.setText("Fecha de Entrega");
BusquedaPresAct.add(jLabel117, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 400, -1, -1));
jLabel118.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel118.setText("Fecha de Devolución");
BusquedaPresAct.add(jLabel118, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 400, -1, -1));
jLabel120.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel120.setText("Serial del Instrumento");
BusquedaPresAct.add(jLabel120, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 160, -1, -1));
jLabel121.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel121.setText("Color del Instrumento");
BusquedaPresAct.add(jLabel121, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 280, -1, -1));
jLabel122.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel122.setText("Marca del Instrumento");
BusquedaPresAct.add(jLabel122, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 220, -1, -1));
nombreIBPA.setEditable(false);
nombreIBPA.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
BusquedaPresAct.add(nombreIBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 130, 270, -1));
serialBPA.setEditable(false);
serialBPA.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
BusquedaPresAct.add(serialBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 190, 270, -1));
marcaBPA.setEditable(false);
marcaBPA.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
BusquedaPresAct.add(marcaBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 250, 270, -1));
colorBPA.setEditable(false);
colorBPA.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
BusquedaPresAct.add(colorBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 310, 270, -1));
fechaDBPA.setEditable(false);
fechaDBPA.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
BusquedaPresAct.add(fechaDBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 430, 270, -1));
jLabel104.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel104.setText("Nombre del Instrumento");
BusquedaPresAct.add(jLabel104, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 100, -1, -1));
usuBPA.setEditable(false);
usuBPA.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
BusquedaPresAct.add(usuBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 370, 270, -1));
fechaEBPA.setEditable(false);
fechaEBPA.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
BusquedaPresAct.add(fechaEBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 430, 250, -1));
limpiarBPA.setBackground(new java.awt.Color(103, 0, 0));
limpiarBPA.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
limpiarBPA.setForeground(new java.awt.Color(255, 255, 255));
limpiarBPA.setText("Limpiar");
limpiarBPA.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
limpiarBPA.setFocusPainted(false);
limpiarBPA.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
limpiarBPAActionPerformed(evt);
}
});
BusquedaPresAct.add(limpiarBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 490, -1, -1));
LupaBPA.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imaganes/icono_1.png"))); // NOI18N
LupaBPA.setBorderPainted(false);
LupaBPA.setContentAreaFilled(false);
LupaBPA.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
LupaBPA.setFocusPainted(false);
LupaBPA.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/Imaganes/iconoapa.png"))); // NOI18N
LupaBPA.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/Imaganes/iconoapa.png"))); // NOI18N
LupaBPA.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
LupaBPAActionPerformed(evt);
}
});
BusquedaPresAct.add(LupaBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 120, 50, -1));
letra_cedulaBPA.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
letra_cedulaBPA.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "V-", "E-" }));
letra_cedulaBPA.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
letra_cedulaBPAItemStateChanged(evt);
}
});
BusquedaPresAct.add(letra_cedulaBPA, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 130, 50, 28));
Base.add(BusquedaPresAct, "card26");
jLayeredPane1.add(Base, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 660, 570));
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imaganes/1_1.png"))); // NOI18N
jLayeredPane1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(-320, 0, 1020, 670));
getContentPane().add(jLayeredPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 0, 700, 700));
jPanel1.setBackground(new java.awt.Color(103, 0, 0));
jPanel1.setPreferredSize(new java.awt.Dimension(350, 700));
jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel17.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imaganes/Logo_base.png"))); // NOI18N
jLabel17.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 3, true));
jPanel1.add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 560, -1, -1));
getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 320, 670));
pack();
}// </editor-fold>//GEN-END:initComponents
private void cedulaBPAKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_cedulaBPAKeyTyped
char c = evt.getKeyChar();
if (!Character.isDigit(c)) {
getToolkit().beep();
evt.consume();
}
if (letra_cedulaBPA.getSelectedItem().equals("M-")) {
if (cedulaBPA.getText().length() > 8) {
evt.consume();
Toolkit.getDefaultToolkit().beep();
}
} else {
if (cedulaBPA.getText().length() > 7) {
evt.consume();
Toolkit.getDefaultToolkit().beep();
}
}
}//GEN-LAST:event_cedulaBPAKeyTyped
private void limpiarBPAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_limpiarBPAActionPerformed
JButton bt = (JButton) evt.getSource();
if (bt == limpiarBPA) {
nombreEBPA.setText("");
apellidoBPA.setText("");
cedulaBPA.setText("");
direccionBPA.setText("");
numerotlfBPA.setText("");
fechaEBPA.setText("");
serialBPA.setText("");
nombreIBPA.setText("");
marcaBPA.setText("");
colorBPA.setText("");
usuBPA.setText("");
fechaDBPA.setText("");
}
}//GEN-LAST:event_limpiarBPAActionPerformed
private void LupaBPAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LupaBPAActionPerformed
JButton bt = (JButton) evt.getSource();
if (bt == LupaBPA) {
if (cedulaBPA.getText().equals("")) {
JOptionPane.showMessageDialog(null, " El Campo está Vacío. \n Intente Nuevamente...", "¡ERROR!", JOptionPane.ERROR_MESSAGE);
} else {
Modelo Prestamo = new Modelo();
Prestamo = null;
OperarPrestamo OP = new OperarPrestamo();
Prestamo = OP.BuscarPrestamo(letra_cedulaBPA.getSelectedItem() + "" + cedulaBPA.getText());
if (Prestamo != null) {
nombreEBPA.setText(Prestamo.getNombre());
apellidoBPA.setText(Prestamo.getApellido());
direccionBPA.setText(Prestamo.getDirec());
numerotlfBPA.setText(Prestamo.getNumTlf());
serialBPA.setText(Prestamo.getSerial());
nombreIBPA.setText(Prestamo.getNombre_instrumento());
marcaBPA.setText(Prestamo.getMarca_instrumento());
colorBPA.setText(Prestamo.getColor());
usuBPA.setText(Prestamo.getusuario());
fechaEBPA.setText(Prestamo.getfecha_entrega());
fechaDBPA.setText(Prestamo.getFecha_devolucion());
}
}
}
}//GEN-LAST:event_LupaBPAActionPerformed
private void letra_cedulaBPAItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_letra_cedulaBPAItemStateChanged
if (evt.getStateChange() == ItemEvent.SELECTED) {
cedulaBPA.setText("");
}
}//GEN-LAST:event_letra_cedulaBPAItemStateChanged
public void limpiarjif() {
nombreEBPA.setText("");
apellidoBPA.setText("");
cedulaBPA.setText("");
direccionBPA.setText("");
numerotlfBPA.setText("");
fechaEBPA.setText("");
serialBPA.setText("");
nombreIBPA.setText("");
marcaBPA.setText("");
colorBPA.setText("");
usuBPA.setText("");
fechaDBPA.setText("");
}
private String usuario, cedula_estudiante = "", serial_i = "";
private boolean VolverLogin = true, administrador = false;
private int id_estudiante = 0, id_instrumento = 0, id_usuario = 0;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel Base;
private javax.swing.JPanel BusquedaPresAct;
private javax.swing.JButton LupaBPA;
private javax.swing.JTextField apellidoBPA;
private javax.swing.JTextField cedulaBPA;
private javax.swing.JTextField colorBPA;
private javax.swing.JTextField direccionBPA;
private javax.swing.JTextField fechaDBPA;
private javax.swing.JTextField fechaEBPA;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel104;
private javax.swing.JLabel jLabel108;
private javax.swing.JLabel jLabel109;
private javax.swing.JLabel jLabel110;
private javax.swing.JLabel jLabel111;
private javax.swing.JLabel jLabel112;
private javax.swing.JLabel jLabel114;
private javax.swing.JLabel jLabel115;
private javax.swing.JLabel jLabel116;
private javax.swing.JLabel jLabel117;
private javax.swing.JLabel jLabel118;
private javax.swing.JLabel jLabel120;
private javax.swing.JLabel jLabel121;
private javax.swing.JLabel jLabel122;
private javax.swing.JLabel jLabel17;
private javax.swing.JLayeredPane jLayeredPane1;
private javax.swing.JPanel jPanel1;
private javax.swing.JComboBox<String> letra_cedulaBPA;
private javax.swing.JButton limpiarBPA;
private javax.swing.JTextField marcaBPA;
private javax.swing.JTextField nombreEBPA;
private javax.swing.JTextField nombreIBPA;
private javax.swing.JTextField numerotlfBPA;
private javax.swing.JTextField serialBPA;
private javax.swing.JTextField usuBPA;
// End of variables declaration//GEN-END:variables
}
| [
"arthuro.dugarte@gmail.com"
] | arthuro.dugarte@gmail.com |
a7c9039c0f515af99e1b7166190832c7331d2edc | cdd011950f944a7c7c91feede249a4424f027bf5 | /bmc-core/src/main/java/com/oracle/bmc/core/responses/DeleteVolumeKmsKeyResponse.java | 947f0b8b301c5bb6abadfc985b2d0053ce89ce96 | [
"UPL-1.0",
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | kpanwar/oci-java-sdk | 1f769ddb34c37f5c939b8dad43c42e249b0551d4 | b60d045abad0e68e20b50139516a879751dc33a2 | refs/heads/master | 2020-04-13T03:52:19.405231 | 2018-12-13T17:55:00 | 2018-12-13T17:55:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 908 | java | /**
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.bmc.core.responses;
import com.oracle.bmc.core.model.*;
@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918")
@lombok.Builder(builderClassName = "Builder")
@lombok.Getter
public class DeleteVolumeKmsKeyResponse {
/**
* Unique Oracle-assigned identifier for the request. If you need to contact Oracle about
* a particular request, please provide the request ID.
*
*/
private String opcRequestId;
public static class Builder {
/**
* Copy method to populate the builder with values from the given instance.
* @return this builder instance
*/
public Builder copy(DeleteVolumeKmsKeyResponse o) {
opcRequestId(o.getOpcRequestId());
return this;
}
}
}
| [
"sumit.kumar.dey@oracle.com"
] | sumit.kumar.dey@oracle.com |
9fb3f6fb4e53ce0516a5858204b2058e7ed901b7 | 4c151980ad335b90398454988f2cdee9d46ab30f | /src/com/bracketbird/client/pages/matches/FinalGroupStageRanker.java | 0cf4543e335303b316af058167a7534c6fe170c2 | [] | no_license | MartinKierkegaard/Bracketbird | 42d1a4a48656a30c4b98712778f52217f3ac397d | 81c9c9748c09c767c8b888dc51942b59836f0759 | refs/heads/master | 2021-01-15T08:05:28.405809 | 2015-01-04T20:15:01 | 2015-01-04T20:15:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,583 | java | package com.bracketbird.client.pages.matches;
import com.bracketbird.client.model.Team;
import com.bracketbird.client.model.tournament.*;
import java.util.ArrayList;
import java.util.List;
public class FinalGroupStageRanker {
//TODO - THIS IS CRAPPY - rewrite
private List<Position> positions;
public FinalGroupStageRanker(GroupStage stage) {
this.positions = getFinalPositions(stage);
}
public boolean allTeamsHasUniquePositions(){
for (Position position : positions) {
if(position.hasMoreTeams()){
return true;
}
}
return false;
}
private List<Position> getFinalPositions(GroupStage stage) {
List<Match> matches = stage.getMatches();
List<Position> positions = new ArrayList<Position>();
//homogenic = all groups have same number of teams.
//those teams that make it inhomogenic
List<Team> restTeams = new ArrayList<Team>();
int minTeams = Integer.MAX_VALUE;
int maxTeams = 0;
for (Group aGroup : stage.getGroups()) {
int teamsCount = aGroup.getTeams().size();
if (teamsCount < minTeams) {
minTeams = teamsCount;
}
if (teamsCount > maxTeams) {
maxTeams = teamsCount;
}
}
boolean isHomogen = (minTeams == maxTeams);
//if not homogen - then collect the restteams
if (!isHomogen) {
for (Group g : stage.getGroups()) {
if (g.getEndingTeams().size() == maxTeams) {
restTeams.add(g.getEndingTeams().get(maxTeams - 1));//gets the last one
}
}
}
int count = 0;
while (count < minTeams) {
List<Team> verticalList = new ArrayList<Team>();
//each number one and each number two etc. is collected in verticalList.
for (Group g: stage.getGroups()) {
verticalList.add(g.getEndingTeams().get(count));
}
RankingSheet rs = new RankingSheet(matches, verticalList, restTeams, stage.getSettings());
positions.addAll(rs.getPositions());
count++;
}
//adding the rest teams
if (!isHomogen) {
RankingSheet rs = new RankingSheet(matches, restTeams, new ArrayList<Team>(), stage.getSettings());
positions.addAll(rs.getPositions());
}
return positions;
}
public List<Position> getPositions() {
return positions;
}
}
| [
"jonasgreen12345@gmail.com"
] | jonasgreen12345@gmail.com |
2e58faf737e9ccd1acb75bb0dd2037f7fea4ca35 | 21ea986d7bb9ff090f582c0c9a81dca3ec00d471 | /src/main/java/com/mmall/service/impl/OrderServiceImpl.java | 566789f773d650379e685854cc49832f1406b16a | [
"MIT"
] | permissive | HNfa/MMALL | d213866973bf7ca8b8f7dab1eb4e6fd92807ec70 | 1f65a2e89b5c144643859216b5a38f5673a20e9b | refs/heads/master | 2021-09-25T10:49:49.836924 | 2018-10-21T11:59:50 | 2018-10-21T11:59:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 26,570 | java | package com.mmall.service.impl;
import com.alipay.api.AlipayResponse;
import com.alipay.api.response.AlipayTradePrecreateResponse;
import com.alipay.demo.trade.config.Configs;
import com.alipay.demo.trade.model.ExtendParams;
import com.alipay.demo.trade.model.GoodsDetail;
import com.alipay.demo.trade.model.builder.AlipayTradePrecreateRequestBuilder;
import com.alipay.demo.trade.model.result.AlipayF2FPrecreateResult;
import com.alipay.demo.trade.service.AlipayTradeService;
import com.alipay.demo.trade.service.impl.AlipayTradeServiceImpl;
import com.alipay.demo.trade.utils.ZxingUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.mmall.common.Const;
import com.mmall.common.ServerResponse;
import com.mmall.dao.*;
import com.mmall.pojo.*;
import com.mmall.service.IOrderService;
import com.mmall.util.BigDecimalUtil;
import com.mmall.util.DateTimeUtil;
import com.mmall.util.FTPUtil;
import com.mmall.util.PropertiesUtil;
import com.mmall.vo.OrderItemVo;
import com.mmall.vo.OrderProductVo;
import com.mmall.vo.OrderVo;
import com.mmall.vo.ShippingVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
/**
* @Auther gongfukang
* @Date 2018/6/12 23:16
*/
@Service("iOrderService")
@Slf4j
public class OrderServiceImpl implements IOrderService {
@Autowired
private OrderMapper orderMapper;
@Autowired
private OrderItemMapper orderItemMapper;
@Autowired
private PayInfoMapper payInfoMapper;
@Autowired
private CartMapper cartMapper;
@Autowired
private ProductMapper productMapper;
@Autowired
private ShippingMapper shippingMapper;
/**
* 创建订单
*/
@Override
public ServerResponse createOrder(Integer userId, Integer shippingId) {
// 从购物车获取数据
List<Cart> cartList = cartMapper.selectCheckedCartByUserId(userId);
// 计算订单总价
ServerResponse serverResponse = this.getCartOrderItem(userId, cartList);
if (!serverResponse.isSuccess()) {
return serverResponse;
}
List<OrderItem> orderItemList = (List<OrderItem>) serverResponse.getDate();
BigDecimal payment = this.getOrderTotalPrice(orderItemList);
// 生成订单
Order order = this.assembleOrder(userId, shippingId, payment);
if (order == null) {
return ServerResponse.createByErrorMessage("生成订单错误");
}
if (CollectionUtils.isEmpty(orderItemList)) {
return ServerResponse.createByErrorMessage("购物车为空");
}
for (OrderItem orderItem : orderItemList) {
orderItem.setOrderNo(order.getOrderNo());
}
// orderItemList mybatis 批量插入
orderItemMapper.batchInsert(orderItemList);
// 生成成功,减少产品库存
this.reduceProductStock(orderItemList);
// 清空购物车
this.cleanCart(cartList);
// 返回给前端数据
OrderVo orderVo = assembleOrderVo(order, orderItemList);
return ServerResponse.createBySuccess(orderVo);
}
/**
* 取消订单
*/
@Override
public ServerResponse<String> cancel(Integer userId, Long orderNo) {
Order order = orderMapper.selectByUserIdAndOrderNo(userId, orderNo);
if (order == null) {
return ServerResponse.createByErrorMessage("该用户订单不存在");
}
if (order.getStatus() != Const.OrderStatusEnum.NO_PAY.getCode()) {
return ServerResponse.createByErrorMessage("已付款,无法取消订单");
}
Order updateOrder = new Order();
updateOrder.setId(order.getId());
updateOrder.setStatus(Const.OrderStatusEnum.CANCELED.getCode());
int row = orderMapper.updateByPrimaryKeySelective(updateOrder);
if (row > 0) {
return ServerResponse.createBySuccess();
}
return ServerResponse.createByError();
}
/**
* 获取购物车中已经选中的商品详情
*/
@Override
public ServerResponse getOrderCartProduct(Integer userId) {
OrderProductVo orderProductVo = new OrderProductVo();
// 从购物车中国获取数据
List<Cart> cartList = cartMapper.selectCheckedCartByUserId(userId);
ServerResponse serverResponse = this.getCartOrderItem(userId, cartList);
if (!serverResponse.isSuccess()) {
return serverResponse;
}
List<OrderItem> orderItemsList = (List<OrderItem>) serverResponse.getDate();
List<OrderItemVo> orderItemVoList = Lists.newArrayList();
BigDecimal payment = new BigDecimal("0");
for (OrderItem orderItem : orderItemsList) {
payment = BigDecimalUtil.add(payment.doubleValue(), orderItem.getTotalPrice().doubleValue());
orderItemVoList.add(assembleOrderItemVo(orderItem));
}
orderProductVo.setProductTotalPrice(payment);
orderProductVo.setOrderItemVoList(orderItemVoList);
orderProductVo.setImageHost(PropertiesUtil.getProperty("ftp.server.http.prefix"));
return ServerResponse.createBySuccess(orderProductVo);
}
/**
* 用户前台获取订单详情
*/
@Override
public ServerResponse<OrderVo> getOrderDetail(Integer userId, Long orderNo) {
Order order = orderMapper.selectByUserIdAndOrderNo(userId, orderNo);
if (order != null) {
List<OrderItem> orderItemList = orderItemMapper.getByOrderNoUserId(orderNo, userId);
OrderVo orderVo = assembleOrderVo(order, orderItemList);
return ServerResponse.createBySuccess(orderVo);
}
return ServerResponse.createByErrorMessage("没有找到该订单");
}
/**
* 用户前台查看订单列表,分页
*/
@Override
public ServerResponse<PageInfo> getOrderList(Integer userId, int pageNum, int pageSize) {
PageHelper.startPage(pageNum, pageSize);
List<Order> orderList = orderMapper.selectByUserId(userId);
// orderList -> orderListVo
List<OrderVo> orderVoList = assembleOrderVoList(orderList, userId);
// 分页
PageInfo pageResult = new PageInfo(orderList);
pageResult.setList(orderVoList);
return ServerResponse.createBySuccess(pageResult);
}
/**
* 订单明细
*/
private ServerResponse getCartOrderItem(Integer userId, List<Cart> cartList) {
List<OrderItem> orderItemList = Lists.newArrayList();
if (CollectionUtils.isEmpty(cartList))
return ServerResponse.createByErrorMessage("购物车不能为空");
// 校验购物车数据,包括产品的状态和数量
for (Cart cartItem : cartList) {
OrderItem orderItem = new OrderItem();
Product product = productMapper.selectByPrimaryKey(cartItem.getProductId());
if (Const.ProductStatusEnum.ON_SALE.getCode() != product.getStatus()) {
return ServerResponse.createByErrorMessage("产品:" + product.getName() + "不是在线售卖状态");
}
// 校验库存
if (cartItem.getQuantity() > product.getStock()) {
return ServerResponse.createByErrorMessage("产品:" + product.getName() + "库存不足");
}
// 组装
orderItem.setUserId(userId);
orderItem.setProductId(product.getId());
orderItem.setProductName(product.getName());
orderItem.setProductImage(product.getMainImage());
orderItem.setCurrentUnitPrice(product.getPrice());
orderItem.setQuantity(cartItem.getQuantity());
orderItem.setTotalPrice(BigDecimalUtil.mul(product.getPrice().doubleValue(), cartItem.getQuantity()));
orderItemList.add(orderItem);
}
return ServerResponse.createBySuccess(orderItemList);
}
/**
* 计算总价
*/
private BigDecimal getOrderTotalPrice(List<OrderItem> orderItemList) {
BigDecimal payment = new BigDecimal("0");
for (OrderItem orderItem : orderItemList) {
payment = BigDecimalUtil.add(payment.doubleValue(), orderItem.getTotalPrice().doubleValue());
}
return payment;
}
/**
* 组装订单对象
*/
private Order assembleOrder(Integer userId, Integer shippingId, BigDecimal payment) {
Order order = new Order();
long orderNo = this.generateOrderNo();
order.setOrderNo(orderNo);
order.setStatus(Const.OrderStatusEnum.NO_PAY.getCode());
order.setPaymentType(Const.PaymentTypeEnum.ONLINE_PAY.getCode());
order.setPayment(payment);
order.setUserId(userId);
order.setShippingId(shippingId);
// todo 发货时间
// todo 付款时间
int rowCount = orderMapper.insert(order);
if (rowCount > 0)
return order;
return null;
}
/**
* 生成订单号
*/
private long generateOrderNo() {
long currentTime = System.currentTimeMillis();
return currentTime + new Random().nextInt(100);
}
/**
* 减库存
*/
private void reduceProductStock(List<OrderItem> orderItemList) {
for (OrderItem orderItem : orderItemList) {
Product product = productMapper.selectByPrimaryKey(orderItem.getProductId());
product.setStock(product.getStock() - orderItem.getQuantity());
productMapper.updateByPrimaryKey(product);
}
}
/**
* 清空购物车
*/
private void cleanCart(List<Cart> cartList) {
for (Cart cart : cartList) {
cartMapper.deleteByPrimaryKey(cart.getId());
}
}
/**
* 组装订单对象
*/
private OrderVo assembleOrderVo(Order order, List<OrderItem> orderItemList) {
OrderVo orderVo = new OrderVo();
orderVo.setOrderNo(order.getOrderNo());
orderVo.setPayment(order.getPayment());
orderVo.setPaymentType(order.getPaymentType());
orderVo.setPaymentTypeDesc(Const.PaymentTypeEnum.codeOf(order.getPaymentType()).getValue());
orderVo.setStatus(order.getStatus());
orderVo.setStatusDesc(Const.OrderStatusEnum.codeOf(order.getStatus()).getValue());
orderVo.setShippingId(order.getShippingId());
Shipping shipping = shippingMapper.selectByPrimaryKey(order.getShippingId());
if (shipping != null) {
orderVo.setReceiverName(shipping.getReceiverName());
orderVo.setShippingVo(assembleShippingVo(shipping));
}
orderVo.setPaymentTime(DateTimeUtil.dateToStr(order.getPaymentTime()));
orderVo.setSendTime(DateTimeUtil.dateToStr(order.getSendTime()));
orderVo.setEndTime(DateTimeUtil.dateToStr(order.getEndTime()));
orderVo.setCreateTime(DateTimeUtil.dateToStr(order.getCreateTime()));
orderVo.setCloseTime(DateTimeUtil.dateToStr(order.getCloseTime()));
orderVo.setImageHost(PropertiesUtil.getProperty("ftp.server.http.prefix"));
List<OrderItemVo> orderItemVoList = Lists.newArrayList();
for (OrderItem orderItem : orderItemList) {
OrderItemVo orderItemVo = assembleOrderItemVo(orderItem);
orderItemVoList.add(orderItemVo);
}
orderVo.setOrderItemVoList(orderItemVoList);
return orderVo;
}
/**
* 组装地址对象
*/
private ShippingVo assembleShippingVo(Shipping shipping) {
ShippingVo shippingVo = new ShippingVo();
shippingVo.setReceiverName(shipping.getReceiverName());
shippingVo.setReceiverAddress(shipping.getReceiverAddress());
shippingVo.setReceiverProvince(shipping.getReceiverProvince());
shippingVo.setReceiverCity(shipping.getReceiverCity());
shippingVo.setReceiverDistrict(shipping.getReceiverDistrict());
shippingVo.setReceiverMobile(shipping.getReceiverMobile());
shippingVo.setReceiverPhone(shipping.getReceiverPhone());
return shippingVo;
}
private OrderItemVo assembleOrderItemVo(OrderItem orderItem) {
OrderItemVo orderItemVo = new OrderItemVo();
orderItemVo.setOrderNo(orderItem.getOrderNo());
orderItemVo.setProductId(orderItem.getProductId());
orderItemVo.setProductName(orderItem.getProductName());
orderItemVo.setProductImage(orderItem.getProductImage());
orderItemVo.setCurrentUnitPrice(orderItem.getCurrentUnitPrice());
orderItemVo.setTotalPrice(orderItem.getTotalPrice());
orderItemVo.setQuantity(orderItem.getQuantity());
orderItemVo.setCreateTime(DateTimeUtil.dateToStr(orderItem.getCreateTime()));
return orderItemVo;
}
private List<OrderVo> assembleOrderVoList(List<Order> orderList, Integer userId) {
List<OrderVo> orderVoList = Lists.newArrayList();
List<OrderItem> orderItemList = Lists.newArrayList();
for (Order order : orderList) {
if (userId == null) {
//todo 管理员查询, 不需要传 userId
orderItemList = orderItemMapper.getByOrderNo(order.getOrderNo());
} else {
orderItemList = orderItemMapper.getByOrderNoUserId(order.getOrderNo(), userId);
}
OrderVo orderVo = assembleOrderVo(order, orderItemList);
orderVoList.add(orderVo);
}
return orderVoList;
}
@Override
public ServerResponse pay(Long orderNo, Integer userId, String path) {
Map<String, String> resultMap = Maps.newHashMap();
Order order = orderMapper.selectByUserIdAndOrderNo(userId, orderNo);
if (order == null) {
return ServerResponse.createByErrorMessage("用户没有该订单");
}
resultMap.put("orderNo", String.valueOf(order.getOrderNo()));
// (必填) 商户网站订单系统中唯一订单号,64个字符以内,只能包含字母、数字、下划线,
// 需保证商户系统端不能重复,建议通过数据库sequence生成,
String outTradeNo = order.getOrderNo().toString();
// (必填) 订单标题,粗略描述用户的支付目的。如“xxx品牌xxx门店当面付扫码消费”
String subject = new StringBuilder().append("mmmmall 扫码支付,订单号:").append(outTradeNo).toString();
// (必填) 订单总金额,单位为元,不能超过1亿元
// 如果同时传入了【打折金额】,【不可打折金额】,【订单总金额】三者,则必须满足如下条件:【订单总金额】=【打折金额】+【不可打折金额】
String totalAmount = order.getPayment().toString();
// (可选) 订单不可打折金额,可以配合商家平台配置折扣活动,如果酒水不参与打折,则将对应金额填写至此字段
// 如果该值未传入,但传入了【订单总金额】,【打折金额】,则该值默认为【订单总金额】-【打折金额】
String undiscountableAmount = "0";
// 卖家支付宝账号ID,用于支持一个签约账号下支持打款到不同的收款账号,(打款到sellerId对应的支付宝账号)
// 如果该字段为空,则默认为与支付宝签约的商户的PID,也就是appid对应的PID
String sellerId = "";
// 订单描述,可以对交易或商品进行一个详细地描述,比如填写"购买商品2件共15.00元"
String body = new StringBuilder().append("订单号:").append(outTradeNo).append("购买商品:").append(totalAmount).append("元").toString();
// 商户操作员编号,添加此参数可以为商户操作员做销售统计
String operatorId = "test_operator_id";
// (必填) 商户门店编号,通过门店号和商家后台可以配置精准到门店的折扣信息,详询支付宝技术支持
String storeId = "test_store_id";
// 业务扩展参数,目前可添加由支付宝分配的系统商编号(通过setSysServiceProviderId方法),详情请咨询支付宝技术支持
ExtendParams extendParams = new ExtendParams();
extendParams.setSysServiceProviderId("2088100200300400500");
// 支付超时,定义为120分钟
String timeoutExpress = "120m";
// 商品明细列表,需填写购买商品详细信息,
List<GoodsDetail> goodsDetailList = new ArrayList<GoodsDetail>();
//构建 GoodsDetail
List<OrderItem> orderItemList = orderItemMapper.getByOrderNoUserId(orderNo, userId);
for (OrderItem orderItem : orderItemList) {
GoodsDetail goods = GoodsDetail.newInstance(orderItem.getProductId().toString(), orderItem.getProductName(),
BigDecimalUtil.mul(orderItem.getCurrentUnitPrice().doubleValue(), new Double(100).doubleValue()).longValue(), orderItem.getQuantity());
goodsDetailList.add(goods);
}
// 创建扫码支付请求builder,设置请求参数
AlipayTradePrecreateRequestBuilder builder = new AlipayTradePrecreateRequestBuilder()
.setSubject(subject).setTotalAmount(totalAmount).setOutTradeNo(outTradeNo)
.setUndiscountableAmount(undiscountableAmount).setSellerId(sellerId).setBody(body)
.setOperatorId(operatorId).setStoreId(storeId).setExtendParams(extendParams)
.setTimeoutExpress(timeoutExpress)
.setNotifyUrl(PropertiesUtil.getProperty("alipay.callback.url"))//支付宝服务器主动通知商户服务器里指定的页面http路径,根据需要设置
.setGoodsDetailList(goodsDetailList);
/** 一定要在创建AlipayTradeService之前调用Configs.init()设置默认参数
* Configs会读取classpath下的zfbinfo.properties文件配置信息,如果找不到该文件则确认该文件是否在classpath目录
*/
Configs.init("zfbinfo.properties");
/** 使用Configs提供的默认参数
* AlipayTradeService可以使用单例或者为静态成员对象,不需要反复new
*/
AlipayTradeService tradeService = new AlipayTradeServiceImpl.ClientBuilder().build();
AlipayF2FPrecreateResult result = tradeService.tradePrecreate(builder);
switch (result.getTradeStatus()) {
case SUCCESS:
log.info("支付宝预下单成功: )");
AlipayTradePrecreateResponse response = result.getResponse();
dumpResponse(response);
File folder = new File(path);
if (!folder.exists()) {
folder.setWritable(true);
folder.mkdirs();
}
// 需要修改为运行机器上的路径
String qrPath = String.format(path + "/qr-%s.png", response.getOutTradeNo());
String qrFileName = String.format("qr-%s.png", response.getOutTradeNo());
ZxingUtils.getQRCodeImge(response.getQrCode(), 256, qrPath);
File targetFile = new File(path, qrFileName);
try {
FTPUtil.uploadFile(Lists.<File>newArrayList(targetFile));
} catch (IOException e) {
log.error("上传二维码异常", e);
}
log.info("filePath:" + qrPath);
String qrUrl = PropertiesUtil.getProperty("ftp.server.http.prefix") + targetFile.getName();
resultMap.put("qrUrl", qrUrl);
return ServerResponse.createBySuccess(resultMap);
case FAILED:
log.error("支付宝预下单失败!!!");
return ServerResponse.createByErrorMessage("支付宝预下单失败!!!");
case UNKNOWN:
log.error("系统异常,预下单状态未知!!!");
return ServerResponse.createByErrorMessage("系统异常,预下单状态未知!!!");
default:
log.error("不支持的交易状态,交易返回异常!!!");
return ServerResponse.createByErrorMessage("不支持的交易状态,交易返回异常!!!");
}
}
// 简单打印应答
private void dumpResponse(AlipayResponse response) {
if (response != null) {
log.info(String.format("code:%s, msg:%s", response.getCode(), response.getMsg()));
if (StringUtils.isNotEmpty(response.getSubCode())) {
log.info(String.format("subCode:%s, subMsg:%s", response.getSubCode(),
response.getSubMsg()));
}
log.info("body:" + response.getBody());
}
}
/**
* 验证支付宝回调参数
*/
@Override
public ServerResponse aliCallback(Map<String, String> params) {
Long orderNo = Long.parseLong(params.get("out_trade_no"));
String tradeNo = params.get("trade_no");
String tradeStatus = params.get("trade_status");
Order order = orderMapper.selectByOrderNo(orderNo);
if (order == null) {
return ServerResponse.createByErrorMessage("非此 web 的订单,回调忽略");
}
// 订单状态判断
if (order.getStatus() >= Const.OrderStatusEnum.PAID.getCode()) {
return ServerResponse.createBySuccess("支付宝重复调用");
}
if (Const.AlipayCallback.TRADE_STATUS_TRADE_SUCCESS.equals(tradeStatus)) {
order.setPaymentTime(DateTimeUtil.strToDate(params.get("gmt_payment")));
order.setStatus(Const.OrderStatusEnum.PAID.getCode());
orderMapper.updateByPrimaryKey(order);
}
PayInfo payInfo = new PayInfo();
payInfo.setUserId(order.getUserId());
payInfo.setOrderNo(order.getOrderNo());
payInfo.setPayPlatform(Const.PayPlatformEnum.ALIPAY.getCode());
payInfo.setPlatformNumber(tradeNo);
payInfo.setPlatformStatus(tradeStatus);
payInfoMapper.insert(payInfo);
return ServerResponse.createBySuccess();
}
@Override
public ServerResponse queryOrderPayStatus(Integer userId, Long orderNo) {
Order order = orderMapper.selectByUserIdAndOrderNo(userId, orderNo);
if (order == null) {
return ServerResponse.createByErrorMessage("用户没有该订单");
}
if (order.getStatus() >= Const.OrderStatusEnum.PAID.getCode()) {
return ServerResponse.createBySuccess();
}
return ServerResponse.createByError();
}
// backend
/**
* 后台订单列表页面
*/
@Override
public ServerResponse<PageInfo> manageList(int pageNum, int pageSize){
PageHelper.startPage(pageNum, pageSize);
List<Order> orderList = orderMapper.selectAllOrder();
List<OrderVo> orderVoList = this.assembleOrderVoList(orderList, null);
PageInfo pageResult = new PageInfo(orderList);
pageResult.setList(orderVoList);
return ServerResponse.createBySuccess(pageResult);
}
@Override
public ServerResponse<OrderVo> manageDetail(Long orderNo) {
Order order = orderMapper.selectByOrderNo(orderNo);
if (order != null) {
List<OrderItem> orderItemList = orderItemMapper.getByOrderNo(orderNo);
OrderVo orderVo = assembleOrderVo(order, orderItemList);
return ServerResponse.createBySuccess(orderVo);
}
return ServerResponse.createByErrorMessage("订单不存在");
}
@Override
public ServerResponse<PageInfo> manageSearch(Long orderNo, int pageNum, int pageSize) {
PageHelper.startPage(pageNum, pageSize);
Order order = orderMapper.selectByOrderNo(orderNo);
if (order != null) {
List<OrderItem> orderItemList = orderItemMapper.getByOrderNo(orderNo);
OrderVo orderVo = assembleOrderVo(order, orderItemList);
PageInfo pageResult = new PageInfo(Lists.newArrayList(order));
pageResult.setList(Lists.newArrayList(orderVo));
return ServerResponse.createBySuccess(pageResult);
}
return ServerResponse.createByErrorMessage("订单不存在");
}
@Override
public ServerResponse<String> manageSendGoods(Long orderNo){
Order order = orderMapper.selectByOrderNo(orderNo);
if (order != null) {
if (order.getStatus() == Const.OrderStatusEnum.PAID.getCode()) {
order.setStatus(Const.OrderStatusEnum.SHIPPED.getCode());
order.setSendTime(new Date());
orderMapper.updateByPrimaryKeySelective(order);
return ServerResponse.createBySuccess("发货成功");
}
}
return ServerResponse.createByErrorMessage("订单不存在");
}
@Override
public void closeOrder(int hour) {
Date closeDateTime = DateUtils.addHours(new Date(), -hour);
List<Order> orderList = orderMapper.selectOrderStatusByCreateTime(Const.OrderStatusEnum.NO_PAY.getCode(), DateTimeUtil.dateToStr(closeDateTime));
for (Order order : orderList) {
List<OrderItem> orderItemList = orderItemMapper.getByOrderNo(order.getOrderNo());
for (OrderItem orderItem : orderItemList) {
// 一定用主键 where 条件,悲观锁
Integer stock = productMapper.selectStockProductId(orderItem.getProductId());
// 考虑到已经生成订单的商品被删除的情况
if(stock == null)
continue;
Product product = new Product();
product.setId(orderItem.getProductId());
// 关闭订单后,库存 = 原库存 + 订单中的数量
product.setStock(stock + orderItem.getQuantity());
productMapper.updateByPrimaryKeySelective(product);
}
// 关闭 Order
orderMapper.closeOrderByOrderId(order.getId());
log.info("关闭订单 OrderNo: {}", order.getOrderNo());
}
}
}
| [
"gongfukang@outlook.com"
] | gongfukang@outlook.com |
3fc9dc6de82ba52a8a45c2cf3cd1ee514cacc9e5 | 128ef0deb67b569c16064fc76b97bffc75f3714c | /src/main/java/ir/maktab/service/validation/LoginValidation.java | eded678c27cbd7932961e613ccfe025e55c71d7b | [] | no_license | HannaneZaminy/HomeService_SpringMVC | b2dbe4fcfae55d30873618dde3d88fd0c38e503a | b5615482ffc345c74d696183f09401678180a79b | refs/heads/master | 2023-06-03T19:36:09.112070 | 2021-06-25T12:46:07 | 2021-06-25T12:46:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 75 | java | package ir.maktab.service.validation;
public interface oginValidation {
}
| [
"zaminyh@yahoo.com"
] | zaminyh@yahoo.com |
d9a64b480da72cabfd5e50a4ddc06f24fe812115 | 06265a9d3741a7d3734dfcb6219fd3258d827fd3 | /Fifth task/src/sample/FoundText.java | c1ec1c8ba900bd25558fb10ceadde35174c0615d | [] | no_license | Paxing939/Educational_practice_4th_semestr | e552e58dedffe2419203ba228046a66d6511c64a | a7425f1315f4e25d9800bffdcad16429bb5b3428 | refs/heads/master | 2021-03-29T12:27:39.712731 | 2020-06-06T16:40:58 | 2020-06-06T16:40:58 | 247,953,731 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 438 | java | package sample;
import java.util.ArrayList;
public class FoundText {
public static ArrayList<String> findDateInText(String text) {
ArrayList<String> foundDates = new ArrayList<>();
for (int i = 0; i < text.length() - 10; ++i) {
if (ValidDate.isValidDate(text.substring(i, i + 10))) {
foundDates.add(text.substring(i, i + 10));
}
}
return foundDates;
}
}
| [
"isachek2001@gmail.com"
] | isachek2001@gmail.com |
626cf19bd547a9372615fd6f9b606b2437f690e8 | 8637f778db63cc7c6f40dd3925d71278837bc6e7 | /Ejercicio09/src/ejercicio09/Ejercicio09.java | e45bf53d7a7b7e3d79d2685ad96140bf277afdf9 | [] | no_license | IntroProgramacion-P-Oct20-Feb21/taller3-FabianMontoya9975 | e514c3db44a45c67ee03708de6fdf8b919bad766 | 906d3242f270e555322a049f500fbe5816ad94a3 | refs/heads/main | 2023-01-19T01:09:07.279123 | 2020-11-20T17:21:19 | 2020-11-20T17:21:19 | 308,619,948 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 530 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ejercicio09;
/**
*
* @author josef
*/
public class Ejercicio09 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
boolean resultado = Math.sqrt(81)+Math.sqrt(25)*10>=50;
System.out.println(resultado);
}
}
| [
"jfmontoya1@utpl.edu.ec"
] | jfmontoya1@utpl.edu.ec |
4246e689668427a7b78500a3b308a1e3fa5b4c6a | b52bdef128ecebcc8808ed95f8287bc97a4c4174 | /client/src/main/java/com/orientechnologies/orient/client/remote/OEngineRemote.java | 0431415ba31cd6778e2d448a49b77209c0a23f96 | [
"Apache-2.0",
"CDDL-1.0",
"BSD-3-Clause"
] | permissive | saeedtabrizi/orientdb | 4736d86e82e713b34d21566ca844db5af177f53a | 361cf4816b6597ab7d5cd356745ee3f7f475116d | refs/heads/develop | 2021-01-15T14:43:20.379474 | 2019-09-09T12:20:03 | 2019-09-09T12:20:03 | 56,811,541 | 0 | 0 | Apache-2.0 | 2019-09-09T12:22:10 | 2016-04-21T23:24:41 | Java | UTF-8 | Java | false | false | 1,838 | java | /*
*
* * Copyright 2010-2016 OrientDB LTD (http://orientdb.com)
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
* * For more information: http://orientdb.com
*
*/
package com.orientechnologies.orient.client.remote;
import com.orientechnologies.orient.core.engine.OEngineAbstract;
import com.orientechnologies.orient.core.exception.OStorageException;
import com.orientechnologies.orient.core.storage.OStorage;
import java.util.Map;
/**
* Remote engine implementation.
*
* @author Luca Garulli (l.garulli--(at)--orientdb.com)
*/
public class OEngineRemote extends OEngineAbstract {
public static final String NAME = "remote";
public static final String PREFIX = NAME + ":";
public OEngineRemote() {
}
public OStorageRemote createStorage(final String iURL, final Map<String, String> iConfiguration, long maxWalSegSize,
long doubleWriteLogMaxSegSize) {
throw new OStorageException("deprecated");
}
@Override
public void removeStorage(final OStorage iStorage) {
}
@Override
public void startup() {
super.startup();
}
@Override
public void shutdown() {
super.shutdown();
}
@Override
public String getNameFromPath(String dbPath) {
return dbPath;
}
public String getName() {
return NAME;
}
}
| [
"lomakin.andrey@gmail.com"
] | lomakin.andrey@gmail.com |
343d4cadcc1c70f0fc01d17d4442cef75d71ea8a | 19171b1b74515ecf969ad821d5ee53523ebe6d6e | /missioni-rest-services/missioni-dropwizard-connector/src/main/java/it/cnr/missioni/dropwizard/connector/api/token/CreateTokenException.java | 82b831508a578fe89d5c10a17b7b1b5a312c5285 | [] | no_license | geosdi/cnr-missioni | e053c5815c766fabbee87705c83a9c2562a7a1c4 | 8a31ae77cea3ed1b621c346c3c9ee3f477e712de | refs/heads/master | 2022-07-09T20:40:16.461286 | 2022-07-01T05:45:29 | 2022-07-01T05:45:29 | 46,708,853 | 1 | 1 | null | 2022-07-01T05:45:30 | 2015-11-23T09:08:23 | Java | UTF-8 | Java | false | false | 2,540 | java | /*
* geo-platform
* Rich webgis framework
* http://geo-platform.org
* ====================================================================
*
* Copyright (C) 2008-2014 geoSDI Group (CNR IMAA - Potenza - ITALY).
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. This program is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. You should have received a copy of the GNU General
* Public License along with this program. If not, see http://www.gnu.org/licenses/
*
* ====================================================================
*
* Linking this library statically or dynamically with other modules is
* making a combined work based on this library. Thus, the terms and
* conditions of the GNU General Public License cover the whole combination.
*
* As a special exception, the copyright holders of this library give you permission
* to link this library with independent modules to produce an executable, regardless
* of the license terms of these independent modules, and to copy and distribute
* the resulting executable under terms of your choice, provided that you also meet,
* for each linked independent module, the terms and conditions of the license of
* that module. An independent module is a module which is not derived from or
* based on this library. If you modify this library, you may extend this exception
* to your version of the library, but you are not obligated to do so. If you do not
* wish to do so, delete this exception statement from your version.
*
*/
package it.cnr.missioni.dropwizard.connector.api.token;
/**
*
* @author Giuseppe La Scaleia - CNR IMAA geoSDI Group
* @email giuseppe.lascaleia@geosdi.org
*/
public class CreateTokenException extends RuntimeException {
private static final long serialVersionUID = 8743978273390296938L;
public CreateTokenException(String message) {
super(message);
}
public CreateTokenException(String message, Throwable cause) {
super(message, cause);
}
public CreateTokenException(Throwable cause) {
super(cause);
}
}
| [
"vito.salvia@gmail.com"
] | vito.salvia@gmail.com |
13724474b1b74aa9be34e1ad2b62f2738d44afc8 | 3dd8af1e3c6353f647aadd6592a657402217e35a | /eureka-provider/src/main/java/com/hkk/eurekaclient/EurekaProviderApplication.java | 10228e0bec4141727ce6fbb1b77f236ccdead254 | [] | no_license | 531621028/spring-cloud-demo | b5cca12f52c1110626484285f87011707eba199d | af5445aa451699d2e65a0c17aef54cb3add17497 | refs/heads/master | 2023-03-14T18:08:02.603712 | 2021-02-28T06:06:17 | 2021-02-28T06:06:17 | 273,452,522 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 525 | java | package com.hkk.eurekaclient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
@SpringBootApplication
public class EurekaProviderApplication {
public static void main(String[] args) {
ConfigurableApplicationContext applicationContext = SpringApplication.run(EurekaProviderApplication.class, args);
System.out.println(applicationContext.getEnvironment());
}
}
| [
"kangkang.hu@thoughtworks.com"
] | kangkang.hu@thoughtworks.com |
d27bd5157c4f5b659e4bad429efde93164a6cdb5 | 6443d8d1fd583e17a47233cec3d685061402ae93 | /financial_invest/src/main/java/com/one/financial/financial/entity/BankCardEntity.java | 6bae571c41a4715fa8de751aec64db475ea70c14 | [] | no_license | Git-zhb/one | f49b0678b41caf0afd00a899767c375494c1c647 | 9545e817171042ff7027f40ec0185638f9778a95 | refs/heads/master | 2022-07-22T10:35:00.694951 | 2020-02-27T03:25:19 | 2020-02-27T03:25:38 | 242,666,546 | 1 | 0 | null | 2022-06-21T02:52:26 | 2020-02-24T06:50:32 | JavaScript | UTF-8 | Java | false | false | 1,470 | java | package com.one.financial.financial.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*
* @author zhaohuibin
* @email xxx
* @date 2020-02-25 19:42:13
*/
@ApiModel
@Data
@TableName("t_bank_card")
public class BankCardEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId
@ApiModelProperty(name = "bankInfoId",value = "")
private Integer bankInfoId;
/**
* 银行卡号
*/
@ApiModelProperty(name = "bankCardNum",value = "银行卡号")
private Long bankCardNum;
/**
* 开户银行
*/
@ApiModelProperty(name = "openingBank",value = "开户银行")
private String openingBank;
/**
* 城市id
*/
@ApiModelProperty(name = "cityId",value = "城市id")
private Integer cityId;
/**
* 用户表主键
*/
@ApiModelProperty(name = "userId",value = "用户表主键")
private Integer userId;
/**
* 银行编号
*/
@ApiModelProperty(name = "bankId",value = "银行编号")
private Integer bankId;
/**
* 银行支行
*/
@ApiModelProperty(name = "bankBranch",value = "银行支行")
private String bankBranch;
/**
* 绑定手机号码
*/
@ApiModelProperty(name = "reservePhone",value = "绑定手机号码")
private Integer reservePhone;
}
| [
"2662349097@qq.com"
] | 2662349097@qq.com |
9b6e8275e1ce8b7cee1d6cc25697f46831308eab | d8ec0f725150d24b598b6406d2c57ca640905fca | /app/src/toothpick/java/info/kimjihyok/pokemonworldchampionship/toothpick/generated/trainer/Trainer28.java | b622313b35b497ca0f85ca07399e5676db2d6bdb | [] | no_license | wotomas/PokemonWorldChampionship | b968d1fce117aba38d2311a6599501e54475eb59 | 4476fffd477b061d724317aaeb07c04762379991 | refs/heads/master | 2020-11-29T11:59:39.599484 | 2017-03-16T08:32:06 | 2017-03-16T08:32:06 | 84,800,186 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 877 | java | package info.kimjihyok.pokemonworldchampionship.toothpick.generated.trainer;
import info.kimjihyok.pokemonworldchampionship.toothpick.generated.pokemon.Pokemon1;
import info.kimjihyok.pokemonworldchampionship.toothpick.generated.pokemon.Pokemon2;
import info.kimjihyok.pokemonworldchampionship.toothpick.generated.pokemon.Pokemon3;
import info.kimjihyok.pokemonworldchampionship.toothpick.generated.pokemon.Pokemon4;
import info.kimjihyok.pokemonworldchampionship.toothpick.generated.pokemon.Pokemon5;
import info.kimjihyok.pokemonworldchampionship.toothpick.generated.pokemon.Pokemon6;
import javax.inject.Inject;
public class Trainer28 {
@Inject
public Pokemon1 pokemon1;
@Inject
public Pokemon2 pokemon2;
@Inject
public Pokemon3 pokemon3;
@Inject
public Pokemon4 pokemon4;
@Inject
public Pokemon5 pokemon5;
@Inject
public Pokemon6 pokemon6;
}
| [
"jkimab@flitto.com"
] | jkimab@flitto.com |
8116c50e4cde351f0d7ebcfc9f98d125076b6211 | c2182e62de8cf2c9ab7bfbb89a9fd25c6ac07bda | /app/src/main/java/com/example/nearplace/network/NetworkClient.java | a44c946216244623e80be1b7e5b685dc43d5e49b | [] | no_license | pappu112/NearbyPlace | 2947e60e525bef2e298d25fd80c640136778d875 | 466a62930d8e97160fe2b8769044ec10e32db9fe | refs/heads/master | 2022-10-02T15:50:33.778035 | 2020-04-23T01:24:33 | 2020-04-23T01:24:33 | 257,737,686 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,066 | java | package com.example.nearplace.network;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class NetworkClient {
private static final String BASE_URL = "http://3.16.3.181/near/";
// private static final String BASE_URL = "http://198.199.80.106";
private static Retrofit retrofit;
public static Retrofit getRetrofitClient() {
Gson gson = new GsonBuilder()
.setLenient()
.create();
//If condition to ensure we don't create multiple retrofit instances in a single application
if (retrofit == null) {
//Defining the Retrofit using Builder
retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL) //This is the only mandatory call on Builder object.
.addConverterFactory(GsonConverterFactory.create(gson)) // Convertor library used to convert response into POJO
.build();
}
return retrofit;
}
} | [
"rocker.pappu@gmail.com"
] | rocker.pappu@gmail.com |
e15eef763891e4ceb8df7ad16e7d2353da1dee2e | b2696eb93d6acf153ceaec3e7a63888eec039ef2 | /Ex18dlgp3/Tique.java | 32c5f7a756090ca41e45df76f38f79cd735bb919 | [] | no_license | Dadvanced/ExPRO_3Parcial | e0f75973519276e49e78b089f082d6f3f55e9205 | 372ca72334a1dddc50c4509f42c28a77a484756d | refs/heads/master | 2021-01-13T21:25:46.888402 | 2017-02-14T11:07:51 | 2017-02-14T11:07:51 | 81,936,846 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,821 | java | package ex18dlgp3;
/**
*
* @author David León Galisteo
*/
public class Tique {
private int horas;
private int minutos;
private int numeroTique = 1; //es el número de tiquet del objeto
private static int numTique = 1; //es el número de tiquet total de la clase
private static double recaudacion;
////////////////////////////GETTER Y SETTER////////////////////////////////////
public int getHoras() {
return this.horas;
}
public int getMinutos() {
return this.minutos;
}
public int getNumeroTique() {
return this.numeroTique;
}
public static int getNumTique() {
return Tique.numTique;
}
public static int setNumTique(int n) {
return Tique.numTique += n;
}
public static double getRecaudacion() {
return Tique.recaudacion;
}
public static double setRecaudacion(double n) {
return Tique.recaudacion += n;
}
////////////////////////////////CONSTRUCTOR/////////////////////////////
public Tique(int h, int m) {
this.horas = h;
this.minutos = m;
this.numeroTique = Tique.getNumTique();
Tique.setNumTique(1);
}
//////////////////////////////////////////////MÉTODOS/////////////////////////////
public void paga(int h, int m) {
double minutosAPagar = -1;
double horasAPagar = 0;
double totalAPagar = 0;
if (m == 0) {
m = 60;
}
minutosAPagar = (m - this.minutos) * 0.02;
if (h - this.horas == 1) {
horasAPagar = 0;
} else {
horasAPagar = (h - this.horas) * 1.2; //1,2 € es lo que se paga en 1 hora.
}
totalAPagar = minutosAPagar + horasAPagar;
System.out.printf("Tique Nº" + this.numeroTique + ". Debe pagar %.2f euros. Gracias\n", totalAPagar);
Tique.setRecaudacion(totalAPagar);
}
}
| [
"dadvanced@hotmail.com"
] | dadvanced@hotmail.com |
c714ad4a42877f15fad302ededbfc9973b4be3c1 | c7a927951df15e74c01470ed0b35f549042a646f | /src/main/java/com/levelofhierarchy/model/Roles.java | 960dad4bece58ecc503007b5ef0fd53c9e03267c | [] | no_license | udhaya97/levelofhierarchyexample | e1f0e84ae8c3cc2e028a9b7c5b63af3e1b5e0afd | 605661be60ea297326687486f5ddc205ed3a63ee | refs/heads/master | 2023-03-28T05:06:14.347670 | 2021-03-27T13:20:30 | 2021-03-27T13:20:30 | 352,078,264 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 921 | java | package com.levelofhierarchy.model;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name="roles")
public class Roles {
@Id
private int roleId;
private String roleName;
@OneToMany(mappedBy = "roles")
private List<ProductRoles> prodRules;
public int getRoleId() {
return roleId;
}
public void setRoleId(int roleId) {
this.roleId = roleId;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public List<ProductRoles> getProdRules() {
return prodRules;
}
public void setProdRules(List<ProductRoles> prodRules) {
this.prodRules = prodRules;
}
public Roles(int roleId, String roleName) {
super();
this.roleId = roleId;
this.roleName = roleName;
}
public Roles() {
super();
}
}
| [
"udhaya2cse@gmail.com"
] | udhaya2cse@gmail.com |
97cf30a7c8ed015526089f070aa22733f8c86134 | 718f1016480179d6fe1d6ea9a425a182540c0e7b | /COMP_1451_Java_2/lab1/src/ca/bcit/comp1451/Session1LabB/Club.java | 6b41a7882786d595a01321d765ef2012d086b63c | [] | no_license | VladislavGudkov/BCIT_COURSES | f0cc4f75143ea0cdd80e53bfc72bd377dbf6a69f | 5acd1afb6f58d63f30a54373efd97135765358ee | refs/heads/main | 2023-07-01T12:53:12.936029 | 2021-08-09T18:28:27 | 2021-08-09T18:28:27 | 394,378,723 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,617 | java | package ca.bcit.comp1451.Session1LabB;
import java.util.ArrayList;
import java.util.Iterator;
public class Club
{
private ArrayList <Member> members;
/**
* @No args constructor for arraylist members
*/
public Club()
{
members = new ArrayList<Member>();
}
//Method for adding a member to the arrayList members
public void join(Member member)
{
if (members != null)
{
members.add(member);
}
else
{
throw new IllegalArgumentException("member cannot be null");
}
}
//Method to display size of ArrayList members
public int numberOfMembers()
{
return members.size();
}
//Method to show a list of members from ArrayList members
public void showMembers()
{
for (Member member : members)
{
System.out.println(member.getFirstName() + " " + member.getLastName() + " joined the Club in " + member.getMonthOfJoining() + " " + member.getYearOfJoining());
}
}
//Method to show a list of members from ArrayList members by year
public void showMembersByYear(int year)
{
Iterator<Member> it = members.iterator();
while (it.hasNext())
{
Member aMember = it.next();
if(aMember.getYearOfJoining() == year)
{
System.out.println(aMember.getFirstName() + " " + aMember.getLastName() + " joined in " + aMember.getYearOfJoining());
}
}
}
//Method to remove a list of members from ArrayList members by year
public void removeMembersByYear(int year)
{
Iterator<Member> it = members.iterator();
while (it.hasNext())
{
Member aMember = it.next();
if(aMember.getYearOfJoining() == year)
{
it.remove();
}
}
}
}
| [
"noreply@github.com"
] | VladislavGudkov.noreply@github.com |
6a594211ea1602be15dff3ba51470fd28f8c9f08 | afafffd3227ca901d5930f42331c9e76a3d0b796 | /BigBoss-BE-master/BigBoss-BE-master/src/main/java/com/example/APIBigboss/models/InforCompany.java | cb16296fbe578b460b0137d686ae0970868c0b24 | [] | no_license | HoangTrongHa/sem4 | 75b78fed7d5b82523e6d58409506fdb47e837e63 | 89acdcb386da26f9bb534f2ded07a9a2ff254964 | refs/heads/develop | 2023-07-27T07:31:59.808870 | 2021-09-10T13:44:01 | 2021-09-10T13:44:01 | 382,607,410 | 0 | 0 | null | 2021-07-10T14:18:48 | 2021-07-03T12:14:24 | JavaScript | UTF-8 | Java | false | false | 1,013 | java | package com.example.APIBigboss.models;
import com.sun.istack.NotNull;
import java.util.Set;
import org.springframework.lang.Nullable;
import javax.persistence.*;
@Entity
public class InforCompany {
@Id
// set up primary key
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@NotNull
private String base64;
@Column(columnDefinition = "TEXT")
private String content;
public InforCompany() {
}
public InforCompany(int id, String base64, String content) {
this.id = id;
this.base64 = base64;
this.content = content;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getBase64() {
return base64;
}
public void setBase64(String base64) {
this.base64 = base64;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
| [
"ha9a1ltt@gmail.com"
] | ha9a1ltt@gmail.com |
6b7e7038040b5a999962b78c537bc912487cdf19 | d3a43f1b065033a932c4c91af0c53467b6d21015 | /src/main/java/sample/Main.java | 848ea1355a99d92e2f73e867e724633fee5004a8 | [] | no_license | thittth1807067/NetCafe | fe8b7bf4108b8135e0063620c370f085e32873f3 | 2c8277a44174b6e89a03fe7b27b379219658c760 | refs/heads/master | 2020-06-18T05:13:41.661546 | 2019-07-10T09:33:51 | 2019-07-10T09:33:51 | 196,175,991 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 578 | java | package sample;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("../../resources/Member.fxml"));
Scene scene = new Scene(root);
primaryStage.setScene(new Scene(root));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
| [
"thittth1807067@fpt.edu.vn"
] | thittth1807067@fpt.edu.vn |
80642d85e133ec9c09c31e1939b980a514e9d755 | 6db3be2cdd4cae57375cea996145ee408561af6d | /src/main/java/br/com/albinomoreira/sbt/domain/DescricaoLancamento.java | eb841388421914a26899ba93dbfd2bbf34731ab5 | [] | no_license | albinoueg/SBT | 2f05241507646df7f64755d8fe814e23d8ca1c21 | f67e487acff10d5e384465a9c2ee67e497de068c | refs/heads/master | 2023-03-22T04:18:17.028122 | 2021-03-22T01:26:11 | 2021-03-22T01:26:11 | 329,293,844 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 947 | java | package br.com.albinomoreira.sbt.domain;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.List;
@Entity
@Table(name = "DESCRICAO_LANCAMENTO")
public class DescricaoLancamento extends AbstractEntity<Long>{
@NotBlank
@Size(max = 100, min = 3)
@Column(name = "NOME", nullable = false, unique = true, length = 100)
private String nome;
@OneToMany(mappedBy = "descricao")
private List<Lancamento> lancamentos;
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public List<Lancamento> getLancamentos() {
return lancamentos;
}
public void setLancamentos(List<Lancamento> lancamentos) {
this.lancamentos = lancamentos;
}
}
| [
"albino.sistemas@gmail.com"
] | albino.sistemas@gmail.com |
9087e26cf74696907f5b5d61d98fe5849fe3320c | e8556bc1d9f532bed38c4fad120b1f398fb7e5a9 | /CasaDoCodigoServer-master/src/main/java/br/com/caelum/fj59/casadocodigo/configuration/FirebaseConfig.java | 5ffc34c488cd40cbc43a242c98b7316968740d79 | [] | no_license | fabiano7878/android59caelum | 5aacd9db3dcad6cb74ef51310754a400fd57c68c | 4c50739ba85a4b16449ddcd8cf40ad0a499f52ca | refs/heads/master | 2021-08-31T09:59:51.102006 | 2017-12-21T00:48:10 | 2017-12-21T00:48:10 | 114,037,297 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 721 | java | package br.com.caelum.fj59.casadocodigo.configuration;
import java.io.InputStream;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
@Configuration
public class FirebaseConfig {
@Value("${firebase.config.path}")
private String configPath;
@PostConstruct
public void init() {
InputStream inputStream = FirebaseConfig.class.getClassLoader().getResourceAsStream(configPath);
FirebaseOptions options = new FirebaseOptions.Builder().setServiceAccount(inputStream).build();
FirebaseApp.initializeApp(options);
}
} | [
"fabiano78@hotmail.com"
] | fabiano78@hotmail.com |
3ba0d73603b7165c58ddfd76914b8ef6620d5cc2 | 5ce8d703ee59cb665be17b7fbbe7d47f27abc2aa | /model/src/main/java/cc/oceanz/todo/model/TodoItem.java | 8d44a90b02e1177d0b593758cd59b3fa930c0ce6 | [] | no_license | jiayeee/todo | 9148c232db61661c4efefe962bff38310c0dd989 | c3478d8e2337f0f391dd1c85dd0716a56d02fc84 | refs/heads/master | 2020-03-21T17:29:24.335426 | 2018-06-27T05:41:32 | 2018-06-27T05:43:18 | 138,834,793 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 643 | java | package cc.oceanz.todo.model;
public class TodoItem {
private String name;
private boolean hasDone;
public TodoItem(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isHasDone() {
return hasDone;
}
public void setHasDone(boolean hasDone) {
this.hasDone = hasDone;
}
@Override
public String toString() {
return "TodoItem{" +
"name='" + name + '\'' +
", hasDone=" + hasDone +
'}';
}
}
| [
"737093270@qq.com"
] | 737093270@qq.com |
af6c8ac56030347ba1803870b2bbf1b814266699 | e5386d4405f32037c9234d7e6c9253ac3e9e9639 | /app/src/main/java/com/ahxbapp/xjjsd/adapter/CartAdapter.java | 8fdc0049d6a98d1fc6d31883a4ef8a02d4a4d7a7 | [] | no_license | liuwenfang/XJJSD1 | 11fa55555a21b89730938f9bf30a268a9997db2e | 8571983a920179b294972a462467aecbe6af2997 | refs/heads/master | 2020-04-23T06:45:19.930979 | 2019-02-16T02:35:26 | 2019-02-16T02:35:26 | 170,984,239 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,977 | java | package com.ahxbapp.xjjsd.adapter;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import com.ahxbapp.xjjsd.R;
import com.ahxbapp.xjjsd.adapter.common.CommonAdapter;
import com.ahxbapp.xjjsd.adapter.common.ViewHolder;
import com.ahxbapp.xjjsd.customview.NoScrollGridView;
import com.ahxbapp.xjjsd.model.CartModel;
import com.ahxbapp.xjjsd.utils.DeviceUtil;
import com.ahxbapp.xjjsd.utils.MyToast;
import java.util.List;
/**
* Created by xp on 16/9/2.
*/
public class CartAdapter extends CommonAdapter<CartModel> {
public boolean isChecked;
ViewHolder tmpVh;
ViewHolder.ViewHolderInterface.common_click block_add,block_reduce,block_choose,block_help;
public CartAdapter(Context context, List<CartModel> datas, int layoutId,ViewHolder.ViewHolderInterface.common_click block1,ViewHolder.ViewHolderInterface.common_click block2,ViewHolder.ViewHolderInterface.common_click block3,ViewHolder.ViewHolderInterface.common_click block4) {
super(context, datas, layoutId);
block_add = block1;
block_reduce = block2;
block_choose = block3;
block_help = block4;
}
@Override
public void convert(ViewHolder holder, CartModel cartModel) {
tmpVh = holder;
holder.setImageUrl(R.id.img_cover, cartModel.getThumbnail());
holder.setText(R.id.tv_name, cartModel.getTitle());
holder.setText(R.id.tv_price,"¥"+ Float.toString(cartModel.getPrice()));
holder.setText(R.id.tv_num, Integer.toString(cartModel.getNum()));
//添加商品
holder.clickButton(R.id.btn_add,block_add);
//减少商品
holder.clickButton(R.id.btn_reduce,block_reduce);
holder.clickButton(R.id.btn_choose,block_choose);
holder.clickButton(R.id.img_help,block_help);
//选择
if (isChecked){
tmpVh.setCheckBoxState(R.id.btn_choose,true);
}else {
tmpVh.setCheckBoxState(R.id.btn_choose,false);
}
String str = cartModel.getComSize();
String[] strs = str.split(",");
// String [] strs = new String[]{"M","M","M","M","M","M","M","M"};
GradBtnAdapter myadapter = new GradBtnAdapter(strs,context,cartModel.getSize());
NoScrollGridView gridView=holder.getView(R.id.gv_size);
ViewGroup.LayoutParams params =gridView.getLayoutParams();
params.width= DeviceUtil.dip2px(context,37)*str.length();
gridView.setLayoutParams(params);
gridView.setNumColumns(str.length());
holder.setGridView(R.id.gv_size, myadapter);
//点击item
gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
MyToast.showToast(context,position+"");
}
});
myadapter.notifyDataSetChanged();
}
}
| [
"1348058915@qq.com"
] | 1348058915@qq.com |
b73b64162c210c65afcc468197c93e5eff43eec9 | d00ca5d5d5a752671cb90c98ff75e2045490150f | /app/src/main/java/com/example/indext/gtaobao/layout_taobao/GtaobaoAdapter.java | 6c90b143326d2503342e055ef44f649ae08a363b | [] | no_license | indext88/Gtaobao | 919defa5db620d3c533fd7c0baedf9e3bf3fafa8 | 13b03c76a5e56db555d4390986b3ee271603d746 | refs/heads/master | 2020-05-04T16:35:16.286421 | 2019-04-03T12:07:45 | 2019-04-03T12:07:45 | 179,281,969 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,387 | java | package com.example.indext.gtaobao.layout_taobao;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.ViewGroup;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.indext.gtaobao.Interface.Main2Activity;
import com.example.indext.gtaobao.R;
import java.util.List;
public class GtaobaoAdapter extends RecyclerView.Adapter<GtaobaoAdapter.ViewHolder>{
private List<Gtaobao> mGtaobaoList;
private Context context;
private LayoutInflater li = null;
static class ViewHolder extends RecyclerView.ViewHolder {
View GtaobaoView;
ImageView GtaobaoImage;
TextView GtaobaoName;
TextView Name2;
TextView Name3;
TextView Name4;
TextView Name5;
public ViewHolder(View view) {
super(view);
GtaobaoView = view;
GtaobaoImage = (ImageView) view.findViewById(R.id.img_g);
GtaobaoName = (TextView) view.findViewById(R.id.txt_g1);
Name2=(TextView)view.findViewById(R.id.txt_g2);
Name3=(TextView)view.findViewById(R.id.txt_g3);
Name4=(TextView)view.findViewById(R.id.txt_g4);
Name5=(TextView)view.findViewById(R.id.txt_g5);
}
}
public GtaobaoAdapter(List<Gtaobao> gtaobaoList) {
mGtaobaoList = gtaobaoList;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.gtaobao_item, parent, false);
final ViewHolder holder = new ViewHolder(view);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int position = holder.getAdapterPosition();
Gtaobao gtaobao = mGtaobaoList.get(position);
Toast.makeText(v.getContext(), gtaobao.getName(), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(v.getContext(),Main2Activity.class);
intent.putExtra("name",gtaobao.getName());
intent.putExtra("img",gtaobao.getImageId());
v.getContext().startActivity(intent);
}
});
holder.GtaobaoImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int position = holder.getAdapterPosition();
Gtaobao gtaobao = mGtaobaoList.get(position);
Toast.makeText(v.getContext(), "图片的单击"+gtaobao.getName(), Toast.LENGTH_SHORT).show();
}
});
return holder;
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
Gtaobao gtaobao = mGtaobaoList.get(position);
holder.GtaobaoImage.setImageResource(gtaobao.getImageId());
holder.GtaobaoName.setText(gtaobao.getName());
holder.Name2.setText(gtaobao.getName2());
holder.Name3.setText(gtaobao.getName3());
holder.Name4.setText(gtaobao.getName4());
holder.Name5.setText(gtaobao.getName5());
}
@Override
public int getItemCount() {
return mGtaobaoList.size();
}
}
| [
"YourName@mindmini.com"
] | YourName@mindmini.com |
cd862c37cc672d14c60258ee760c7fa7f2ac5c60 | 1d74f708286ff3779cf962b5250f6394d4665086 | /src/java/dongtv/listener/XslListener.java | 952e11ba557f15ca18b5e6eae94314dbd45c2e36 | [] | no_license | dongtvse05344/FoodSupplement | bffc607f63d849cf9a86935e6b39e9ada5a391a8 | 2a4e25c529c08987238fbfede358ecf7c92ecac8 | refs/heads/master | 2022-11-25T03:58:30.237831 | 2020-07-22T15:54:49 | 2020-07-22T15:54:49 | 272,010,368 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,329 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package dongtv.listener;
import dongtv.util.XMLUtils;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.xml.bind.JAXBException;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
/**
* Web application lifecycle listener.
*
* @author Tran Dong
*/
public class XslListener implements ServletContextListener {
private final String XSL_PRODUCT_ITEM_DETAIL = "xsl/product_item_detail.xsl";
private final String XSL_PRODUCT_ITEM = "xsl/product_item.xsl";
private final String XSL_SUB_PRODUCT_ITEM = "xsl/sub_product_item.xsl";
private final String XSL_PAGING = "xsl/paging.xsl";
private final String XSL_CATE_ITEM = "xsl/category_item.xsl";
private final String XSL_BRAND = "xsl/brand_item.xsl";
private final String XSL_COMPARISON = "xsl/comparison.xsl";
@Override
public void contextInitialized(ServletContextEvent sce) {
final ServletContext context = sce.getServletContext();
String realPath = context.getRealPath("/");
Source xslInput = new StreamSource(realPath + XSL_PRODUCT_ITEM_DETAIL);
context.setAttribute("XSL_PRODUCT_ITEM_DETAIL", xslInput);
xslInput = new StreamSource(realPath + XSL_PRODUCT_ITEM);
context.setAttribute("XSL_PRODUCT_ITEM", xslInput);
xslInput = new StreamSource(realPath + XSL_SUB_PRODUCT_ITEM);
context.setAttribute("XSL_SUB_PRODUCT_ITEM", xslInput);
xslInput = new StreamSource(realPath + XSL_PAGING);
context.setAttribute("XSL_PAGING", xslInput);
xslInput = new StreamSource(realPath + XSL_CATE_ITEM);
context.setAttribute("XSL_CATE_ITEM", xslInput);
xslInput = new StreamSource(realPath + XSL_BRAND);
context.setAttribute("XSL_BRAND", xslInput);
xslInput = new StreamSource(realPath + XSL_COMPARISON);
context.setAttribute("XSL_COMPARISON", xslInput);
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
}
}
| [
"xhunter1412@gmail.com"
] | xhunter1412@gmail.com |
400501ea35a9cb42c6c3a94d7c3f0d76d95da350 | ba333491a13967e09ee2c2e48a64b8aa05a08d2c | /base/src/main/java/com/wind/base/http/page/SePage.java | 65904b978a81c0e5e649babb55a4f4fd026bbf9c | [] | no_license | yqyzxd/AppFramework | 33fddbad3bbade131325d8ec9fce07233b00f1f6 | 5d588f985e4ffe2afe888d5d7ebdf87b269fdaaa | refs/heads/master | 2021-01-24T10:27:52.976864 | 2019-09-19T07:54:27 | 2019-09-19T07:54:27 | 123,052,999 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,418 | java | package com.wind.base.http.page;
import com.wind.base.api.IPageApi;
import com.wind.base.request.PageRequest;
import com.wind.base.response.PageResponse;
import javax.inject.Inject;
/**
* 分页策略2: startIndex, endIndex
*
* @author hiphonezhu@gmail.com
* @version [Android-BaseLine, 2015-09-29 21:54]
*/
public abstract class SePage<Q extends PageRequest, R extends PageResponse> extends AbstractPage<Q,R> {
public SePage(IPageApi pageApi) {
super(pageApi);
}
@Override
public int handlePageIndex(int currPageIndex, int pageSize) {
if (currPageIndex == getStartPageIndex() - 1) // 加载第一页数据(防止第一页使用"上拉加载更多")
{
return getStartPageIndex();
}
return currPageIndex + pageSize;
}
@Override
public int handlePage(int currPageIndex, int pageSize) {
return currPageIndex + pageSize - 1;
}
/**
* 起始下标递减
*/
public void decreaseStartIndex() {
currPageIndex--;
checkBound();
}
/**
* 起始下标递减
*/
public void decreaseStartIndex(int size) {
currPageIndex -= size;
checkBound();
}
/**
* 边界检测
*/
private void checkBound() {
if (currPageIndex < getStartPageIndex() - pageSize) {
currPageIndex = getStartPageIndex() - pageSize;
}
}
}
| [
"shihaowind@163.com"
] | shihaowind@163.com |
d33f79ab98c4c1a0ab15ee43daceeb05e5fe582a | 3e898a0edf2aebd3345c79615d9c533139d6666e | /sdk/compute/mgmt/src/main/java/com/azure/management/compute/TargetRegion.java | 8ea7df7c5d18034adb340ebee6370ecf02278291 | [
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-or-later",
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-generic-cla"
] | permissive | JasonWHowell/azure-sdk-for-java | 81fd8988895511080b0d1feff5112e1c47dad620 | 346475e8f6ebbcd09047797f7fcef4129c78ce43 | refs/heads/master | 2023-04-16T05:16:52.441674 | 2020-06-03T16:38:26 | 2020-06-03T16:38:26 | 269,185,086 | 0 | 0 | MIT | 2020-06-03T20:14:00 | 2020-06-03T20:14:00 | null | UTF-8 | Java | false | false | 3,493 | java | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.management.compute;
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** The TargetRegion model. */
@Fluent
public final class TargetRegion {
@JsonIgnore private final ClientLogger logger = new ClientLogger(TargetRegion.class);
/*
* The name of the region.
*/
@JsonProperty(value = "name", required = true)
private String name;
/*
* The number of replicas of the Image Version to be created per region.
* This property is updatable.
*/
@JsonProperty(value = "regionalReplicaCount")
private Integer regionalReplicaCount;
/*
* Specifies the storage account type to be used to store the image. This
* property is not updatable.
*/
@JsonProperty(value = "storageAccountType")
private StorageAccountType storageAccountType;
/**
* Get the name property: The name of the region.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: The name of the region.
*
* @param name the name value to set.
* @return the TargetRegion object itself.
*/
public TargetRegion withName(String name) {
this.name = name;
return this;
}
/**
* Get the regionalReplicaCount property: The number of replicas of the Image Version to be created per region. This
* property is updatable.
*
* @return the regionalReplicaCount value.
*/
public Integer regionalReplicaCount() {
return this.regionalReplicaCount;
}
/**
* Set the regionalReplicaCount property: The number of replicas of the Image Version to be created per region. This
* property is updatable.
*
* @param regionalReplicaCount the regionalReplicaCount value to set.
* @return the TargetRegion object itself.
*/
public TargetRegion withRegionalReplicaCount(Integer regionalReplicaCount) {
this.regionalReplicaCount = regionalReplicaCount;
return this;
}
/**
* Get the storageAccountType property: Specifies the storage account type to be used to store the image. This
* property is not updatable.
*
* @return the storageAccountType value.
*/
public StorageAccountType storageAccountType() {
return this.storageAccountType;
}
/**
* Set the storageAccountType property: Specifies the storage account type to be used to store the image. This
* property is not updatable.
*
* @param storageAccountType the storageAccountType value to set.
* @return the TargetRegion object itself.
*/
public TargetRegion withStorageAccountType(StorageAccountType storageAccountType) {
this.storageAccountType = storageAccountType;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (name() == null) {
throw logger
.logExceptionAsError(
new IllegalArgumentException("Missing required property name in model TargetRegion"));
}
}
}
| [
"noreply@github.com"
] | JasonWHowell.noreply@github.com |
cba89120c409638d8a446fa6f82eef5403fc2127 | 1ba27fc930ba20782e9ef703e0dc7b69391e191b | /Src/Base/src/main/java/com/compuware/caqs/service/SettingsSvc.java | aeb5675b04bc8c57d88b96ace69a4d9808ca746a | [] | no_license | LO-RAN/codeQualityPortal | b0d81c76968bdcfce659959d0122e398c647b09f | a7c26209a616d74910f88ce0d60a6dc148dda272 | refs/heads/master | 2023-07-11T18:39:04.819034 | 2022-03-31T15:37:56 | 2022-03-31T15:37:56 | 37,261,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,699 | java | package com.compuware.caqs.service;
import com.compuware.caqs.constants.Constants;
import com.compuware.caqs.constants.MessagesCodes;
import com.compuware.caqs.dao.factory.DaoFactory;
import com.compuware.caqs.dao.interfaces.SettingsDao;
import com.compuware.caqs.domain.dataschemas.settings.SettingValuesBean;
import com.compuware.caqs.domain.dataschemas.settings.Settings;
import com.compuware.caqs.exception.DataAccessException;
import com.compuware.toolbox.util.logging.LoggerManager;
public class SettingsSvc {
private static final SettingsSvc instance = new SettingsSvc();
private SettingsSvc() {
}
public static SettingsSvc getInstance() {
return instance;
}
protected static org.apache.log4j.Logger logger = LoggerManager.getLogger(Constants.LOG4J_IHM_LOGGER_KEY);
/**
* @return all available themes
*/
public SettingValuesBean getAvailablePreferences(Settings setting) {
SettingValuesBean retour = null;
SettingsDao dao = DaoFactory.getInstance().getSettingsDao();
retour = dao.getSettingValues(setting);
return retour;
}
/**
* @param setting the setting for which the value has to be retrieved
* @param userId the user for which the setting must be retrieved
* @return the preference value for the provided user
*/
public String getPreferenceForUser(Settings setting, String userId) {
String retour = null;
SettingsDao dao = DaoFactory.getInstance().getSettingsDao();
retour = dao.getSettingValueForUser(setting, userId);
return retour;
}
/**
* @param setting the setting for which the value has to be retrieved
* @param userId the user for which the setting must be retrieved
* @return the preference for the user, as a boolean
*/
public boolean getBooleanPreferenceForUser(Settings setting, String userId) {
boolean retour = false;
SettingsDao dao = DaoFactory.getInstance().getSettingsDao();
String val = dao.getSettingValueForUser(setting, userId);
if(val != null) {
retour = Boolean.valueOf(val);
}
return retour;
}
public MessagesCodes updatePreferenceForUser(Settings setting, String userId, String newTheme) {
MessagesCodes retour = MessagesCodes.NO_ERROR;
SettingsDao dao = DaoFactory.getInstance().getSettingsDao();
try {
dao.updateSettingValueForUser(setting, userId, newTheme);
} catch(DataAccessException exc) {
retour = MessagesCodes.DATABASE_ERROR;
}
return retour;
}
}
| [
"laurent.izac@gmail.com"
] | laurent.izac@gmail.com |
2235e320334fae3872a7cf23ccf6a7030158cb0a | fb65da797755449720a3377651aa52392281dae3 | /mod3/CSC212md3SLP/CSC212mod3SLP/src/MultiPropTaxGUI.java | f71de18923668c70c9073288f1dcbf26e3d00f55 | [] | no_license | tculpepp/CSC212 | 00a50d323120b16aba76d490b2516fe8d140ce1e | 01dcac7723d30bc593bb2b54e47fbb4e725afdee | refs/heads/master | 2020-12-09T23:17:36.700263 | 2020-02-25T22:34:24 | 2020-02-25T22:34:24 | 233,444,785 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,852 | java | /**
* MultiPropTaxGui is a simple program to take user inputs
* & and calculate a property tax amount for multiple houses.
* @author tculpepp
*/
import javafx.application.Application;
import javafx.geometry.Orientation;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.VBox;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
public class MultiPropTaxGUI extends Application {
private TextField numHousesInput, taxRateInput, houseValues[]; // input boxes
private Label messageLabel; //labels to interact with
private FlowPane centerFlow;
private Button nextButton, enterButton;
public static void main(String[] args) {
launch(args);
}
public void start(Stage stage) {
numHousesInput = new TextField();
numHousesInput.setMaxWidth(50);
taxRateInput = new TextField(); //input for tax rate
taxRateInput.setMaxWidth(100);
messageLabel = new Label(); //error label in case bad data is entered
Label exitLabel = new Label("(press 'E' to exit)"); //instructions on how to exit
enterButton = new Button("Calculate"); //setup the enter button
enterButton.setOnAction(e -> doEnter());
enterButton.setVisible(false);
nextButton = new Button("Next");
nextButton.setDefaultButton(true);
nextButton.setOnAction(e -> {
buildForm();
stage.sizeToScene(); //ensure the stage re-sizes
});
centerFlow = new FlowPane();
centerFlow.setPrefWrapLength(150); // preferred height = 150
centerFlow.setOrientation(Orientation.VERTICAL);
VBox bottomVBox = new VBox(messageLabel, exitLabel);
bottomVBox.setStyle("-fx-alignment: center;");
VBox leftVBox = new VBox(new Label("Number of Houses:"),numHousesInput,new Label("Tax Rate (%):"),taxRateInput,nextButton,enterButton);
leftVBox.setStyle("-fx-padding:10px;");
VBox centerVBox = new VBox(new Label("House Values:"), centerFlow);
centerVBox.setStyle("-fx-padding:10px;");
BorderPane root = new BorderPane();
root.setMinWidth(335);
root.setLeft(leftVBox);
root.setCenter(centerVBox);
root.setBottom(bottomVBox);
Scene scene = new Scene(root);
scene.addEventFilter(KeyEvent.KEY_PRESSED, (KeyEvent e) -> { //event filter to catch an E to exit
if (e.getCode() == KeyCode.E) System.exit(0);
});
stage.setScene(scene);
stage.setTitle("Property Tax Calculator");
stage.show();
}
private void buildForm() { //builds an array of textfields and adds them to the stage
int numHouses = (int)validateInput(numHousesInput);
if (numHouses != 0) {
numHousesInput.setStyle("-fx-border-color: black"); //back to black in case it's highlighted
numHousesInput.setDisable(true); //disable the texfield so there is no confusion later
houseValues = new TextField[numHouses]; //initialize the array houseValues[]
for (int i=0; i<numHouses; i++) { //Iterate through and create entry fields for each value
TextField houseValue = new TextField();
houseValues[i] = houseValue;
houseValue.setPrefWidth(100); //set the width
centerFlow.getChildren().add(houseValues[i]);
}
nextButton.setVisible(false); //turn off the next button
enterButton.setVisible(true); //turn on the enter button
enterButton.setDefaultButton(true); // the enter button is now default
}
}
private void doEnter() {
float houseTotal = 0; //holds total house value to be taxed
int numValidated = 0; //holds number of validated entries
float taxRate = validateInput(taxRateInput);
for (TextField hv : houseValues) {
if (validateInput(hv)!=0) { //if input validation =
houseTotal = Float.parseFloat(hv.getText()) + houseTotal;
numValidated++;
}
}
if (numValidated == houseValues.length && taxRate !=0) {
float taxAmount = houseTotal * taxRate/100;
messageLabel.setStyle("-fx-text-fill: black; -fx-font-weight:bolder; -fx-font-size:15;");
messageLabel.setText("Property Tax: $"+(String.format("%,.2f", taxAmount)));
}
}
//a method to check the input and return the parsed value or 0 if failed parse
private float validateInput(TextField userInput) {
try {
float validResult = Float.parseFloat(userInput.getText()); //try to parse the user input as a float
userInput.setStyle("-fx-border-color: black"); //make sure the text field isn't still highlighted
return validResult;
} catch (NumberFormatException e){
messageLabel.setText("Invalid Entry, Please Try Again"); //set the messageLabel text
messageLabel.setStyle("-fx-text-fill: red"); //color it red
userInput.setStyle("-fx-border-color: red"); //highlight the error box in red
return 0;
}
}
} | [
"tculpepp@gmail.com"
] | tculpepp@gmail.com |
dbd59ab8098467a5d64df209409065f62f3b3bcc | 9725f230d1330703a963fba3ba6f369a10887526 | /aliyun-java-sdk-elasticsearch/src/main/java/com/aliyuncs/elasticsearch/transform/v20170613/UpdateWhiteIpsResponseUnmarshaller.java | f3f57b339e8f7e804bae0c1f9e58c5c36a4afd99 | [
"Apache-2.0"
] | permissive | czy95czy/aliyun-openapi-java-sdk | 21e74b8f23cced2f65fb3a1f34648c7bf01e3c48 | 5410bde6a54fe40a471b43e50696f991f5df25aa | refs/heads/master | 2020-07-13T02:18:08.645626 | 2019-08-29T03:16:37 | 2019-08-29T03:16:37 | 204,966,560 | 0 | 0 | NOASSERTION | 2019-08-28T23:38:50 | 2019-08-28T15:38:50 | null | UTF-8 | Java | false | false | 1,592 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.elasticsearch.transform.v20170613;
import java.util.ArrayList;
import java.util.List;
import com.aliyuncs.elasticsearch.model.v20170613.UpdateWhiteIpsResponse;
import com.aliyuncs.elasticsearch.model.v20170613.UpdateWhiteIpsResponse.Result;
import com.aliyuncs.transform.UnmarshallerContext;
public class UpdateWhiteIpsResponseUnmarshaller {
public static UpdateWhiteIpsResponse unmarshall(UpdateWhiteIpsResponse updateWhiteIpsResponse, UnmarshallerContext context) {
updateWhiteIpsResponse.setRequestId(context.stringValue("UpdateWhiteIpsResponse.RequestId"));
Result result = new Result();
List<String> esIPWhitelist = new ArrayList<String>();
for (int i = 0; i < context.lengthValue("UpdateWhiteIpsResponse.Result.esIPWhitelist.Length"); i++) {
esIPWhitelist.add(context.stringValue("UpdateWhiteIpsResponse.Result.esIPWhitelist["+ i +"]"));
}
result.setEsIPWhitelist(esIPWhitelist);
updateWhiteIpsResponse.setResult(result);
return updateWhiteIpsResponse;
}
} | [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
e6632fd70a87e3c11e35b36c0e0d8b747d6b2900 | c47c254ca476c1f9969f8f3e89acb4d0618c14b6 | /datasets/github_java_10/9/81.java | 1e50eca4c54e16c4c1fd19e1a2761d21556db01f | [
"BSD-2-Clause"
] | permissive | yijunyu/demo | 5cf4e83f585254a28b31c4a050630b8f661a90c8 | 11c0c84081a3181494b9c469bda42a313c457ad2 | refs/heads/master | 2023-02-22T09:00:12.023083 | 2021-01-25T16:51:40 | 2021-01-25T16:51:40 | 175,939,000 | 3 | 6 | BSD-2-Clause | 2021-01-09T23:00:12 | 2019-03-16T07:13:00 | C | UTF-8 | Java | false | false | 654 | java | package 算法.几种常见的排序算法;
import java.util.Arrays;
public class SelectionSort {
public static void main(String[] args) {
int selectionSort[]= new int[]{5,2,8,4,9,1};
for (int i=0;i<selectionSort.length-1;i++){
int flag=i;
for (int j=i;j<selectionSort.length;j++){
if (selectionSort[j]<selectionSort[flag]){
flag=j;
}
}
int temp=selectionSort[flag];
selectionSort[flag]=selectionSort[i];
selectionSort[i]=temp;
}
System.out.println(Arrays.toString(selectionSort));
}
}
| [
"y.yu@open.ac.uk"
] | y.yu@open.ac.uk |
8b0e09a1ae9293b0cb9a51dc993a76092baeda2d | aa173f5b6146a7b80ecea2a5bd58853073ec2f83 | /rdf_core/src/com/hp/hpl/jena/mem/faster/NodeToTriplesMapFaster.java | 239aa6fbf420a8b00f1aa69b6c69a079ebf7999e | [] | no_license | danhlephuoc/rdfonthego | 1fc3df23e02a2550efc4b02e8ca73b8abaea660a | 8640a3ffd43587bb765c924adc72da2f010ac717 | refs/heads/master | 2021-01-19T16:51:28.322269 | 2011-10-26T12:13:49 | 2011-10-26T12:13:49 | 32,389,301 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,358 | java | /*
(c) Copyright 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
All rights reserved - see end of file.
$Id: NodeToTriplesMapFaster.java,v 1.33 2009/03/18 10:11:05 chris-dollin Exp $
*/
package com.hp.hpl.jena.mem.faster;
import java.util.*;
import com.hp.hpl.jena.graph.*;
import com.hp.hpl.jena.graph.Triple.Field;
//import com.hp.hpl.jena.graph.query.*;
import com.hp.hpl.jena.mem.*;
import com.hp.hpl.jena.util.iterator.*;
public class NodeToTriplesMapFaster extends NodeToTriplesMapBase
{
public NodeToTriplesMapFaster( Field indexField, Field f2, Field f3 )
{ super( indexField, f2, f3 ); }
/**
Add <code>t</code> to this NTM; the node <code>o</code> <i>must</i>
be the index node of the triple. Answer <code>true</code> iff the triple
was not previously in the set, ie, it really truly has been added.
*/
@Override public boolean add( Triple t )
{
Object o = getIndexField( t );
TripleBunch s = bunchMap.get( o );
if (s == null) bunchMap.put( o, s = new ArrayBunch() );
if (s.contains( t ))
return false;
else
{
if (s.size() == 9 && s instanceof ArrayBunch)
bunchMap.put( o, s = new HashedTripleBunch( s ) );
s.add( t );
size += 1;
return true;
}
}
/**
Remove <code>t</code> from this NTM. Answer <code>true</code> iff the
triple was previously in the set, ie, it really truly has been removed.
*/
@Override public boolean remove( Triple t )
{
Object o = getIndexField( t );
TripleBunch s = bunchMap.get( o );
if (s == null || !s.contains( t ))
return false;
else
{
s.remove( t );
size -= 1;
if (s.size() == 0) bunchMap.remove( o );
return true;
}
}
/**
Answer an iterator over all the triples in this NTM which have index node
<code>o</code>.
*/
@Override public Iterator<Triple> iterator( Object o, HashCommon.NotifyEmpty container )
{
// System.err.println( ">> BOINK" ); // if (true) throw new JenaException( "BOINK" );
TripleBunch s = bunchMap.get( o );
return s == null ? NullIterator.<Triple>instance() : s.iterator( container );
}
public class NotifyMe implements HashCommon.NotifyEmpty
{
protected final Object key;
public NotifyMe( Object key )
{ this.key = key; }
// TODO fix the way this interacts (badly) with iteration and CMEs.
public void emptied()
{ bunchMap.remove( key ); }
}
/**
Answer true iff this NTM contains the concrete triple <code>t</code>.
*/
@Override public boolean contains( Triple t )
{
TripleBunch s = bunchMap.get( getIndexField( t ) );
return s == null ? false : s.contains( t );
}
@Override public boolean containsBySameValueAs( Triple t )
{
TripleBunch s = bunchMap.get( getIndexField( t ) );
return s == null ? false : s.containsBySameValueAs( t );
}
/**
Answer an iterator over all the triples in this NTM which match
<code>pattern</code>. The index field of this NTM is guaranteed
concrete in the pattern.
*/
@Override public ExtendedIterator<Triple> iterator( Node index, Node n2, Node n3 )
{
Object indexValue = index.getIndexingValue();
TripleBunch s = bunchMap.get( indexValue );
// System.err.println( ">> ntmf::iterator: " + (s == null ? (Object) "None" : s.getClass()) );
return s == null
? NullIterator.<Triple>instance()
: f2.filterOn( n2 ).and( f3.filterOn( n3 ) )
.filterKeep( s.iterator( new NotifyMe( indexValue ) ) )
;
}
// public Applyer createFixedOApplyer( final ProcessedTriple Q )
// {
// final TripleBunch ss = bunchMap.get( Q.O.node.getIndexingValue() );
// if (ss == null)
// return Applyer.empty;
// else
// {
// return new Applyer()
// {
// final MatchOrBind x = MatchOrBind.createSP( Q );
//
// @Override
// public void applyToTriples( Domain d, Matcher m, StageElement next )
// { ss.app( d, next, x.reset( d ) ); }
// };
// }
// }
//
// public Applyer createBoundOApplyer( final ProcessedTriple pt )
// {
// return new Applyer()
// {
// final MatchOrBind x = MatchOrBind.createSP( pt );
//
// @Override public void applyToTriples( Domain d, Matcher m, StageElement next )
// {
// TripleBunch c = bunchMap.get( pt.O.finder( d ).getIndexingValue() );
// if (c != null) c.app( d, next, x.reset( d ) );
// }
// };
// }
//
// public Applyer createBoundSApplyer( final ProcessedTriple pt )
// {
// return new Applyer()
// {
// final MatchOrBind x = MatchOrBind.createPO( pt );
//
// @Override public void applyToTriples( Domain d, Matcher m, StageElement next )
// {
// TripleBunch c = bunchMap.get( pt.S.finder( d ) );
// if (c != null) c.app( d, next, x.reset( d ) );
// }
// };
// }
//
// public Applyer createFixedSApplyer( final ProcessedTriple Q )
// {
// final TripleBunch ss = bunchMap.get( Q.S.node );
// if (ss == null)
// return Applyer.empty;
// else
// {
// return new Applyer()
// {
// final MatchOrBind x = MatchOrBind.createPO( Q );
//
// @Override public void applyToTriples( Domain d, Matcher m, StageElement next )
// { ss.app( d, next, x.reset( d ) ); }
// };
// }
// }
protected TripleBunch get( Object index )
{ return bunchMap.get( index ); }
/**
Answer an iterator over all the triples that are indexed by the item <code>y</code>.
Note that <code>y</code> need not be a Node (because of indexing values).
*/
@Override public Iterator<Triple> iteratorForIndexed( Object y )
{ return get( y ).iterator(); }
}
/*
* (c) Copyright 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ | [
"ltanh18@gmail.com@6aefd41b-18be-dc13-23f8-84389d374314"
] | ltanh18@gmail.com@6aefd41b-18be-dc13-23f8-84389d374314 |
3df688822fb2b7ec5ddfa21162ab4335ee47c272 | 140787f5132f962a08acc0a33faca5ea5c068429 | /myAlgorithms/src/algorithms/search/Searcher.java | 32ce2f51796581498b9d18038ffc748c0cc150cd | [] | no_license | litalzigron/project | 03da10ef4c458345b73969d64bbf702e1abcdd00 | 5faa94d56b49d2f802ed256726edb92c623c2cb3 | refs/heads/master | 2020-08-27T06:39:37.849548 | 2015-09-03T11:36:21 | 2015-09-03T11:41:40 | 41,723,720 | 0 | 0 | null | null | null | null | WINDOWS-1255 | Java | false | false | 613 | java | package algorithms.search;
/**
* The Interface Searcher.
*
* @param <T> the generic type
*/
public interface Searcher <T>{
/**
* Search.
*
* @param s the s
* @return the solution
*/
// the search method//מחזיר מערך של כל המצבים המקומות שהיה בו
public Solution<T> search(Searchable<T> s);
/**
* Gets the number of nodes evaluated.
*
* @return the number of nodes evaluated
*/
// get how many nodes were evaluated by the algorithm
public int getNumberOfNodesEvaluated();
}
| [
"litalzigron@gmail.com"
] | litalzigron@gmail.com |
d56aea6b0e2df425b654172c14c582b2197a0f05 | 1eb8ad3a9846217b2d0420b23a1a7073d20ffb56 | /test/ProbabilityTest.java | 0460e8a02cebf52e5c66d4febb01a4587b477b26 | [] | no_license | sumitvarude/basic1 | 56909fef1957960bdd7c4acbac8e326bee3e5373 | 6c716473d2c67a8eb5b03204a86dc5b1b2e29439 | refs/heads/master | 2021-01-10T21:43:15.376128 | 2014-01-31T13:06:56 | 2014-01-31T13:06:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,731 | java | import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class ProbabilityTest {
@Test
public void testWillGiveProbability(){
Probability probability = new Probability(0.2);
assertEquals(0.2,probability.getValue(),0.0);
}
@Test
public void testWillGiveInverseProbability(){
Probability probability = new Probability(0.3);
assertEquals(new Probability(0.7),probability.getInverseProbability());
}
@Test(expected = IllegalArgumentException.class)
public void testWillValidateProbability(){
Probability probability = new Probability(5);
}
@Test
public void testWillGive(){
Probability probability = new Probability(2,4);
Probability expected = new Probability(0.5);
assertEquals(expected,probability);
}
@Test
public void testWillGiveANDResult(){
Probability probability1 = new Probability(0.3);
Probability probability2 = new Probability(0.4);
Probability expected = new Probability(0.12);
Probability result = probability1.and(probability2);
assertEquals(expected,result);
}
@Test
public void testWillGiveORResult(){
Probability p1 = new Probability(0.5);
Probability p2 = new Probability(0.5);
Probability expected = new Probability(0.75);
Probability result = p1.or(p2);
assertEquals(expected,result);
}
@Test
public void testWillGiveXORResult(){
Probability p1 = new Probability(0.5);
Probability p2 = new Probability(0.5);
Probability expected = new Probability(0.5);
Probability result = p1.xOr(p2);
assertEquals(expected,result);
}
}
| [
"sumitvarude@gmail.com"
] | sumitvarude@gmail.com |
1d15caca37ff87ad7d9709f792d21fb596dc48fc | 3cd76e1eaa386a980fb93582d55e51a326283695 | /crosffitzzang/src/main/java/kr/co/ict3/brd/mbr/MemberService.java | 0976a95437c55793397d6ec27bc27cb9b51469dd | [] | no_license | gellgellhell/crossfitzzang | edc236a4aa39000380fb8e231e252408dbab3b48 | 8d1ba5f7d3ddfc4cba9c3eb79a370bad6be8032d | refs/heads/main | 2023-01-12T10:06:30.162277 | 2020-11-13T06:37:43 | 2020-11-13T06:37:43 | 305,925,868 | 0 | 0 | null | 2020-10-21T07:56:45 | 2020-10-21T06:13:17 | Java | UTF-8 | Java | false | false | 457 | java | package kr.co.ict3.brd.mbr;
import java.util.List;
public interface MemberService {
public List<MemberBoardDTO> listAll();
public MemberBoardDTO detail(String bno);
public int likeCnt(String bno, String heart);
public int insHanjul(ReplyDTO inDto);
public List<ReplyDTO> viewHanjul(String bno);
public List<MemberBoardDTO> listSearch(SearchDTO inDto);
public int totlistCnt(SearchDTO inDto);
}//class
| [
"user@ICT3-24"
] | user@ICT3-24 |
1c7af5aa3cb607786de9e8c571d678ace8361e57 | 37799ab3875472a752bd377a0b8cae8aff8ae6be | /java/AULAS/src/principal/TesteAnimal.java | 8e5a0b7a0488ad4d3943cdbcceef236b8f5a8cb5 | [] | no_license | mlmaricato/turma21 | fe78f1bd0e497c365bc8fb0e28c0777e42c247e1 | c5477505b07aa5d90c2cd7b38292680a6b51dd0c | refs/heads/main | 2023-05-06T21:51:58.662261 | 2021-05-24T14:43:48 | 2021-05-24T14:43:48 | 363,942,388 | 0 | 0 | null | null | null | null | ISO-8859-3 | Java | false | false | 1,241 | java | package principal;
import java.util.Scanner;
import lista6heranca.Cachorro;
import lista6heranca.CachorroCaseiro;
import lista6heranca.Cavalo;
import lista6heranca.Preguica;
public class TesteAnimal {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner leia = new Scanner (System.in);
Cachorro cachorro1 = new Cachorro ("Du", 9);
Cavalo cavalo1 = new Cavalo ("Pietro", 5);
Preguica preguica1 = new Preguica("Tonya", 7);
CachorroCaseiro cachorro2 = new CachorroCaseiro ("Tomy", 4, "Grande", 'M');
System.out.println("O nome do cachorro é: "+cachorro1.getNome());
System.out.printf("O cachorro tem: %d anos.\n",cachorro1.getIdade());
cachorro1.som();
cachorro1.movimento();
System.out.println("O cachorro caseiro late assim...");
cachorro2.som();
System.out.println();
System.out.println("O nome do cavalo é: "+cavalo1.getNome());
System.out.printf("O cavalo tem: %d anos \n",cavalo1.getIdade());
cavalo1.som();
cavalo1.movimento();
System.out.println();
System.out.println("O nome da preguiça é: "+preguica1.getNome());
System.out.printf("A preguiça tem: %d anos \n",preguica1.getIdade());
preguica1.som();
preguica1.movimento();
}
}
| [
"malumaricatoo@gmail.com"
] | malumaricatoo@gmail.com |
833d6009b1de5919715cd17ecfdcbbcb20fa5a0a | 8b290fb5bb213c8fe83031f8d90ab4a59ab77d42 | /alps/vehiclecommerceservices/src/com/bp/alps/vehiclecommerceservices/order/AlpsOrderEntryManagementStrategy.java | defb3ba4e34972ac3d80505a96bc66185c40de81 | [] | no_license | SSJLYY/SR2 | f5a05df0b6f8333890e5b91a95f99e6c260b447a | e69bc5295c9a7e995462e2eec989d06983e2b938 | refs/heads/master | 2020-03-30T06:04:40.417452 | 2018-10-24T03:14:50 | 2018-10-24T03:14:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 847 | java | package com.bp.alps.vehiclecommerceservices.order;
import com.bp.alps.core.data.order.AlpsCommerceEntryResult;
import com.bp.alps.core.data.order.AlpsCommerceOrderEntryParameter;
import com.bp.alps.core.data.order.AlpsCommercePlaceOrderParameter;
import com.bp.alps.core.data.order.AlpsCommerceResult;
import de.hybris.platform.core.model.order.AbstractOrderModel;
import java.util.List;
public interface AlpsOrderEntryManagementStrategy
{
List<AlpsCommerceEntryResult> updateEntry(AlpsCommercePlaceOrderParameter parameter);
List<AlpsCommerceEntryResult> addEntryToOrder(AlpsCommercePlaceOrderParameter parameter);
List<AlpsCommerceEntryResult> getUnavailableProduct(final List<AlpsCommerceOrderEntryParameter> parameterList);
List<AlpsCommerceOrderEntryParameter> calculateIncrementEntry(AlpsCommercePlaceOrderParameter parameter);
}
| [
"18621616775@163.com"
] | 18621616775@163.com |
635b65a2d301944eeaffd99462cd58f1d5f8259c | 975cb35475909580abe1645ba3cf79666d878be8 | /src/main/java/com/soulmonk/ndfsm/repository/time/ServiceRepository.java | d73081245b997fa9cdf14070a16ccd07e7782bfa | [] | no_license | soulmonk/ndfsm_workspace_java | e46073331a413ceda265ba116e1bbb05caa78af3 | b5e57978cc100e1862f591a01c3c18ea2811b776 | refs/heads/master | 2020-12-21T00:15:48.079200 | 2019-05-20T09:22:03 | 2019-05-20T09:22:03 | 29,188,668 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 405 | java | package com.soulmonk.ndfsm.repository.time;
import com.soulmonk.ndfsm.domain.time.Service;
import com.soulmonk.ndfsm.domain.user.User;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface ServiceRepository extends JpaRepository<Service, Long> {
public List<Service> findByUser(User user);
public Service findByIdAndUser(Long id, User user);
}
| [
"fsoulmonk@gmail.com"
] | fsoulmonk@gmail.com |
6ca7b7947e37359a90e0fcb3c348794e3ae81b6c | a21d611631a2d785b8932bb60ad38442924a56d3 | /ADV_JAVA/009_28_OCT_2020/src/com/app/entity/AccountType.java | 401995729cadf4edf48c6ee2c884d6ffec3917c2 | [] | no_license | AlexeiRubin/CDAC_ACTS | 18b2da7bbd2d20c757c0e400adeb563f20fdac28 | b5d8dc553d14a31187c6ca62b66872f05bfae4bd | refs/heads/master | 2023-01-29T09:32:00.939444 | 2020-12-14T07:57:21 | 2020-12-14T07:57:21 | 244,440,141 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 89 | java | package com.app.entity;
public enum AccountType {
SAVING, CURRENT, FD, LOAN, DMAT
} | [
"noreply@github.com"
] | AlexeiRubin.noreply@github.com |
48db53d5ea65dfd8faa97d5c705db773483817b1 | dee197d90a655afbd229048c26a585b0333830f1 | /part05-Part05_17.Money/src/main/java/Money.java | 19ac283ee0fd9114e2d959f29f85b361df07ffd7 | [] | no_license | vbrodar/mooc-java-course | 9944574623ba23009441f8e35da1de0928214ba7 | b83d3e123f1624832b82e400b8b7d67654c55143 | refs/heads/main | 2023-04-24T05:43:03.909468 | 2021-05-20T10:08:08 | 2021-05-20T10:08:08 | 366,278,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,539 | java |
public class Money {
private final int euros;
private final int cents;
public Money(int euros, int cents) {
if (cents > 99) {
euros = euros + cents / 100;
cents = cents % 100;
}
this.euros = euros;
this.cents = cents;
}
public int euros() {
return this.euros;
}
public int cents() {
return this.cents;
}
public Money plus(Money addition) {
int newEuros = this.euros + addition.euros();
int newCents = this.cents + addition.cents();
if (newCents > 99) {
newCents -= 100;
newEuros += 1;
}
return new Money(newEuros, newCents);
}
public boolean lessThan(Money compared) {
double thisTotal = this.euros + this.cents / 100.0;
double compareTotal = compared.euros() + compared.cents() / 100.0;
return thisTotal < compareTotal;
}
public Money minus(Money decreaser) {
int euros = this.euros - decreaser.euros();
int cents = this.cents - decreaser.cents();
if (cents < 0) {
cents += 100;
euros -= 1;
}
// if the value becomes negative, return zero
if (euros < 0) {
return new Money(0, 0);
}
return new Money(euros, cents);
}
public String toString() {
String zero = "";
if (this.cents < 10) {
zero = "0";
}
return this.euros + "." + zero + this.cents + "e";
}
}
| [
"vedran.brodar@hotmail.com"
] | vedran.brodar@hotmail.com |
f6c08167316add35a67ead426dd7971f17a0fe35 | b19a2abb002a0f2aff5c8a723a328ad38c1fc3d6 | /app/src/androidTest/java/com/eziosoft/wltoysrobot/ExampleInstrumentedTest.java | c3067a2d2ab7d2b2543e761902c47d3f6ce6fd41 | [] | no_license | eziosoft/wltoys-f4-robot-wifi-control | 4526c6347c76d6c76e9ba984b83c66d8388a4737 | 25722fec338dbeca60335bba47d34bcfb2afa29d | refs/heads/master | 2021-09-23T11:04:49.590534 | 2018-09-21T21:18:15 | 2018-09-21T21:18:15 | 114,179,905 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 749 | java | package com.eziosoft.wltoysrobot;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.eziosoft.wltoysrobot", appContext.getPackageName());
}
}
| [
"eziosoft@gmail.com"
] | eziosoft@gmail.com |
0bd05160613b6a5b8284dc19ce0ff105c0f5e18b | b8f3cfd25ef8553ba21b89de674428faef478c7e | /app/src/main/java/com/dzkandian/common/uitls/processes/Stat.java | a5bed25389855a655c7ec595c6cde30616999143 | [] | no_license | DarianLiu/dzkd | 236747055d5eb1214756c95a2b284fdf139c943c | 9ec3d08ac58a265de71b0396918eec5b9e5c3311 | refs/heads/master | 2022-01-10T07:08:25.746807 | 2019-05-13T01:26:15 | 2019-05-13T01:26:15 | 186,324,724 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 22,573 | java | /*
* Copyright (C) 2015. Jared Rummler <jared.rummler@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.dzkandian.common.uitls.processes;
import android.os.Parcel;
import java.io.IOException;
import java.util.Locale;
/**
* <p>/proc/[pid]/stat</p>
*
* <p>Status information about the process. This is used by ps(1). It is defined in the kernel
* source file fs/proc/array.c.</p>
*
* <p>The fields, in order, with their proper scanf(3) format specifiers, are:</p>
*
* <ol>
* <li>pid %d The process ID.</li>
* <li>comm %s The filename of the executable, in parentheses. This is visible whether or not
* the executable is swapped out.</li>
* <li>state %c One of the following characters, indicating process state:
* <ul>
* <li>R Running</li>
* <li>S Sleeping in an interruptible wait</li>
* <li>D Waiting in uninterruptible disk sleep</li>
* <li>Z Zombie</li>
* <li>T Stopped (on a signal) or (before Linux 2.6.33) trace stopped</li>
* <li>t Tracing stop (Linux 2.6.33 onward)</li>
* <li>W Paging (only before Linux 2.6.0)</li>
* <li>X Dead (from Linux 2.6.0 onward)</li>
* <li>x Dead (Linux 2.6.33 to 3.13 only)</li>
* <li>K Wakekill (Linux 2.6.33 to 3.13 only)</li>
* <li>W Waking (Linux 2.6.33 to 3.13 only)</li>
* <li>P Parked (Linux 3.9 to 3.13 only)</li>
* </ul>
* </li>
* <li>ppid %d The PID of the parent of this process.</li>
* <li>pgrp %d The process group ID of the process.</li>
* <li>session %d The session ID of the process.</li>
* <li>tty_nr %d The controlling terminal of the process. (The minor device number is contained
* in the combination of bits 31 to 20 and 7 to 0; the major device number is in bits 15 to 8.)
* </li>
* <li>tpgid %d The ID of the foreground process group of the controlling terminal of the
* process.</li>
* <li>flags %u The kernel flags word of the process. For bit meanings, see the PF_* defines in
* the Linux kernel source file include/linux/sched.h. Details depend on the kernel version.
* The format for this field was %lu before Linux 2.6.</li>
* <li>minflt %lu The number of minor faults the process has made which have not required
* loading a memory page from disk.</li>
* <li>cminflt %lu The number of minor faults that the process's waited-for children have
* made</li>
* <li>majflt %lu The number of major faults the process has made which have required loading a
* memory page from disk.</li>
* <li>cmajflt %lu The number of major faults that the process's waited-for children have
* made</li>
* <li>utime %lu Amount of time that this process has been scheduled in user mode, measured in
* clock ticks (divide by sysconf(_SC_CLK_TCK)). This includes guest time, guest_time (time
* spent running a virtual CPU, see below), so that applications that are not aware of the guest
* time field do not lose that time from their calculations.</li>
* <li>stime %lu Amount of time that this process has been scheduled in kernel mode, measured
* in clock ticks (divide by sysconf(_SC_CLK_TCK)).</li>
* <li>cutime %ld Amount of time that this process's waited-for children have been scheduled in
* user mode, measured in clock ticks (divide by sysconf(_SC_CLK_TCK)). (See also times(2).)
* This includes guest time, cguest_time (time spent running a virtual CPU, see below).</li>
* <li>cstime %ld Amount of time that this process's waited-for children have been scheduled in
* kernel mode, measured in clock ticks (divide by sysconf(_SC_CLK_TCK)).</li>
* <li>priority %ld (Explanation for Linux 2.6) For processes running a real-time scheduling
* policy (policy below; see sched_setscheduler(2)), this is the negated scheduling priority,
* minus one; that is, a number in the range -2 to -100, corresponding to real-time priorities 1
* to 99. For processes running under a non-real-time scheduling policy, this is the raw nice
* value (setpriority(2)) as represented in the kernel. The kernel stores nice values as numbers
* in the range 0 (high) to 39 (low), corresponding to the user-visible nice range of -20 to 19.
* Before Linux 2.6, this was a scaled value based on the scheduler weighting given to this
* process</li>
* <li>nice %ld The nice value (see setpriority(2)), a value in the range 19 (low priority) to
* -20 (high priority).</li>
* <li>num_threads %ld Number of threads in this process (since Linux 2.6). Before kernel 2.6,
* this field was hard coded to 0 as a placeholder for an earlier removed field.</li>
* <li>itrealvalue %ld The time in jiffies before the next SIGALRM is sent to the process due
* to an interval timer. Since kernel 2.6.17, this field is no longer maintained, and is hard
* coded as 0.</li>
* <li>starttime %llu The time the process started after system boot. In kernels before Linux
* 2.6, this value was expressed in jiffies. Since Linux 2.6, the value is expressed in clock
* ticks (divide by sysconf(_SC_CLK_TCK)).</li>
* <li>The format for this field was %lu before Linux 2.6. (23) vsize %lu Virtual memory size
* in bytes.</li>
* <li>rss %ld Resident Set Size: number of pages the process has in real memory. This is just
* the pages which count toward text, data, or stack space. This does not include pages which
* have not been demand-loaded in, or which are swapped out.</li>
* <li>rsslim %lu Current soft limit in bytes on the rss of the process; see the description of
* RLIMIT_RSS in getrlimit(2).</li>
* <li>startcode %lu The address above which program text can run.</li>
* <li>endcode %lu The address below which program text can run.</li>
* <li>startstack %lu The address of the start (i.e., bottom) of the stack.</li>
* <li>kstkesp %lu The current value of ESP (stack pointer), as found in the kernel stack page
* for the process.</li>
* <li>kstkeip %lu The current EIP (instruction pointer).</li>
* <li>signal %lu The bitmap of pending signals, displayed as a decimal number. Obsolete,
* because it does not provide information on real-time signals; use /proc/[pid]/status
* instead</li>
* <li>blocked %lu The bitmap of blocked signals, displayed as a decimal number. Obsolete,
* because it does not provide information on real-time signals; use /proc/[pid]/status
* instead</li>
* <li>sigignore %lu The bitmap of ignored signals, displayed as a decimal number. Obsolete,
* because it does not provide information on real-time signals; use /proc/[pid]/status
* instead</li>
* <li>sigcatch %lu The bitmap of caught signals, displayed as a decimal number. Obsolete,
* because it does not provide information on real-time signals; use /proc/[pid]/status
* instead.</li>
* <li>wchan %lu This is the "channel" in which the process is waiting. It is the address of a
* location in the kernel where the process is sleeping. The corresponding symbolic name can be
* found in /proc/[pid]/wchan.</li>
* <li>nswap %lu Number of pages swapped (not maintained).</li>
* <li>cnswap %lu Cumulative nswap for child processes (not maintained).</li>
* <li>exit_signal %d (since Linux 2.1.22) Signal to be sent to parent when we die.</li>
* <li>processor %d (since Linux 2.2.8) CPU number last executed on.</li>
* <li>rt_priority %u (since Linux 2.5.19) Real-time scheduling priority, a number in the
* range 1 to 99 for processes scheduled under a real-time policy, or 0, for non-real-time
* processes (see sched_setscheduler(2)).</li>
* <li>policy %u (since Linux 2.5.19) Scheduling policy (see sched_setscheduler(2)). Decode
* using the SCHED_* constants in linux/sched.h. The format for this field was %lu before Linux
* 2.6.22.</li>
* <li>delayacct_blkio_ticks %llu (since Linux 2.6.18) Aggregated block I/O delays, measured
* in clock ticks (centiseconds).</li>
* <li>guest_time %lu (since Linux 2.6.24) Guest time of the process (time spent running a
* virtual CPU for a guest operating system), measured in clock ticks (divide by
* sysconf(_SC_CLK_TCK)).</li>
* <li>cguest_time %ld (since Linux 2.6.24) Guest time of the process's children, measured in
* clock ticks (divide by sysconf(_SC_CLK_TCK)).</li>
* <li>start_data %lu (since Linux 3.3) Address above which program initialized and
* uninitialized (BSS) data are placed.</li>
* <li>end_data %lu (since Linux 3.3) Address below which program initialized and
* uninitialized (BSS) data are placed.</li>
* <li>start_brk %lu (since Linux 3.3) Address above which program heap can be expanded with
* brk(2).</li>
* <li>arg_start %lu (since Linux 3.5) Address above which program command-line arguments
* (argv) are placed.</li>
* <li>arg_end %lu (since Linux 3.5) Address below program command-line arguments (argv) are
* placed.</li>
* <li>env_start %lu (since Linux 3.5) Address above which program environment is placed.</li>
* <li>env_end %lu (since Linux 3.5) Address below which program environment is placed.</li>
* <li>exit_code %d (since Linux 3.5) The thread's exit status in the form reported by
* waitpid(2).</li>
* </ol>
*/
public final class Stat extends ProcFile {
/**
* Read /proc/[pid]/stat.
*
* @param pid
* the process id.
* @return the {@link Stat}
* @throws IOException
* if the file does not exist or we don't have read permissions.
*/
public static Stat get(int pid) throws IOException {
return new Stat(String.format(Locale.ENGLISH, "/proc/%d/stat", pid));
}
private final String[] fields;
private Stat(String path) throws IOException {
super(path);
fields = content.split("\\s+");
}
private Stat(Parcel in) {
super(in);
this.fields = in.createStringArray();
}
/** The process ID. */
public int getPid() {
return Integer.parseInt(fields[0]);
}
/**
* The filename of the executable, in parentheses. This is visible whether or not the
* executable is swapped out.
*/
public String getComm() {
return fields[1].replace("(", "").replace(")", "");
}
/**
* <p>One of the following characters, indicating process state:</p>
*
* <ul>
* <li>'R' Running</li>
* <li>'S' Sleeping in an interruptible wait</li>
* <li>'D' Waiting in uninterruptible disk sleep</li>
* <li>'Z' Zombie</li>
* <li>'T' Stopped (on a signal) or (before Linux 2.6.33) trace stopped</li>
* <li>'t' Tracing stop (Linux 2.6.33 onward)</li>
* <li>'W' Paging (only before Linux 2.6.0)</li>
* <li>'X' Dead (from Linux 2.6.0 onward)</li>
* <li>'x' Dead (Linux 2.6.33 to 3.13 only)</li>
* <li>'K' Wakekill (Linux 2.6.33 to 3.13 only)</li>
* <li>'W' Waking (Linux 2.6.33 to 3.13 only)</li>
* <li>'P' Parked (Linux 3.9 to 3.13 only)</li>
* </ul>
*/
public char state() {
return fields[2].charAt(0);
}
/**
* The PID of the parent of this process.
*/
public int ppid() {
return Integer.parseInt(fields[3]);
}
/**
* The process group ID of the process.
*/
public int pgrp() {
return Integer.parseInt(fields[4]);
}
/**
* The session ID of the process.
*/
public int session() {
return Integer.parseInt(fields[5]);
}
/**
* The controlling terminal of the process. (The minor device number is contained in the
* combination of bits 31 to 20 and 7 to 0; the major device number is in bits 15 to 8.)
*/
public int tty_nr() {
return Integer.parseInt(fields[6]);
}
/**
* The ID of the foreground process group of the controlling terminal of the process.
*/
public int tpgid() {
return Integer.parseInt(fields[7]);
}
/**
* <p>The kernel flags word of the process. For bit meanings, see the PF_* defines in the Linux
* kernel source file include/linux/sched.h. Details depend on the kernel version.</p>
*
* <p>The format for this field was %lu before Linux 2.6.</p>
*/
public int flags() {
return Integer.parseInt(fields[8]);
}
/**
* The number of minor faults the process has made which have not required loading a memory
* page from disk.
*/
public long minflt() {
return Long.parseLong(fields[9]);
}
/**
* The number of minor faults that the process's waited-for children have made.
*/
public long cminflt() {
return Long.parseLong(fields[10]);
}
/**
* The number of major faults the process has made which have required loading a memory page
* from disk.
*/
public long majflt() {
return Long.parseLong(fields[11]);
}
/**
* The number of major faults that the process's waited-for children have made.
*/
public long cmajflt() {
return Long.parseLong(fields[12]);
}
/**
* Amount of time that this process has been scheduled in user mode, measured in clock ticks
* (divide by sysconf(_SC_CLK_TCK)). This includes guest time, guest_time (time spent running
* a virtual CPU, see below), so that applications that are not aware of the guest time field
* do not lose that time from their calculations.
*/
public long utime() {
return Long.parseLong(fields[13]);
}
/**
* Amount of time that this process has been scheduled in kernel mode, measured in clock ticks
* (divide by sysconf(_SC_CLK_TCK)).
*/
public long stime() {
return Long.parseLong(fields[14]);
}
/**
* Amount of time that this process's waited-for children have been scheduled in user mode,
* measured in clock ticks (divide by sysconf(_SC_CLK_TCK)). (See also times(2).) This
* includes guest time, cguest_time (time spent running a virtual CPU, see below).
*/
public long cutime() {
return Long.parseLong(fields[15]);
}
/**
* Amount of time that this process's waited-for children have been scheduled in kernel mode,
* measured in clock ticks (divide by sysconf(_SC_CLK_TCK)).
*/
public long cstime() {
return Long.parseLong(fields[16]);
}
/**
* <p>(Explanation for Linux 2.6) For processes running a real-time scheduling policy (policy
* below; see sched_setscheduler(2)), this is the negated scheduling priority, minus one; that
* is,
* a number in the range -2 to -100, corresponding to real-time priorities 1 to 99. For
* processes
* running under a non-real-time scheduling policy, this is the raw nice value (setpriority(2))
* as
* represented in the kernel. The kernel stores nice values as numbers in the range 0 (high) to
* 39 (low), corresponding to the user-visible nice range of -20 to 19.</p>
*
* <p>Before Linux 2.6, this was a scaled value based on the scheduler weighting given to this
* process.</p>
*/
public long priority() {
return Long.parseLong(fields[17]);
}
/**
* The nice value (see setpriority(2)), a value in the range 19 (low priority) to -20 (high
* priority).
*/
public int nice() {
return Integer.parseInt(fields[18]);
}
/**
* Number of threads in this process (since Linux 2.6). Before kernel 2.6, this field was hard
* coded to 0 as a placeholder for an earlier removed field.
*/
public long num_threads() {
return Long.parseLong(fields[19]);
}
/**
* The time in jiffies before the next SIGALRM is sent to the process due to an interval timer.
* Since kernel 2.6.17, this field is no longer maintained, and is hard coded as 0.
*/
public long itrealvalue() {
return Long.parseLong(fields[20]);
}
/**
* <p>The time the process started after system boot. In kernels before Linux 2.6, this value was
* expressed in jiffies. Since Linux 2.6, the value is expressed in clock ticks (divide by
* sysconf(_SC_CLK_TCK)).</p>
*
* <p>The format for this field was %lu before Linux 2.6.</p>
*/
public long starttime() {
return Long.parseLong(fields[21]);
}
/**
* Virtual memory size in bytes.
*/
public long vsize() {
return Long.parseLong(fields[22]);
}
/**
* Resident Set Size: number of pages the process has in real memory. This is just the pages
* which count toward text, data, or stack space. This does not include pages which have not
* been demand-loaded in, or which are swapped out.
*/
public long rss() {
return Long.parseLong(fields[23]);
}
/**
* Current soft limit in bytes on the rss of the process; see the description of RLIMIT_RSS in
* getrlimit(2).
*/
public long rsslim() {
return Long.parseLong(fields[24]);
}
/**
* The address above which program text can run.
*/
public long startcode() {
return Long.parseLong(fields[25]);
}
/**
* The address below which program text can run.
*/
public long endcode() {
return Long.parseLong(fields[26]);
}
/**
* The address of the start (i.e., bottom) of the stack.
*/
public long startstack() {
return Long.parseLong(fields[27]);
}
/**
* The current value of ESP (stack pointer), as found in the kernel stack page for the process.
*/
public long kstkesp() {
return Long.parseLong(fields[28]);
}
/**
* The current EIP (instruction pointer).
*/
public long kstkeip() {
return Long.parseLong(fields[29]);
}
/**
* The bitmap of pending signals, displayed as a decimal number. Obsolete, because it does not
* provide information on real-time signals; use /proc/[pid]/status instead.
*/
public long signal() {
return Long.parseLong(fields[30]);
}
/**
* The bitmap of blocked signals, displayed as a decimal number. Obsolete, because it does not
* provide information on real-time signals; use /proc/[pid]/status instead.
*/
public long blocked() {
return Long.parseLong(fields[31]);
}
/**
* The bitmap of ignored signals, displayed as a decimal number. Obsolete, because it does not
* provide information on real-time signals; use /proc/[pid]/status instead.
*/
public long sigignore() {
return Long.parseLong(fields[32]);
}
/**
* The bitmap of caught signals, displayed as a decimal number. Obsolete, because it does not
* provide information on real-time signals; use /proc/[pid]/status instead.
*/
public long sigcatch() {
return Long.parseLong(fields[33]);
}
/**
* This is the "channel" in which the process is waiting. It is the address of a location in the
* kernel where the process is sleeping. The corresponding symbolic name can be found in
* /proc/[pid]/wchan.
*/
public long wchan() {
return Long.parseLong(fields[34]);
}
/**
* Number of pages swapped (not maintained).
*/
public long nswap() {
return Long.parseLong(fields[35]);
}
/**
* Cumulative nswap for child processes (not maintained).
*/
public long cnswap() {
return Long.parseLong(fields[36]);
}
/**
* (since Linux 2.1.22)
* Signal to be sent to parent when we die.
*/
public int exit_signal() {
return Integer.parseInt(fields[37]);
}
/**
* (since Linux 2.2.8)
* CPU number last executed on.
*/
public int processor() {
return Integer.parseInt(fields[38]);
}
/**
* (since Linux 2.5.19)
* Real-time scheduling priority, a number in the range 1 to 99 for processes scheduled under a
* real-time policy, or 0, for non-real-time processes (see sched_setscheduler(2)).
*/
public int rt_priority() {
return Integer.parseInt(fields[39]);
}
/**
* <p>(since Linux 2.5.19) Scheduling policy (see sched_setscheduler(2)). Decode using the
* SCHED_*
* constants in linux/sched.h.</p>
*
* <p>The format for this field was %lu before Linux 2.6.22.</p>
*/
public int policy() {
return Integer.parseInt(fields[40]);
}
/**
* (since Linux 2.6.18)
* Aggregated block I/O delays, measured in clock ticks (centiseconds).
*/
public long delayacct_blkio_ticks() {
return Long.parseLong(fields[41]);
}
/**
* (since Linux 2.6.24)
* Guest time of the process (time spent running a virtual CPU for a guest operating system),
* measured in clock ticks (divide by sysconf(_SC_CLK_TCK)).
*/
public long guest_time() {
return Long.parseLong(fields[42]);
}
/**
* (since Linux 2.6.24)
* Guest time of the process's children, measured in clock ticks (divide by
* sysconf(_SC_CLK_TCK)).
*/
public long cguest_time() {
return Long.parseLong(fields[43]);
}
/**
* (since Linux 3.3)
* Address above which program initialized and uninitialized (BSS) data are placed.
*/
public long start_data() {
return Long.parseLong(fields[44]);
}
/**
* (since Linux 3.3)
* Address below which program initialized and uninitialized (BSS) data are placed.
*/
public long end_data() {
return Long.parseLong(fields[45]);
}
/**
* (since Linux 3.3)
* Address above which program heap can be expanded with brk(2).
*/
public long start_brk() {
return Long.parseLong(fields[46]);
}
/**
* (since Linux 3.5)
* Address above which program command-line arguments (argv) are placed.
*/
public long arg_start() {
return Long.parseLong(fields[47]);
}
/**
* (since Linux 3.5)
* Address below program command-line arguments (argv) are placed.
*/
public long arg_end() {
return Long.parseLong(fields[48]);
}
/**
* (since Linux 3.5)
* Address above which program environment is placed.
*/
public long env_start() {
return Long.parseLong(fields[49]);
}
/**
* (since Linux 3.5)
* Address below which program environment is placed.
*/
public long env_end() {
return Long.parseLong(fields[50]);
}
/**
* (since Linux 3.5)
* The thread's exit status in the form reported by waitpid(2).
*/
public int exit_code() {
return Integer.parseInt(fields[51]);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeStringArray(fields);
}
public static final Creator<Stat> CREATOR = new Creator<Stat>() {
@Override
public Stat createFromParcel(Parcel source) {
return new Stat(source);
}
@Override
public Stat[] newArray(int size) {
return new Stat[size];
}
};
}
| [
"darian.liu@foxmail.com"
] | darian.liu@foxmail.com |
9a399797d380f3ca0318dff868dfe3ff0a3d1451 | 0441cb109fdf70da407fd277aecc8c2b21efae56 | /IIHT Project/MWProject/springmvchelloworld/src/main/java/com/example/stockspring/HelloController.java | 7acb67bc3bd73e6a539427ed03f3071a0d5c890b | [] | no_license | SatirthaSaha/FinalProject | f05e6a6bd31bc681033ba6b2291e613c9ce601ca | 853bf374f32573e19a6019fc06a13c85d7a548d0 | refs/heads/master | 2022-07-13T05:06:07.278831 | 2019-09-27T13:18:29 | 2019-09-27T13:18:29 | 211,323,244 | 0 | 0 | null | 2022-06-29T17:40:36 | 2019-09-27T13:16:28 | Java | UTF-8 | Java | false | false | 1,307 | java | package com.example.stockspring;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class HelloController {
@RequestMapping(path="/hello")
public String sayHello(){
System.out.println("hello");
return "helloWorld";
}
@RequestMapping(value="/values0")
public ModelAndView getEmployeeList0(){
System.out.println("inside abc");
ModelAndView mv=new ModelAndView();
mv.setViewName("abc");
mv.addObject("messaage", "welcome to first example of forwarding message");
mv.addObject("messaage1", "this is message 1");
return mv;
}
@RequestMapping(value="/list")
public ModelAndView getEmployeeList10(){
System.out.println("inside abc");
ModelAndView mv=new ModelAndView();
List<Employee> employeeList=new ArrayList<Employee>();
Employee ramesh=new Employee();
ramesh.setEmployeeId(1001);
ramesh.setName("ramesh kumar");
Employee suresh=new Employee();
suresh.setEmployeeId(1002);
suresh.setName("suresh kumar");
employeeList.add(ramesh);
employeeList.add(suresh);
mv.addObject("list",employeeList);
mv.setViewName("employeeList");
return mv;
}
}
| [
"satirtha1996@gmail.com"
] | satirtha1996@gmail.com |
ffd9a77439cc8919fe6239f4dde010453c1f3c77 | 65aee608515bb994f9779741d564fc60fbe9432f | /base/src/main/java/com/flb/base/pinyin/ToPinYinUtils.java | 74f09f603eb648fcaecce13a9028ca0354775b0c | [] | no_license | flb775141545/base | 8624498ae07d61a2c28d6046b767fe8e180cd78d | 180973bd77606f886204f8696fe4730f6a7e1eac | refs/heads/master | 2021-01-11T04:00:22.831285 | 2016-10-19T14:09:01 | 2016-10-19T14:09:01 | 71,259,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,352 | java | package com.flb.base.pinyin;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import com.flb.base.common.StringUtils;
public class ToPinYinUtils
{
public static String[] toPinYin(String sChinese)
{
HanyuPinyinOutputFormat outputFormat = new HanyuPinyinOutputFormat();
outputFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
outputFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
char[] chars = sChinese.toCharArray();
String[] sPinYin = new String[2];
String sPinYin_1 = "";
StringBuilder sPinYin_2 = new StringBuilder();
for (char temp : chars)
{
if (' ' != temp)
{
try
{
String pinyin = concatPinyinStringArray(PinyinHelper.toHanyuPinyinStringArray(temp, outputFormat));
if (!StringUtils.isTrimEmpty(pinyin))
{
sPinYin_1 += pinyin;
sPinYin_2.append(pinyin.substring(0, 1));
}
}
catch(Exception ex)
{
}
}
}
sPinYin[0] = sPinYin_1;
sPinYin[1] = sPinYin_2.toString();
return sPinYin;
}
private static String concatPinyinStringArray(String[] pinyinArray)
{
return pinyinArray[0].toString();
}
}
| [
"775141545@qq.com"
] | 775141545@qq.com |
93e4c86def50b5454a59bf317077711848051e37 | d1edc13241cb658068939f9fce17a8ab07fbdbd5 | /converter/src/fi/ni/ifc2x3/IfcAddress.java | bd5b04b02b273bb6f765c3802bb7d76f7aa27d45 | [] | no_license | lewismc/IFC-to-RDF-converter | c4e0d05822d018f75598434bbf820e27413dce77 | efe5775417e92978c2032e15344fa8ec04277235 | refs/heads/master | 2020-12-25T02:50:06.051976 | 2013-02-09T08:59:22 | 2013-02-09T08:59:22 | 8,226,606 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,495 | java | package fi.ni.ifc2x3;
import fi.ni.ifc2x3.interfaces.*;
import fi.ni.*;
import java.util.*;
/*
* IFC Java class
* @author Jyrki Oraskari
* @license This work is licensed under a Creative Commons Attribution 3.0 Unported License.
* http://creativecommons.org/licenses/by/3.0/
*/
public class IfcAddress extends Thing implements IfcObjectReferenceSelect
{
// The property attributes
String purpose;
String description;
String userDefinedPurpose;
// The inverse attributes
InverseLinksList<IfcPerson> ofPerson= new InverseLinksList<IfcPerson>();
InverseLinksList<IfcOrganization> ofOrganization= new InverseLinksList<IfcOrganization>();
// Getters and setters of properties
public String getPurpose() {
return purpose;
}
public void setPurpose(String value){
this.purpose=value;
}
public String getDescription() {
return description;
}
public void setDescription(String value){
this.description=value;
}
public String getUserDefinedPurpose() {
return userDefinedPurpose;
}
public void setUserDefinedPurpose(String value){
this.userDefinedPurpose=value;
}
// Getters and setters of inverse values
public InverseLinksList<IfcPerson> getOfPerson() {
return ofPerson;
}
public void setOfPerson(IfcPerson value){
this.ofPerson.add(value);
}
public InverseLinksList<IfcOrganization> getOfOrganization() {
return ofOrganization;
}
public void setOfOrganization(IfcOrganization value){
this.ofOrganization.add(value);
}
}
| [
"davy.vandeursen@gmail.com"
] | davy.vandeursen@gmail.com |
4908409b75a5e06729320d1922a29c1c4d0b8bda | 38efabad05e9adf50d9782a39cc5fd82b7a5a2fc | /PathPoint.java | 84bb05663f13308169aabd413f30c35a8085b3e7 | [
"MIT"
] | permissive | Imakestuff123/Haruhi-Suzumiya-RTS-Engine | 1954d4ad52d8a59030c0c6a13583c8f110d7346c | 174f69e0280547bfbf78831a6c2f49aa29ef47a0 | refs/heads/master | 2020-05-19T22:08:08.793961 | 2019-05-06T18:33:33 | 2019-05-06T18:33:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,597 | java | import javax.swing.*;
import java.awt.*;
import javax.imageio.ImageIO;
import java.lang.Math;
import java.awt.image.BufferedImage;
import java.io.File;
public class PathPoint extends Object
{
//int alphadirection;
PathManager PathManage;
public PathPoint(MainManager main, int x, int y, KeyboardInput Keyboard, MouseInput Mouse, String color, PathManager PathManage) {
super(main, x, y, Keyboard, Mouse, "sprites/spr_pathpointred.png");
PathManage.PathPoints.add(this);
switch (color.toLowerCase()) {
case "red":
sprite = "sprites/spr_pathpointred.png";
setSprite();
break;
case "yellow":
sprite = "sprites/spr_pathpointyellow.png";
setSprite();
break;
case "blue":
sprite = "sprites/spr_pathpointblue.png";
setSprite();
break;
case "green":
sprite = "sprites/spr_pathpointgreen.png";
setSprite();
break;
}
this.scaleSprite(0.35, 0.35, 1);
this.PathManage = PathManage;
}
public void createstep() {
}
public void setupstep() {
}
public void step() {
}
public void drawstep(Graphics g, Graphics2D g2) {
setup(g, g2);
drawself(g, g2);
}
public void DeleteSelf() {
for (int i = 0; i <= PathManage.PathPoints.size() - 1; i++) {
if (PathManage.PathPoints.get(i) == this) PathManage.PathPoints.remove(i);
}
DeleteSelfBase();
}
}
| [
"50180446+Imakestuff123@users.noreply.github.com"
] | 50180446+Imakestuff123@users.noreply.github.com |
b61f0c4adbfbd9e08cc9c742eacbc20aa6496324 | e137504ea7f36dc7cca89d788badeaa51aaee806 | /code/Miwok/app/src/main/java/com/example/miwok/WordAdapter.java | ac28a3640b67a645785e32a28a532185a38ecc91 | [] | no_license | tolgacantc/android | 7e63eed0ffff5bae2b1aa27b1115d7a26415d7e0 | a1f857d01d05a200c3adf36bd1e42b54313f1e41 | refs/heads/master | 2023-01-08T03:29:20.845188 | 2019-06-15T04:21:36 | 2019-06-15T04:21:36 | 136,994,061 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,770 | java | package com.example.miwok;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
public class WordAdapter extends ArrayAdapter<Word> {
public WordAdapter(Activity context, List<Word> words) {
// Here, we initialize the ArrayAdapter's internal storage for the context and the list.
// the second argument is used when the ArrayAdapter is populating a single TextView.
// Because this is a custom adapter for two TextViews and an ImageView, the adapter is not
// going to use this second argument, so it can be any value. Here, we used 0.
super(context, 0, words);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// Check if the existing view is being reused, otherwise inflate the view
View listItemView = convertView;
if(listItemView == null) {
listItemView = LayoutInflater.from(getContext()).inflate(
R.layout.list_item, parent, false);
}
// Get the {@link AndroidFlavor} object located at this position in the list
Word currentWord = getItem(position);
// Find the TextView in the list_item.xml layout with the ID version_name
TextView nameTextView = (TextView) listItemView.findViewById(R.id.original);
// Get the version name from the current AndroidFlavor object and
// set this text on the name TextView
nameTextView.setText(currentWord.getDefaultTranslation());
// Find the TextView in the list_item.xml layout with the ID version_number
TextView numberTextView = (TextView) listItemView.findViewById(R.id.foreign);
// Get the version number from the current AndroidFlavor object and
// set this text on the number TextView
numberTextView.setText(currentWord.getTranslation());
// Find the ImageView in the list_item.xml layout with the ID list_item_icon
ImageView iconView = (ImageView) listItemView.findViewById(R.id.list_item_icon);
// Get the image resource ID from the current AndroidFlavor object and
// set the image to iconView
if (currentWord.hasImage()) {
iconView.setImageResource(currentWord.getImageResourceId());
iconView.setVisibility(View.VISIBLE);
} else {
iconView.setVisibility(View.GONE);
}
// Return the whole list item layout (containing 2 TextViews and an ImageView)
// so that it can be shown in the ListView
return listItemView;
}
}
| [
"tolgacantc@yahoo.com"
] | tolgacantc@yahoo.com |
ae1b77f8d719f2db3fbb7ea4586cffc8d60e5b13 | 7e38c4d353af58198f1093772469f798775cecae | /src/main/java/com/smartbear/swagger4j/impl/InfoImpl.java | 5d5164210da9d244558a448eb3b8142ae7d76de6 | [
"Apache-2.0"
] | permissive | SmartBear/swagger4j | 9a03599a55a0ec220154140e4ba5b51c08182c39 | 7324180341803aa6ed239f637ea564c34289e462 | refs/heads/master | 2021-06-30T14:08:50.648899 | 2019-04-30T15:44:58 | 2019-04-30T15:44:58 | 10,291,255 | 17 | 8 | Apache-2.0 | 2020-10-15T19:26:40 | 2013-05-25T23:32:28 | Java | UTF-8 | Java | false | false | 1,545 | java | package com.smartbear.swagger4j.impl;
import com.smartbear.swagger4j.Info;
/**
* Default implementation of the Info Interface
*
* @see com.smartbear.swagger4j.Info
*/
public class InfoImpl implements Info {
private String title;
private String description;
private String termsOfServiceUrl;
private String contact;
private String license;
private String licenseUrl;
@Override
public String getTitle() {
return title;
}
@Override
public void setTitle(String title) {
this.title = title;
}
@Override
public String getDescription() {
return description;
}
@Override
public void setDescription(String description) {
this.description = description;
}
@Override
public String getTermsOfServiceUrl() {
return termsOfServiceUrl;
}
@Override
public void setTermsOfServiceUrl(String termsOfServiceUrl) {
this.termsOfServiceUrl = termsOfServiceUrl;
}
@Override
public String getContact() {
return contact;
}
@Override
public void setContact(String contact) {
this.contact = contact;
}
@Override
public String getLicense() {
return license;
}
@Override
public void setLicense(String license) {
this.license = license;
}
@Override
public String getLicenseUrl() {
return licenseUrl;
}
@Override
public void setLicenseUrl(String licenseUrl) {
this.licenseUrl = licenseUrl;
}
}
| [
"ole@lensmar.com"
] | ole@lensmar.com |
239c2303f369a54378882fac9c37d4592a05cf6b | 139eb9842d5009b79cd948b1eda82385326f62f3 | /Lection12/src/filters/DirsWithLastModified.java | 034701b9e5d61b21963b327a08039c6c65ac82a8 | [] | no_license | Vadimka29/Infopulse | 432051d70f4ffd87607a74f6ca647c6f11334068 | d1ba85febb532f350be9795d9d3f8390ed698268 | refs/heads/master | 2016-09-05T13:16:28.652628 | 2014-10-10T10:45:22 | 2014-10-10T10:45:22 | 22,219,881 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 564 | java | package filters;
import java.io.File;
import java.io.FileFilter;
import java.util.Calendar;
import java.util.GregorianCalendar;
public class DirsWithLastModified implements FileFilter {
private GregorianCalendar c1;
private GregorianCalendar c2;
public DirsWithLastModified(){
c1 = new GregorianCalendar();
c2 = new GregorianCalendar();
c2.set(Calendar.YEAR, 2013);
}
@Override
public boolean accept(File f) {
GregorianCalendar c3 = new GregorianCalendar();
c3.setTimeInMillis(f.lastModified());
return (c3.before(c1) && c3.after(c2));
}
}
| [
"vadimka2995@gmail.com"
] | vadimka2995@gmail.com |
ebae86f840e73fc0fd705ff75be49ec422bff7d7 | 4bb0b400faba3ef17df6f37397c85cb6a661a20c | /advertorial/src/main/java/com/hua/app/dao/BatchPriceAdjustmentWebsitDAO.java | db9be8f51a84b4f8f86236af1633ce2b3b43385d | [] | no_license | huasuoworld/git1 | 056b69302aa3ec9c384e39543e8b650c89da3b1e | 1c8f784ae11e62ad83fa98d7e089016d1cff0cce | refs/heads/master | 2021-01-20T11:49:50.936731 | 2017-02-22T00:47:52 | 2017-02-22T00:47:52 | 82,628,734 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 591 | java | package com.hua.app.dao;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.hua.app.vo.BatchPriceAdjustmentWebsitVO;
@Repository(value = "batchPriceAdjustmentWebsitMapper")
public interface BatchPriceAdjustmentWebsitDAO {
public String commit(BatchPriceAdjustmentWebsitVO vo);
public String delete(BatchPriceAdjustmentWebsitVO vo);
public String update(BatchPriceAdjustmentWebsitVO vo);
public List<BatchPriceAdjustmentWebsitVO> search(BatchPriceAdjustmentWebsitVO vo);
public Integer count(BatchPriceAdjustmentWebsitVO vo);
}
| [
"huasuoworld@outlook.com"
] | huasuoworld@outlook.com |
1492e42f94965f0e32ba9604a0a51fdfbf5d9ff4 | 045e9ef20a25ba1448256c603d1ce93b672d7366 | /src/main/java/com/qa/Pages/taskPage.java | cedac32a75f1c422a0c4d77b22fd7a438a1d4a29 | [] | no_license | NivethaSudhan/NivethaK | 7ebc45256c87280e3581b767a2849af3d014c03d | 43d466b3079c97e6eab15c3234cfaf29153c3232 | refs/heads/master | 2022-07-13T15:02:25.717621 | 2019-09-24T14:19:14 | 2019-09-24T14:19:14 | 210,614,525 | 0 | 0 | null | 2022-06-29T17:40:10 | 2019-09-24T13:49:22 | HTML | UTF-8 | Java | false | false | 110 | java | package com.qa.Pages;
import ParentClass.parentClass;
public class taskPage extends parentClass {
}
| [
"noreply@github.com"
] | NivethaSudhan.noreply@github.com |
42dcc45badd699a4294776343e0ff24515ec01c7 | 445c3cf84dd4bbcbbccf787b2d3c9eb8ed805602 | /aliyun-java-sdk-sas/src/main/java/com/aliyuncs/sas/model/v20181203/GetLocalInstallScriptResponse.java | 9a7f86aad9e29eb7e2c8990ca5e4113828fd85a4 | [
"Apache-2.0"
] | permissive | caojiele/aliyun-openapi-java-sdk | b6367cc95469ac32249c3d9c119474bf76fe6db2 | ecc1c949681276b3eed2500ec230637b039771b8 | refs/heads/master | 2023-06-02T02:30:02.232397 | 2021-06-18T04:08:36 | 2021-06-18T04:08:36 | 172,076,930 | 0 | 0 | NOASSERTION | 2019-02-22T14:08:29 | 2019-02-22T14:08:29 | null | UTF-8 | Java | false | false | 1,480 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.sas.model.v20181203;
import com.aliyuncs.AcsResponse;
import com.aliyuncs.sas.transform.v20181203.GetLocalInstallScriptResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;
/**
* @author auto create
* @version
*/
public class GetLocalInstallScriptResponse extends AcsResponse {
private String requestId;
private String script;
public String getRequestId() {
return this.requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public String getScript() {
return this.script;
}
public void setScript(String script) {
this.script = script;
}
@Override
public GetLocalInstallScriptResponse getInstance(UnmarshallerContext context) {
return GetLocalInstallScriptResponseUnmarshaller.unmarshall(this, context);
}
@Override
public boolean checkShowJsonItemName() {
return false;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
bda8359f6e5a7e6c99180eb764a97305f9c99df0 | efc6e323d57eca207706783ca2362b5a6cd528e5 | /app/src/main/java/com/bhb/huybinh2k/music/fragment/FavoriteSongsFragment.java | 07de8f47f2f19e3ee8cf26679a58be9323a04c70 | [] | no_license | sdokgo/music | 71d99989be9d0e688f4422e6c3508b62941f7f7e | 49a108fb0f1a76f886205f143ee9d5b5f697c288 | refs/heads/master | 2022-12-16T22:03:32.651290 | 2020-09-08T04:00:53 | 2020-09-08T04:00:53 | 289,174,329 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,684 | java | package com.bhb.huybinh2k.music.fragment;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import com.bhb.huybinh2k.music.R;
import com.bhb.huybinh2k.music.Song;
import com.bhb.huybinh2k.music.StorageUtil;
import com.bhb.huybinh2k.music.activity.ActivityMusic;
import com.bhb.huybinh2k.music.adapter.SongsAdapter;
import java.util.List;
public class FavoriteSongsFragment extends BaseSongListFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return super.onCreateView(inflater, container, savedInstanceState);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
mList = mFavoriteSongsProvider.listFavorite();
if (mList.isEmpty())
Toast.makeText(getContext(), R.string.add_song_to_favorite, Toast.LENGTH_SHORT).show();
mAdapter = new SongsAdapter(getContext(), mList, true);
super.onViewCreated(view, savedInstanceState);
int index = new StorageUtil(getContext()).loadSongIndex();
List<Song> listPlaying = new StorageUtil(getContext()).loadListSongPlaying();
if (listPlaying != null) {
if (mActivityMusic.isFavoriteFragment && listPlaying.size() != mFavoriteSongsProvider.listFavorite().size()) {
mList = mFavoriteSongsProvider.listFavorite();
}
}
if (index != ActivityMusic.DEFAULT_VALUE) update(index);
clickSong();
}
} | [
"binhbh@bkav.com"
] | binhbh@bkav.com |
b9e0dd327dfbcfc4dcee92aca0fd9e76004f3a37 | 211fee3f3305098c6c442454978467869aee6923 | /app/src/main/java/com/example/chippy/WinScreenActivity.java | 212e96e630610476f960918b78d626318fd21c3c | [] | no_license | Sivaprrasad/Chippy | 4c2e5cd5051d44ad06edf62bc78b8bd1154b6b91 | 41c8677640987190df8f997f7616e1c4e3ae8bf1 | refs/heads/master | 2020-08-26T21:36:55.751081 | 2019-10-27T17:40:13 | 2019-10-27T17:40:13 | 217,156,203 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 896 | java | package com.example.chippy;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
public class WinScreenActivity extends AppCompatActivity {
Button restart;
ImageView winmes;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_win_screen);
winmes = findViewById(R.id.winner);
restart = findViewById(R.id.btnPlay);
restart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getBaseContext(),
MainActivity.class);
startActivity(intent);
}
});
}
}
| [
"usivaprasad95@gmail.com"
] | usivaprasad95@gmail.com |
f1740f0c831c1a0f3995a0d0d66e2501d5b2ca3b | 9b243900c0f746e22f74b0327cf40c3f8b6a3816 | /src/bgp/core/messages/notificationexceptions/UpdateMessageException.java | cf6ff2df3cf9e15ae32e3a12cf271ed769ec6eeb | [
"MIT"
] | permissive | Nikheln/BGP-simulator | a2f6f27d8d17de7bebdbbffc9cde8a1c005d1ee8 | a65ab40958f17c32ee9807afd94bee09bc91992d | refs/heads/master | 2021-06-14T21:39:16.513451 | 2017-03-26T07:33:51 | 2017-03-26T07:33:51 | 80,046,202 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 573 | java | package bgp.core.messages.notificationexceptions;
import bgp.core.messages.NotificationMessage;
import bgp.core.messages.NotificationMessage.UpdateMessageError;
public class UpdateMessageException extends NotificationException {
private static final long serialVersionUID = 1L;
private final UpdateMessageError error;
public UpdateMessageException(UpdateMessageError error) {
super();
this.error = error;
this.printStackTrace();
}
@Override
public NotificationMessage buildNotification() {
return NotificationMessage.getUpdateMessageError(error);
}
}
| [
"niko.hellgren@gmail.com"
] | niko.hellgren@gmail.com |
3e7bb62888576a1254c3ced12a955f951d41304e | 83d8c05ab461acbec2230c339654c9c1345bf360 | /src/Module5/TripAdvisorDAO.java | dcf5ee763702536a51ddea7933f4fd17e07a78f2 | [] | no_license | golegovich/untitled2 | d9f39e56c3a95c3a8d8561483d86f1773905ebd2 | e18a0b0436bc231fe7846ca8fb0813446183cdaa | refs/heads/master | 2020-05-27T13:42:00.952735 | 2017-06-08T19:50:19 | 2017-06-08T19:50:19 | 82,554,408 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,465 | java | package Module5;
import java.time.LocalDate;
import java.time.Month;
/**
* Created by George on 21/03/2017.
*/
public class TripAdvisorDAO implements DAO{
private static Room[] rooms = new Room [10];
public TripAdvisorDAO(){
rooms[0] = new Room(18, 100, 1, LocalDate.of(2017, Month.JANUARY, 1), "Landmark","London");
rooms[1] = new Room(2, 200, 2, LocalDate.of(2017, Month.DECEMBER, 21), "Carrow Road Inn", "Manchester");
rooms[2] = new Room(8, 150, 3, LocalDate.of(2017, Month.AUGUST, 6), "Parc de Princess", "Paris");
rooms[3] = new Room(25, 500, 2, LocalDate.of(2017, Month.MAY, 31), "L'Imperialle", "Marseille");
rooms[4] = new Room(13, 300, 3, LocalDate.of(2018, Month.MARCH, 17), "Intercontinental", "Kyiv");
}
@Override
public Room save(Room room) {
int count = RoomsInDBQuant(rooms);
rooms[count] = room;
System.out.println("Save: " + room);
return room;
}
@Override
public boolean delete(Room room) {
for (int j = 0; j < rooms.length; j++){
if (rooms[j] !=null && rooms[j].equalsForAllFields(room)){
System.arraycopy(room, j+1, rooms, j, rooms.length - j - 1);
rooms[rooms.length - 1] = null;
System.out.println("Deleted: " + room);
return true;
}
}
System.out.println("No room in the DB");
return false;
}
@Override
public Room update(Room room) {
for (int j = 0; j < rooms.length; j++) {
if (rooms[j].getId() == room.getId()){
System.out.println("Update " + room);
rooms[j] = room;
return room;
}
}
System.out.println("Upd: No room in the DB");
return null;
}
@Override
public Room findById(long id) {
for (int j = 0; j < rooms.length; j++) {
if (id == rooms[j].getId()) {
System.out.println("Find by id: " + id + " " + rooms[j]);
return rooms[j];
}
}
System.out.println("Find by id: no room in the DB");
return null;
}
@Override
public Room[] getAll() {
return new Room[0];
}
private int RoomsInDBQuant(Room[] rooms){
int c = 0;
for (Room room: rooms) {
if (room != null){
c++;
}
}
return c;
}
}
| [
"tar.georgiy@gmail.com"
] | tar.georgiy@gmail.com |
2bd2eacb2534d8d702f3531297cc772fafeddc5c | 24eeaf8dfb9fbdcfb14ac009d5745f15c20aa25b | /src/main/java/com/arttraining/api/bean/BannerShowBean.java | 016d83602a5d35e5983de1fe778e0671c080ac57 | [] | no_license | sweet28/api | b3b06906385964d1a2e91e451499a876c281b684 | 4fa1872b2a74afbae580adbbf679f05da2ef6daa | refs/heads/master | 2021-01-11T02:21:00.227484 | 2019-01-18T02:58:52 | 2019-01-18T02:58:52 | 70,977,678 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,541 | java | package com.arttraining.api.bean;
import com.arttraining.commons.util.ImageUtil;
public class BannerShowBean {
private String error_code;
private String error_msg;
private int banner_id;
private String title;
private String create_time;
private String content;
private String pic;
private String url;
public BannerShowBean() {
this.banner_id = 0;
this.title = "";
this.create_time = "";
this.content = "";
this.pic = "";
this.url = "";
}
public String getError_code() {
return error_code;
}
public void setError_code(String error_code) {
this.error_code = error_code;
}
public String getError_msg() {
return error_msg;
}
public void setError_msg(String error_msg) {
this.error_msg = error_msg;
}
public int getBanner_id() {
return banner_id;
}
public void setBanner_id(int banner_id) {
this.banner_id = banner_id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getCreate_time() {
return create_time;
}
public void setCreate_time(String create_time) {
this.create_time = create_time;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getPic() {
return pic;
}
public void setPic(String pic) {
this.pic = ImageUtil.parsePicPath(pic,4);
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
| [
"pc@Lenovo-PC"
] | pc@Lenovo-PC |
506a8cb2d593a3620500b9f480a583e75fb3393b | a8262c90dcfd1054343446bb448c627f3c515337 | /build/generated-sources/jaxb/generated/KnowledgeBases.java | a41a3ef376eb655fbea43cc9be46b29f04667d90 | [] | no_license | ArtemKravchenko/WumpusWorld | a68a95365847170d1cd07f9a67fd3a21ea81dd4f | c5d22e205d4739e529c35690e35ae1ef3b58d0e8 | refs/heads/master | 2021-01-01T18:55:58.967445 | 2013-10-08T11:57:51 | 2013-10-08T11:57:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,398 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.09.24 at 03:42:26 PM EEST
//
package generated;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlList;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="sentences" type="{}stringList"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sentences"
})
@XmlRootElement(name = "KnowledgeBases")
public class KnowledgeBases {
@XmlList
@XmlElement(required = true)
protected List<String> sentences;
public KnowledgeBases() {
this.sentences = new ArrayList<>();
}
/**
* Gets the value of the sentences property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the sentences property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSentences().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getSentences() {
if (sentences == null) {
sentences = new ArrayList<>();
}
return this.sentences;
}
public void addSentence(String sentence) {
this.sentences.add(sentence);
}
}
| [
"artemkravchenko1991@mail.ru"
] | artemkravchenko1991@mail.ru |
b2e714344ca7b1b3cc3c79d0e14b32d89719fc9e | 0cc630e118eb919304f4c4e2a35a5faf73765c2f | /tcc/src/test/java/com/br/uvv/tcc/gateway/controller/ProductControllerUnitTest.java | b25267cea49c08ed492f392080302d297c871dba | [] | no_license | MarinNogueira/Clean-Architecture | 6b478e3382beddd58e48ec18f4dd7e252634e3b2 | 6dafe7583eee166bd371203206afc2b3fb757af1 | refs/heads/master | 2023-08-28T06:03:10.978100 | 2021-11-03T20:10:13 | 2021-11-03T20:10:13 | 424,337,039 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 88 | java | package com.br.uvv.tcc.gateway.controller;
public class ProductControllerUnitTest {
}
| [
"38378982+MarinNogueira@users.noreply.github.com"
] | 38378982+MarinNogueira@users.noreply.github.com |
4850993321c1ab998f8369933573dccae390f07d | 3a20ca88a93ad46f2d7de029c594cbf251623375 | /concurrency/src/main/java/com/akon/concurrency/NativeExceptionHandling.java | d271b5c37c922e359194bcfc55d167e6d9ec91ac | [] | no_license | ch3nwe1/myspring | d098916989855a566214371dfe0ef9770af42324 | 54119d05c25ddc8ad8ed5ca63d76aebdf3030f22 | refs/heads/master | 2022-07-15T05:53:37.581604 | 2019-07-07T13:39:03 | 2019-07-07T13:39:03 | 160,556,211 | 0 | 0 | null | 2022-06-21T01:15:41 | 2018-12-05T17:45:20 | Java | UTF-8 | Java | false | false | 472 | java | package com.akon.concurrency;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class NativeExceptionHandling {
public static void main(String[] args) {
try {
ExecutorService executorService = Executors.newCachedThreadPool();
executorService.execute(new ExceptionThread());
}catch (RuntimeException e){
System.out.println("Exception has been hadnled");
}
}
}
| [
"ch3nwe1@163.com"
] | ch3nwe1@163.com |
b62c7842a6512e22bd09b0b0cfcfcc8a4eb54fd7 | 56059fae62120b7e9ca627e09dbb5c242e35c143 | /Maximum Element In Each Row/Main.java | 14ddc47a6d321eaec5d2f529245f2bac8714550b | [] | no_license | zaidumarajz/Playground | 34f6b97c94ae30de8e6bc430fd2cee5866d6c42f | 29922dc63c2610d0f50314fa280d1036aef24689 | refs/heads/master | 2020-07-11T08:53:04.669715 | 2019-09-03T16:47:57 | 2019-09-03T16:47:57 | 204,496,314 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 540 | java | import java.util.Scanner;
class Main
{
public static void main(String args[])
{
Scanner s=new Scanner(System.in);
int[][] a=new int[10][10];
int m=s.nextInt();
int n=s.nextInt();
int max=0;
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
a[i][j]=s.nextInt();
}
}
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
if(a[i][j]>max)
max=a[i][j];
}
System.out.println(max);
max=0;
}
}
} | [
"52023942+zaidumarajz@users.noreply.github.com"
] | 52023942+zaidumarajz@users.noreply.github.com |
d07684f46206f834809998689bc1537dbb0c338a | 311863d35590e2093faa87b486e92219a4dc6173 | /compon/src/main/java/com/dpcsa/jura/compon/base/BaseActivity.java | 253c06116ee9478c2dbcac64aebac8be13fb31bc | [] | no_license | juravk/dpcsa | cc40cdfc56cc3041560a3fd7b3b6dccdb1af59b0 | 129a7eebf9172da1b45283eaa5818add88c7c20f | refs/heads/master | 2020-04-11T16:52:13.244896 | 2019-01-02T07:35:58 | 2019-01-02T07:35:58 | 161,938,191 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 35,582 | java | package com.dpcsa.jura.compon.base;
import android.app.DialogFragment;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;
import com.dpcsa.jura.compon.single.Injector;
import com.google.android.gms.common.api.GoogleApiClient;
import com.dpcsa.jura.compon.single.ComponGlob;
import com.dpcsa.jura.compon.R;
import com.dpcsa.jura.compon.dialogs.DialogTools;
import com.dpcsa.jura.compon.interfaces_classes.ActionsAfterResponse;
import com.dpcsa.jura.compon.interfaces_classes.ActivityResult;
import com.dpcsa.jura.compon.interfaces_classes.AnimatePanel;
import com.dpcsa.jura.compon.interfaces_classes.EventComponent;
import com.dpcsa.jura.compon.interfaces_classes.IBase;
import com.dpcsa.jura.compon.interfaces_classes.ICustom;
import com.dpcsa.jura.compon.interfaces_classes.OnResumePause;
import com.dpcsa.jura.compon.interfaces_classes.Param;
import com.dpcsa.jura.compon.interfaces_classes.ParentModel;
import com.dpcsa.jura.compon.interfaces_classes.PermissionsResult;
import com.dpcsa.jura.compon.interfaces_classes.RequestActivityResult;
import com.dpcsa.jura.compon.interfaces_classes.RequestPermissionsResult;
import com.dpcsa.jura.compon.interfaces_classes.ViewHandler;
import com.dpcsa.jura.compon.json_simple.Field;
import com.dpcsa.jura.compon.json_simple.JsonSimple;
import com.dpcsa.jura.compon.json_simple.JsonSyntaxException;
import com.dpcsa.jura.compon.json_simple.ListRecords;
import com.dpcsa.jura.compon.json_simple.Record;
import com.dpcsa.jura.compon.json_simple.SimpleRecordToJson;
import com.dpcsa.jura.compon.json_simple.WorkWithRecordsAndViews;
import com.dpcsa.jura.compon.single.ComponPrefTool;
import com.dpcsa.jura.compon.tools.Constants;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import static android.view.View.inflate;
public abstract class BaseActivity extends FragmentActivity implements IBase {
public Map<String, Screen> mapFragment;
private DialogFragment progressDialog;
private int countProgressStart;
public List<BaseInternetProvider> listInternetProvider;
public List<EventComponent> listEvent;
public View parentLayout;
public Screen mComponent;
public int containerFragmentId;
private boolean isActive;
public List<ParentModel> parentModelList;
private Bundle savedInstanceState;
private GoogleApiClient googleApiClient;
private List<AnimatePanel> animatePanelList;
public DrawerLayout drawer;
public ComponGlob componGlob;
public String TAG;
public List<RequestActivityResult> activityResultList;
public List<RequestPermissionsResult> permissionsResultList;
public Field paramScreen;
public WorkWithRecordsAndViews workWithRecordsAndViews;
public Record paramScreenRecord;
public List<OnResumePause> resumePauseList;
private ComponPrefTool preferences;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.savedInstanceState = savedInstanceState;
parentModelList = new ArrayList<>();
preferences = Injector.getPreferences();
componGlob = Injector.getComponGlob();
TAG = componGlob.appParams.NAME_LOG_APP;
mapFragment = componGlob.MapScreen;
animatePanelList = new ArrayList<>();
activityResultList = null;
permissionsResultList = null;
countProgressStart = 0;
listInternetProvider = new ArrayList<>();
listEvent = new ArrayList<>();
String st = componGlob.appParams.nameLanguageInHeader;
Intent intent = getIntent();
workWithRecordsAndViews = new WorkWithRecordsAndViews();
String paramJson = intent.getStringExtra(Constants.NAME_PARAM_FOR_SCREEN);
if (paramJson != null && paramJson.length() >0) {
// Log.d("QWERT","BaseActivity paramJson="+paramJson);
JsonSimple jsonSimple = new JsonSimple();
try {
paramScreen = jsonSimple.jsonToModel(paramJson);
paramScreenRecord = (Record) paramScreen.value;
} catch (JsonSyntaxException e) {
log(e.getMessage());
e.printStackTrace();
}
}
if (st != null && st.length() > 0) {
setLocale();
}
String nameScreen = getNameScreen();
if (nameScreen == null) {
nameScreen = intent.getStringExtra(Constants.NAME_MVP);
}
if (nameScreen != null && nameScreen.length() > 0) {
mComponent = getComponent(nameScreen);
if (mComponent.typeView == Screen.TYPE_VIEW.CUSTOM_ACTIVITY) {
parentLayout = inflate(this, getLayoutId(), null);
} else {
parentLayout = inflate(this, mComponent.fragmentLayoutId, null);
}
} else {
parentLayout = inflate(this, getLayoutId(), null);
}
if (nameScreen != null) {
setContentView(parentLayout);
if (mComponent.navigator != null) {
for (ViewHandler vh : mComponent.navigator.viewHandlers) {
View v = findViewById(vh.viewId);
if (v != null) {
v.setOnClickListener(navigatorClick);
}
}
}
mComponent.initComponents(this);
if (mComponent.moreWork != null) {
mComponent.moreWork.startScreen();
}
}
if (this instanceof ICustom) {
mComponent.setCustom((ICustom) this);
}
TextView title = (TextView) componGlob.findViewByName(parentLayout, "title");
if (title != null && mComponent.title != null) {
if (mComponent.args != null && mComponent.args.length > 0) {
title.setText(String.format(mComponent.title, setFormatParam(mComponent.args)));
} else {
if (mComponent.title.length() > 0) {
title.setText(mComponent.title);
}
}
}
initView();
// super.onCreate(savedInstanceState);
// this.savedInstanceState = savedInstanceState;
// parentModelList = new ArrayList<>();
// preferences = Injector.getPreferences();
// componGlob = Injector.getComponGlob();
// TAG = componGlob.appParams.NAME_LOG_APP;
// mapFragment = componGlob.MapScreen;
// animatePanelList = new ArrayList<>();
// activityResultList = null;
// permissionsResultList = null;
// countProgressStart = 0;
// listInternetProvider = new ArrayList<>();
// listEvent = new ArrayList<>();
// String st = componGlob.appParams.nameLanguageInHeader;
// Intent intent = getIntent();
// workWithRecordsAndViews = new WorkWithRecordsAndViews();
// String paramJson = intent.getStringExtra(Constants.NAME_PARAM_FOR_SCREEN);
// if (paramJson != null && paramJson.length() >0) {
// JsonSimple jsonSimple = new JsonSimple();
// try {
// paramScreen = jsonSimple.jsonToModel(paramJson);
// paramScreenRecord = (Record) paramScreen.value;
// } catch (JsonSyntaxException e) {
// log(e.getMessage());
// e.printStackTrace();
// }
// }
// if (st != null && st.length() > 0) {
// setLocale();
// }
// mComponent = getScreen();
// if (mComponent == null) {
// String nameScreen = getNameScreen();
// if (nameScreen == null) {
// nameScreen = intent.getStringExtra(Constants.NAME_MVP);
// }
//
// if (nameScreen != null && nameScreen.length() > 0) {
// mComponent = getComponent(nameScreen);
// }
// }
// if (mComponent != null) {
// if (mComponent.typeView == Screen.TYPE_VIEW.CUSTOM_ACTIVITY) {
// parentLayout = inflate(this, getLayoutId(), null);
// } else {
// parentLayout = inflate(this, mComponent.fragmentLayoutId, null);
// }
// setContentView(parentLayout);
// if (mComponent.navigator != null) {
// for (ViewHandler vh : mComponent.navigator.viewHandlers) {
// View v = findViewById(vh.viewId);
// if (v != null) {
// v.setOnClickListener(navigatorClick);
// }
// }
// }
// mComponent.initComponents(this);
// if (mComponent.moreWork != null) {
// mComponent.moreWork.startScreen();
// }
// }
//
// if (this instanceof ICustom) {
// mComponent.setCustom((ICustom) this);
// }
// TextView title = (TextView) componGlob.findViewByName(parentLayout, "title");
// if (title != null && mComponent.title != null) {
// if (mComponent.args != null && mComponent.args.length > 0) {
// title.setText(String.format(mComponent.title, setFormatParam(mComponent.args)));
// } else {
// if (mComponent.title.length() > 0) {
// title.setText(mComponent.title);
// }
// }
// }
// initView();
}
public void setLocale() {
String loc = preferences.getLocale();
if (loc.length() == 0) {
loc = "uk";
}
if (loc.equals(Locale.getDefault().getLanguage())) return;
Locale myLocale = new Locale(loc);
Locale.setDefault(myLocale);
android.content.res.Configuration config = new android.content.res.Configuration();
config.locale = myLocale;
getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());
}
@Override
public void setGoogleApiClient(GoogleApiClient googleApiClient) {
this.googleApiClient = googleApiClient;
}
@Override
public Bundle getSavedInstanceState() {
return savedInstanceState;
}
public String getNameScreen() {
return null;
}
public Screen getScreen() {
return null;
}
public int getLayoutId() {
return 0;
}
public void initView() {
}
public void addPermissionsResult(int requestCode, PermissionsResult permissionsResult) {
if (permissionsResultList == null) {
permissionsResultList = new ArrayList<>();
}
permissionsResultList.add(new RequestPermissionsResult(requestCode, permissionsResult));
}
public int addForResult(ActionsAfterResponse afterResponse, ActivityResult activityResult) {
int rc = 0;
if (activityResultList != null) {
rc = activityResultList.size();
}
addForResult(rc, afterResponse, activityResult);
return rc;
}
public void addForResult(int requestCode, ActionsAfterResponse afterResponse, ActivityResult activityResult) {
if (activityResultList == null) {
activityResultList = new ArrayList<>();
}
activityResultList.add(new RequestActivityResult(requestCode, afterResponse, activityResult));
}
public void addForResult(int requestCode, ActivityResult activityResult) {
if (activityResultList == null) {
activityResultList = new ArrayList<>();
}
activityResultList.add(new RequestActivityResult(requestCode, activityResult));
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
if (permissionsResultList != null) {
int ik = permissionsResultList.size();
int j = -1;
for (int i = 0; i < ik; i++) {
RequestPermissionsResult rpr = permissionsResultList.get(i);
if (requestCode == rpr.request) {
rpr.permissionsResult.onPermissionsResult(requestCode, permissions, grantResults);
j = i;
break;
}
if (j > -1) {
permissionsResultList.remove(j);
}
}
}
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (activityResultList != null) {
int ik = activityResultList.size();
int j = -1;
for (int i = 0; i < ik; i++) {
RequestActivityResult rar = activityResultList.get(i);
if (requestCode == rar.request) {
j = i;
rar.activityResult.onActivityResult(requestCode, resultCode, data, rar.afterResponse);
break;
}
}
if (j > -1) {
RequestActivityResult rar = activityResultList.get(j);
rar.request = -1;
rar.activityResult = null;
rar.afterResponse = null;
}
}
}
ActivityResult activityResult = new ActivityResult() {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data, ActionsAfterResponse afterResponse) {
if (resultCode == RESULT_OK) {
for (ViewHandler vh : afterResponse.viewHandlers) {
switch (vh.type) {
case UPDATE_DATA:
mComponent.getComponent(vh.viewId).updateData(vh.paramModel);
break;
}
}
}
}
};
View.OnClickListener navigatorClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
int id = view.getId();
for (ViewHandler vh : mComponent.navigator.viewHandlers) {
if (vh.viewId == id) {
switch (vh.type) {
case NAME_FRAGMENT:
int requestCode = -1;
if (vh.afterResponse != null) {
requestCode = addForResult(vh.afterResponse, activityResult);
}
if (vh.paramForScreen == ViewHandler.TYPE_PARAM_FOR_SCREEN.RECORD) {
startScreen(vh.screen, false, paramScreenRecord, requestCode);
} else {
startScreen(vh.screen, false, null, requestCode);
}
break;
case BACK:
onBackPressed();
break;
case SHOW:
View showView = parentLayout.findViewById(vh.showViewId);
if (showView != null) {
if (showView instanceof AnimatePanel) {
((AnimatePanel) showView).show(BaseActivity.this);
} else {
showView.setVisibility(View.VISIBLE);
}
}
break;
case RECEIVER:
LocalBroadcastManager.getInstance(BaseActivity.this).registerReceiver(broadcastReceiver,
new IntentFilter(vh.nameFieldWithValue));
break;
case RESULT_PARAM :
Record record = workWithRecordsAndViews.ViewToRecord(parentLayout, vh.nameFieldWithValue);
if (record != null) {
componGlob.setParam(record);
}
setResult(RESULT_OK);
finishActivity();
break;
}
}
}
}
};
private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (mComponent.moreWork != null) {
mComponent.moreWork.receiverWork(intent);
}
LocalBroadcastManager.getInstance(BaseActivity.this).unregisterReceiver(broadcastReceiver);
}
};
public Screen getComponent(String name) {
return componGlob.MapScreen.get(name);
}
@Override
public void setFragmentsContainerId(int id) {
containerFragmentId = id;
}
@Override
protected void onStart() {
super.onStart();
isActive = true;
}
@Override
protected void onStop() {
if (listInternetProvider != null) {
for (BaseInternetProvider provider : listInternetProvider) {
provider.cancel();
}
}
isActive = false;
super.onStop();
}
@Override
public void setResumePause(OnResumePause resumePause) {
if (resumePauseList == null) {
resumePauseList = new ArrayList<>();
}
resumePauseList.add(resumePause);
}
@Override
public void onResume() {
super.onResume();
int statusBarColor = preferences.getStatusBarColor();
if (statusBarColor != 0) {
setStatusBarColor(statusBarColor);
}
if (resumePauseList != null) {
for (OnResumePause rp : resumePauseList) {
rp.onResume();
}
}
}
@Override
public void onPause() {
if (resumePauseList != null) {
for (OnResumePause rp : resumePauseList) {
rp.onPause();
}
}
super.onPause();
}
@Override
public void log(String msg) {
Log.i(TAG, msg);
}
public void setStatusColor(int color) {
preferences.setStatusBarColor(color);
}
@Override
protected void onDestroy() {
super.onDestroy();
if (resumePauseList != null) {
for (OnResumePause rp : resumePauseList) {
rp.onDestroy();
}
}
if (googleApiClient != null && googleApiClient.isConnected()) {
googleApiClient.disconnect();
}
}
@Override
public Field getProfile() {
return componGlob.profile;
}
@Override
public void backPressed() {
onBackPressed();
}
@Override
public void onBackPressed() {
FragmentManager fm = getSupportFragmentManager();
int countFragment = fm.getBackStackEntryCount();
if ( countFragment > 0) {
List<Fragment> fragmentList = fm.getFragments();
Fragment fragment = topFragment(fm);
if (fragment != null && fragment instanceof BaseFragment) {
if (((BaseFragment) fragment).canBackPressed()) {
if (countFragment == 1) {
finish();
} else {
super.onBackPressed();
}
}
} else {
if (countFragment == 1) {
finish();
} else {
super.onBackPressed();
}
}
} else {
if (canBackPressed()) {
finishActivity();
}
}
}
public void finishActivity() {
finish();
if (mComponent.animateScreen != null) {
switch (mComponent.animateScreen) {
case TB :
overridePendingTransition(R.anim.bt_in, R.anim.bt_out);
break;
case BT :
overridePendingTransition(R.anim.tb_in, R.anim.tb_out);
break;
case LR :
overridePendingTransition(R.anim.rl_in, R.anim.rl_out);
break;
case RL :
overridePendingTransition(R.anim.lr_in, R.anim.lr_out);
break;
}
}
}
private Fragment topFragment(FragmentManager fm) {
List<Fragment> fragmentList = fm.getFragments();
Fragment fragment = null;
for (Fragment fragm : fragmentList) {
if (fragm != null) {
fragment = fragm;
}
}
return fragment;
}
@Override
public boolean isHideAnimatePanel() {
int pos = animatePanelList.size();
if (pos > 0) {
animatePanelList.get(pos - 1).hide();
return false;
} else {
return true;
}
}
public boolean canBackPressed() {
return isHideAnimatePanel();
}
@Override
public BaseFragment getBaseFragment() {
return null;
}
@Override
public boolean isViewActive() {
return isActive;
}
// @Override
public void startActivitySimple(String nameMVP, Object object) {
Screen mc = mapFragment.get(nameMVP);
if (mc != null) {
startActivitySimple(nameMVP, mc, object, -1);
} else {
log("Нет Screens с именем " + nameMVP);
}
}
public void startActivitySimple(String nameMVP, Screen mc, Object object, int forResult) {
Intent intent;
if (mc.customFragment == null) {
intent = new Intent(this, ComponBaseStartActivity.class);
} else {
intent = new Intent(this, mc.customFragment);
}
intent.putExtra(Constants.NAME_MVP, nameMVP);
if (object != null) {
SimpleRecordToJson recordToJson = new SimpleRecordToJson();
Field f = new Field();
f.value = object;
if (object instanceof Record) {
f.type = Field.TYPE_RECORD;
intent.putExtra(Constants.NAME_PARAM_FOR_SCREEN, recordToJson.modelToJson(f));
} else if (object instanceof ListRecords) {
f.type = Field.TYPE_LIST_RECORD;
intent.putExtra(Constants.NAME_PARAM_FOR_SCREEN, recordToJson.modelToJson(f));
}
}
if (forResult > -1) {
startActivityForResult(intent, forResult);
} else {
startActivity(intent);
}
if (mc.animateScreen != null) {
switch (mc.animateScreen) {
case TB :
overridePendingTransition(R.anim.tb_in, R.anim.tb_out);
break;
case BT :
overridePendingTransition(R.anim.bt_in, R.anim.bt_out);
break;
case LR :
overridePendingTransition(R.anim.lr_in, R.anim.lr_out);
break;
case RL :
overridePendingTransition(R.anim.rl_in, R.anim.rl_out);
break;
}
}
}
public void closeDrawer() {
if (drawer != null) {
drawer.closeDrawer(GravityCompat.START);
}
}
public void openDrawer() {
if (drawer != null) {
drawer.openDrawer(GravityCompat.START);
}
}
public ParentModel getParentModel(String name) {
if (parentModelList.size() > 0) {
for (ParentModel pm : parentModelList) {
if (pm.nameParentModel.equals(name)) {
return pm;
}
}
}
ParentModel pm = new ParentModel(name);
parentModelList.add(pm);
return pm;
}
public void showDialog(String title, String message, View.OnClickListener click) {
int id = componGlob.appParams.errorDialogViewId;
if (id != 0) {
Record rec = new Record();
rec.add(new Field("title", Field.TYPE_STRING, title));
rec.add(new Field("message", Field.TYPE_STRING, message));
View viewErrorDialog = parentLayout.findViewById(id);
if (viewErrorDialog instanceof AnimatePanel) {
((AnimatePanel) viewErrorDialog).show(this);
workWithRecordsAndViews.RecordToView(rec, viewErrorDialog);
}
} else {
DialogTools.showDialog(this, title, message, click);
}
}
@Override
public void showDialog(int statusCode, String message, View.OnClickListener click) {
showDialog("StatusCode="+statusCode, message, click);
// DialogTools.showDialog(this, statusCode, message, click);
}
@Override
public void progressStart() {
if (componGlob.appParams.classProgress != null) {
if (progressDialog == null) {
try {
progressDialog = (DialogFragment) componGlob.appParams.classProgress.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
if (countProgressStart == 0) {
progressDialog.show(getFragmentManager(), "MyProgressDialog");
}
countProgressStart++;
}
}
@Override
public void progressStop() {
countProgressStart--;
if (countProgressStart <= 0 && progressDialog != null) {
progressDialog.dismiss();
progressDialog = null;
}
}
@Override
public void startDrawerFragment(String nameMVP, int containerFragmentId) {
Screen model = mapFragment.get(nameMVP);
BaseFragment fragment = new BaseFragment();
fragment.setModel(model);
Bundle bundle =new Bundle();
bundle.putString(Constants.NAME_MVP, model.nameComponent);
fragment.setArguments(bundle);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(containerFragmentId, fragment, model.nameComponent);
transaction.commit();
}
@Override
public void startScreen(String screen, boolean startFlag) {
startScreen(screen, startFlag, null, -1);
}
public void setStatusBarColor(int color) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(color);
}
}
@Override
public void startScreen(String screen, boolean startFlag, Object object) {
startScreen(screen, startFlag, object, -1);
}
@Override
public void startScreen(String nameMVP, boolean startFlag, Object object, int forResult) {
Screen mComponent = mapFragment.get(nameMVP);
// Log.d("QWERT","startScreen mComponent="+mComponent);
// String nameMVP = mComponent.nameComponent;
if (mComponent == null || mComponent.typeView == null) {
log("Нет Screens с именем " + nameMVP);
return;
}
switch (mComponent.typeView) {
case ACTIVITY:
startActivitySimple(nameMVP, mComponent, object, forResult);
break;
case CUSTOM_ACTIVITY:
startActivitySimple(nameMVP, mComponent, object, forResult);
break;
case FRAGMENT:
startFragment(nameMVP, mComponent, startFlag, object, forResult);
break;
case CUSTOM_FRAGMENT:
startCustomFragment(nameMVP, mComponent, startFlag, object, forResult);
break;
}
}
public void startCustomFragment(String nameMVP, Screen mComponent, boolean startFlag, Object object, int forResult) {
BaseFragment fr = (BaseFragment) getSupportFragmentManager().findFragmentByTag(nameMVP);
int count = (fr == null) ? 0 : 1;
if (startFlag) {
clearBackStack(count);
}
BaseFragment fragment = null; // (fr != null) ? fr : new ComponentsFragment();
if (fr != null) {
fragment = fr;
} else {
try {
fragment = (BaseFragment) mComponent.customFragment.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
if (fragment != null) {
Bundle bundle = null;
if (object != null) {
if (object instanceof Bundle) {
bundle= (Bundle) object;
}
}
if (bundle == null){
bundle = new Bundle();
}
bundle.putString(Constants.NAME_MVP, nameMVP);
if (object != null) {
if (object instanceof Record || object instanceof ListRecords) {
SimpleRecordToJson recordToJson = new SimpleRecordToJson();
Field f = new Field();
f.value = object;
if (object instanceof Record) {
f.type = Field.TYPE_RECORD;
} else {
f.type = Field.TYPE_LIST_RECORD;
}
bundle.putString(Constants.NAME_PARAM_FOR_SCREEN, recordToJson.modelToJson(f));
} else {
fragment.setObject(object);
}
}
fragment.setArguments(bundle);
fragment.setModel(mComponent);
startNewFragment(fragment, nameMVP, mComponent);
}
}
public void startFragment(String nameMVP, Screen mComponent, boolean startFlag, Object object, int forResult) {
BaseFragment fr = (BaseFragment) getSupportFragmentManager().findFragmentByTag(nameMVP);
int count = (fr == null) ? 0 : 1;
if (startFlag) {
clearBackStack(count);
}
BaseFragment fragment = (fr != null) ? fr : new BaseFragment();
Bundle bundle =new Bundle();
bundle.putString(Constants.NAME_MVP, nameMVP);
if (object != null) {
SimpleRecordToJson recordToJson = new SimpleRecordToJson();
Field f = new Field();
f.value = object;
if (object instanceof Record) {
f.type = Field.TYPE_RECORD;
bundle.putString(Constants.NAME_PARAM_FOR_SCREEN, recordToJson.modelToJson(f));
} else if (object instanceof ListRecords) {
f.type = Field.TYPE_LIST_RECORD;
bundle.putString(Constants.NAME_PARAM_FOR_SCREEN, recordToJson.modelToJson(f));
}
}
fragment.setArguments(bundle);
fragment.setModel(mComponent);
startNewFragment(fragment, nameMVP, mComponent);
}
private void startNewFragment(BaseFragment fragment, String nameMVP, Screen mComponent) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
if (mComponent.animateScreen != null) {
switch (mComponent.animateScreen) {
case RL:
transaction.setCustomAnimations(R.anim.rl_in, R.anim.rl_out,
R.anim.lr_in, R.anim.lr_out);
break;
case LR :
transaction.setCustomAnimations(R.anim.lr_in, R.anim.lr_out,
R.anim.rl_in, R.anim.rl_out);
break;
case TB :
transaction.setCustomAnimations(R.anim.tb_in, R.anim.tb_out,
R.anim.bt_in, R.anim.bt_out);
break;
case BT :
transaction.setCustomAnimations(R.anim.bt_in, R.anim.bt_out,
R.anim.tb_in, R.anim.tb_out);
break;
}
}
transaction.replace(containerFragmentId, fragment, nameMVP)
.addToBackStack(nameMVP)
.commit();
}
public void clearBackStack(int count) {
FragmentManager manager = getSupportFragmentManager();
if (manager.getBackStackEntryCount() > count) {
FragmentManager.BackStackEntry first = manager.getBackStackEntryAt(count);
manager.popBackStack(first.getId(), FragmentManager.POP_BACK_STACK_INCLUSIVE);
}
}
public void addParamValue(String name, String value) {
componGlob.addParamValue(name, value);
}
@Override
public BaseActivity getBaseActivity() {
return this;
}
@Override
public void addInternetProvider(BaseInternetProvider internetProvider) {
listInternetProvider.add(internetProvider);
}
@Override
public View getParentLayout() {
return parentLayout;
}
@Override
public void addEvent(int sender, BaseComponent receiver) {
listEvent.add(new EventComponent(sender, receiver));
}
@Override
public void addEvent(int[] senderList, BaseComponent receiver) {
for (int sender : senderList) {
listEvent.add(new EventComponent(sender, receiver));
}
}
@Override
public void sendEvent(int sender) {
for (EventComponent ev : listEvent) {
if (ev.eventSenderId == sender) {
ev.eventReceiverComponent.actual();
}
}
}
@Override
public void sendActualEvent(int sender, Object paramEvent) {
for (EventComponent ev : listEvent) {
if (ev.eventSenderId == sender) {
ev.eventReceiverComponent.actualEvent(sender, paramEvent);
}
}
}
@Override
public void addAnimatePanel(AnimatePanel animatePanel) {
animatePanelList.add(animatePanel);
}
@Override
public void delAnimatePanel(AnimatePanel animatePanel) {
animatePanelList.remove(animatePanel);
}
@Override
public Field getParamScreen() {
return paramScreen;
}
public String setFormatParam(String[] args) {
String st = "";
List<Param> paramValues = componGlob.paramValues;
String sep = "";
for (String arg : args) {
for (Param paramV : paramValues) {
if (arg.equals(paramV.name)) {
st = sep + paramV.value;
sep = ",";
break;
}
}
}
return st;
}
}
| [
"yurakvlad@gmail.com"
] | yurakvlad@gmail.com |
d6b9bb4796c51c6f5de4906b5d0668efec6f1e23 | 1a56f4ae86409a4e4c5014a0fe839bbc27db7bee | /src/test/java/com/industrieit/ledger/clientledger/core/redis/controller/TransactionControllerTest.java | d9cf683dce57fc4899befe3fc5918b4192463636 | [] | no_license | andrewkkchan/client-ledger-core-redis | 1146c8e2897709ad568efcfdac7b94e8d1370a30 | 68d9df2d35adaec02fc5d394f8cafb2d737ed2b5 | refs/heads/master | 2020-07-29T19:21:18.167405 | 2019-09-21T08:30:51 | 2019-09-21T08:30:51 | 209,929,574 | 17 | 3 | null | null | null | null | UTF-8 | Java | false | false | 2,967 | java | package com.industrieit.ledger.clientledger.core.redis.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Iterables;
import com.industrieit.ledger.clientledger.core.redis.entity.TransactionEvent;
import com.industrieit.ledger.clientledger.core.redis.entity.TransactionResult;
import com.industrieit.ledger.clientledger.core.redis.repository.TransactionEventRepository;
import com.industrieit.ledger.clientledger.core.redis.repository.TransactionResultRepository;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.springframework.kafka.core.KafkaTemplate;
import java.util.ArrayList;
import java.util.Optional;
import static org.mockito.ArgumentMatchers.nullable;
public class TransactionControllerTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
@Mock
private TransactionEventRepository transactionEventRepository;
@Mock
private TransactionResultRepository transactionResultRepository;
@Mock
private ObjectMapper objectMapper;
@Mock
private KafkaTemplate<String, TransactionEvent> kafkaTemplate;
@InjectMocks
private TransactionController transactionController;
@Before
public void before() {
MockitoAnnotations.initMocks(this);
Mockito.when(kafkaTemplate.send(nullable(String.class), nullable(TransactionEvent.class))).thenReturn(null);
}
@Test
public void testGetResultById() {
Mockito.when(transactionResultRepository.findByRequestId(nullable(String.class)))
.thenReturn(Optional.of(new TransactionResult()));
TransactionResult result = transactionController.getResult("1234");
Assert.assertNotNull(result);
}
@Test
public void testGetAllResult() {
Mockito.when(transactionResultRepository.findAll())
.thenReturn(new ArrayList<>());
Iterable<TransactionResult> result = transactionController.getAllResult();
Assert.assertNotNull(result);
Assert.assertEquals(0, Iterables.size(result));
}
@Test
public void testGetAllEvent() {
Mockito.when(transactionEventRepository.findAll()).thenReturn(new ArrayList<>());
Iterable<TransactionEvent> event = transactionController.getAllEvent();
Assert.assertNotNull(event);
Assert.assertEquals(0, Iterables.size(event));
}
@Test
public void testGetEvent() {
TransactionEvent transactionEvent = new TransactionEvent();
Mockito.when(transactionEventRepository.findById(nullable(String.class)))
.thenReturn(Optional.of(transactionEvent));
TransactionEvent event = transactionController.getEvent("12345");
Assert.assertNotNull(event);
}
}
| [
"andrew.koonkit.chan@gmail.com"
] | andrew.koonkit.chan@gmail.com |
6c8f8921fdb2a2692f8a881fb73e94b542efe87b | f3ace548bf9fd40e8e69f55e084c8d13ad467c1c | /excuterWrong/FineGraineHeap/AOIU_25/PQueue.java | 06ecb175c8fcb7777eb72ae703601fc0e0db2c16 | [] | no_license | phantomDai/concurrentProgramTesting | 307d008f3bba8cdcaf8289bdc10ddf5cabdb8a04 | 8ac37f73c0413adfb1ea72cb6a8f7201c55c88ac | refs/heads/master | 2021-05-06T21:18:13.238925 | 2017-12-06T11:10:01 | 2017-12-06T11:10:02 | 111,872,421 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 459 | java | /*
* PQueue.java
*
* Created on March 8, 2007, 10:49 PM
*
* From "Multiprocessor Synchronization and Concurrent Data Structures",
* by Maurice Herlihy and Nir Shavit.
* Copyright 2007 Elsevier Inc. All rights reserved.
*/
package mutants.FineGrainedHeap.AOIU_25;
/**
* Unbounded priority queue interface
* @param {T} item type
* @author Maurice Herlihy
*/
public interface PQueue<T> {
void add(T item, int priority);
T removeMin();
}
| [
"zxmantou@163.com"
] | zxmantou@163.com |
c202333d27d963dedda86f0d34416c64d5b3df7b | 201de1906e9498baa6df7423296c43ce1c04d6b6 | /.history/src/main/java/com/example/ManagerProject/Controller/RestProjectFileMpp_20190821101525.java | 4fd3d5f7ed25c0a3fe8e91ed097e3a4c9e33c8a7 | [] | no_license | Isamae/Project-Estratego | 822e9782e94444df8beb2afc736e808ce52fe58f | 0429245ff8cc2c5cc4d442cc1d09516ea67ac779 | refs/heads/master | 2022-12-12T00:34:23.736293 | 2020-03-27T19:23:22 | 2020-03-27T19:23:22 | 200,688,183 | 0 | 0 | null | 2022-11-28T22:21:50 | 2019-08-05T16:06:52 | Java | UTF-8 | Java | false | false | 17,037 | java |
package com.example.ManagerProject.Controller;
import java.io.Console;
import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import org.springframework.boot.configurationprocessor.json.JSONArray;
import org.springframework.boot.configurationprocessor.json.JSONException;
import org.springframework.boot.configurationprocessor.json.JSONObject;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import net.sf.mpxj.*;
import net.sf.mpxj.ganttproject.schema.Date;
import net.sf.mpxj.reader.*;
import net.sf.mpxj.writer.*;
import net.sf.mpxj.mpp.*;
import net.sf.mpxj.planner.schema.Days;
import net.sf.mpxj.planner.schema.Task;
import java.util.Calendar;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* RestProject
*/
@RestController
@RequestMapping(value = "/project")
public class RestProjectFileMpp {
@GetMapping(value = "/datoJson")
public String postJson(@RequestBody String payload) throws Exception{
File file = ResourceUtils.getFile("classpath:"+"010101010010101001010101001010100101.mpp");
ProjectReader reader = new MPPReader();
ProjectFile projectObj = reader.read(file);
JSONObject jsonObject = null;
try {
jsonObject= new JSONObject(payload);
} catch (Exception e) {
System.out.println("Error al convertir Json: ");
e.printStackTrace();
}
projectObj = addCalendario(projectObj,jsonObject);
//projectObj = addColumnas(projectObj,jsonObject);
projectObj = addRecursos(projectObj,jsonObject);
projectObj = addTarea(projectObj,jsonObject);
ProjectWriter writer = ProjectWriterUtility.getProjectWriter("HOLA.mpx");
writer.write(projectObj,"HOLA.mpx");
return "Hola Mundo";
}
public static ProjectFile addTarea(ProjectFile project,JSONObject jsonObject) throws JSONException {
JSONObject jsonObject2 = ((JSONObject)(jsonObject.get("allColum")));
for(int i=0;i< ((JSONArray)(jsonObject.get("tareas"))).length();i++){
try {
JSONObject json = ((JSONArray)(jsonObject.get("tareas"))).getJSONObject(i);
//project.getAllTasks().add();
(project.addTask()).setID(json.getInt("id"));
(project.getTaskByID(json.getInt("id"))).setName(json.getString("name"));
(project.getTaskByID(json.getInt("id"))).setUniqueID(json.getInt("uniqueID"));
(project.getTaskByID(json.getInt("id"))).setActive(json.getBoolean("estado"));
JSONObject jsonObject3 = jsonObject2.getJSONObject(json.getString("id"));
SimpleDateFormat df = new SimpleDateFormat("E MMM dd HH:mm:ss zzz yyyy");
project.getTaskByID(json.getInt("id")).setDate(1,df.parse(jsonObject3.getString("Start")));
project.getTaskByID(json.getInt("id")).setFinish(df.parse(jsonObject3.getString("Finish")));
System.out.println("Iniciio "+ project.getTaskByID(json.getInt("id")).getDate(1));
System.out.println("Fin "+ project.getTaskByID(json.getInt("id")).getFinish());
//Day day = Day.valueOf(jsonObject3.getString("Start"));
//String[] fecha = jsonObject3.getString("Start").split(" ");
//Date date = new Date();
} catch (JSONException e) {
e.printStackTrace();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return project;
}
public static ProjectFile addRecursos(ProjectFile project,JSONObject jsonObject){
try {
JSONArray array = (JSONArray) jsonObject.get("recursos");
for(int i=0; i< array.length();i++){
Resource resource = project.addResource();
resource.setName(((JSONObject)array.get(i)).getString("name"));
resource.setID(((JSONObject)array.get(i)).getInt("id"));
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return project;
}
public static ProjectFile addColumnas(ProjectFile project,JSONObject jsonObject) throws Exception
{
JSONObject json = ((JSONArray)(jsonObject.get("allColum"))).getJSONObject(0);
System.out.println("Estas son las tabla:" + project.getTables().get(0));
CustomFieldContainer fields = project.getCustomFields();
System.out.println("El tamanao de los campos personalizados es:"+ fields.size());
//CustomFieldValueItem customFieldValueItem = new CustomFieldValueItem(617);
//fields.registerValue(customFieldValueItem);
FieldType fieldType = new FieldType(){
@Override
public int getValue() {
return 62;
}
@Override
public String name() {
return "RESOURCE_NAMES";
}
@Override
public FieldType getUnitsType() {
return null;
}
@Override
public String getName(Locale locale) {
return locale.getDisplayName();
}
@Override
public String getName() {
return "Resource Names";
}
@Override
public FieldTypeClass getFieldTypeClass() {
return FieldTypeClass.TASK;
}
@Override
public DataType getDataType() {
return DataType.STRING;
}
};
CustomField customField = new CustomField(fieldType, project.getCustomFields());
/*FieldContainer container = new FieldContainer(){
@Override
public void set(FieldType field, Object value) {
}
@Override
public void removeFieldListener(FieldListener listener) {
}
@Override
public Object getCurrentValue(FieldType field) {
return null;
}
@Override
public Object getCachedValue(FieldType field) {
return null;
}
@Override
public void addFieldListener(FieldListener listener) {
}
};*/
Column column = new Column(project);
column.setFieldType(customField.getFieldType());
column.setTitle("Hola Mundo");
column.setWidth(14);
project.getTables().get(0).getColumns().add(column);
/*CustomFieldValueItem item = new CustomFieldValueItem(7);
item.setDescription("hola Mundo");
item.setParent(200);*/
fields.getCustomField(fieldType);
for (CustomField field :project.getCustomFields())
{
//fields.getCustomField(field.getFieldType()).setAlias("hola");
System.out.println("Field: " + field);
System.out.println("Typo, getName , name, value , unidades , clase: " + field.getFieldType().getDataType()
+ " " +field.getFieldType().getName()
+ " " +field.getFieldType().name()
+ " " +field.getFieldType().getValue()
+ " " +field.getFieldType().getUnitsType()
+ " " +field.getFieldType().getFieldTypeClass());
}
//project.getProjectProperties();
//project.getProjectConfig();
//project.getEventManager();
System.out.println("El tamanao de los campos personalizados es:"+ project.getCustomFields().size());
/*for (CustomField field :project.getCustomFields())
{
//fields.getCustomField(field.getFieldType()).setAlias("hola");
System.out.println("Field: " + field);
System.out.println("Typo, getName , name, value , unidades , clase: " + field.getFieldType().getDataType()
+ " " +field.getFieldType().getName()
+ " " +field.getFieldType().name()
+ " " +field.getFieldType().getValue()
+ " " +field.getFieldType().getUnitsType()
+ " " +field.getFieldType().getFieldTypeClass());
}*/
/*Table table = project.getTables().get(0);
project.getTables().remove(table);
Table table2 = new Table();
table2.setName("Table1");
table2.setID(1);
for(int i = 0; i< json.names().length(); i ++){
Column column = new Column(project);
column.setTitle((String)json.names().get(i));
//column.setFieldType(fieldType);
table2.addColumn(column);
}
project.getTables().add(table2);*/
return project;
}
public static ProjectFile addDataTablas(ProjectFile project,JSONObject jsonObject) throws Exception{
JSONArray jsonClaves = ((JSONArray)(jsonObject.get("allColum"))).getJSONObject(0).names();
Table table = project.getTables().get(0);
try {
for (int i = 0; i < ((JSONArray) (jsonObject.get("allColum"))).length(); i++) {
JSONObject object = ((JSONArray) (jsonObject.get("allColum"))).getJSONObject(i);
for(int j=0; j<jsonClaves.length(); j++){
// System.out.println("Clase: " + object.get((String)jsonClaves.get(j)));
Column column = new Column(project);
}
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return project;
}
public static int containsPalabra(JSONArray findArray, String palabra) {
int result = -1;
for(int i=0; i< findArray.length(); i++){
try {
if (((String) findArray.get(i)).equals(palabra)) {
result = i;
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return result;
}
public ProjectFile addCalendario(ProjectFile project,JSONObject jsonObject) throws Exception{
JSONArray calendariosJson = ((JSONArray)(jsonObject.get("calendarios")));
/*JSONArray recursosJson = ((JSONArray)(jsonObject.get("recursos")));
for (int i=0; i<recursosJson.length(); i++){
net.sf.mpxj.Resource resource = project.addResource();
JSONObject j = recursosJson.getJSONObject(i);
resource.setName(j.getString("name"));
resource.setID(j.getInt("id"));
}*/
ProjectCalendar calendar = new ProjectCalendar(project);
for(int i=0; i< calendariosJson.length(); i++){
try {
JSONObject json = calendariosJson.getJSONObject(i);
// set calenderName
calendar.setName(json.getString("nombre"));
// set workingDays
calendar = setDiasLaborables (json.getJSONArray("diaslab"), calendar);
// setHours
JSONArray horariosCalendario = json.getJSONArray("calenderHorario");
calendar = setHorarioDia (horariosCalendario, calendar);
// set exceptions
JSONArray excepcionesCalendario = json.getJSONArray("calenderExcepciones");
calendar = setExcepciones (excepcionesCalendario, calendar);
project.addCalendar();
project.addCalendar().setName(calendar.getName());
} catch (JSONException e) {
e.printStackTrace();
}
}
// List <ProjectCalendar> calendarios = project.getCalendars();
// for (ProjectCalendar calendario : calendarios){
// }
// Table table = project.getTables().get(0);
// List calendars = project.getCalendars();
// //Iterator resourceIter = resources.iterator();
// //while (resourceIter.hasNext()){
// //Task resource = (Task)resourceIter.next();
// List columns = table.getColumns();
// Iterator columnIter = columns.iterator();
// Object columnValue = null;
// while (columnIter.hasNext()){
// Column column = (Column)columnIter.next();
// if( json.names(). column.getFieldType().toString())
// if (column.getFieldType().toString().equalsIgnoreCase("Duration")){
// columnValue = resource.getDuration();
// }else if (column.getFieldType().toString().equalsIgnoreCase("Start")){
// columnValue = resource.getStart();
// }else if (column.getFieldType().toString().equalsIgnoreCase("Finish")){
// columnValue = resource.getFinish();
// }else {
// columnValue = resource.getCachedValue(column.getFieldType());
// }
// }
//}
return project;
}
public ProjectCalendar setDiasLaborables (JSONArray diasLab, ProjectCalendar calendario) throws JSONException {
for (int i=0; i<diasLab.length(); i++){
Day day = Day.valueOf(diasLab.get(i).toString());
calendario.setWorkingDay(day, true);
}
for (int i=1; i<8; i++){
if (!calendario.isWorkingDay(Day.getInstance(i))){
calendario.setWorkingDay(Day.getInstance(i), false);
}
}
return calendario;
}
public ProjectCalendar setHorarioDia (JSONArray horarioCalendario, ProjectCalendar calendario) throws JSONException, ParseException {
for (int i=0; i<horarioCalendario.length(); i++){
String horarioStr = horarioCalendario.getString(i);
String[] horario = horarioStr.split("/");
String dayName = horario[0];
String start1 = horario[1];
String end1 = horario[2];
String start2 = horario[3];
String end2 = horario[4];
Day day = Day.valueOf(dayName);
DateRange dateRange = new DateRange(new SimpleDateFormat("E MMM dd HH:mm:ss zzz yyyy").parse(start1), new SimpleDateFormat("E MMM dd HH:mm:ss zzz yyyy").parse(end1));
DateRange dateRange2 = new DateRange(new SimpleDateFormat("E MMM dd HH:mm:ss zzz yyyy").parse(start2), new SimpleDateFormat("E MMM dd HH:mm:ss zzz yyyy").parse(end2));
ProjectCalendarHours hours = calendario.addCalendarHours(day);
hours.addRange(dateRange);
hours.addRange(dateRange2);
/* ** */
String h = "'";
ProjectCalendarHours horas [] = calendario.getHours();
for (ProjectCalendarHours hora : horas){
if (hora!= null){
ProjectCalendarHours c = hora.getParentCalendar().getCalendarHours(day);
System.out.println("hora.getParentCalendar() " + hora.getParentCalendar());
h = h + hora.getDay();
for (int k=0; k<c.getRangeCount(); k++){
h = h + "/" + c.getRange(k).getStart()+"/" + c.getRange(k).getEnd();
}
h = h + "'";
}
System.out.println(h);
h = "'";
}
}
return calendario;
}
public ProjectCalendar setExcepciones (JSONArray excepcionesCalendario, ProjectCalendar calendario) throws JSONException, ParseException {
for (int i=0; i<excepcionesCalendario.length(); i++){
String exStr = excepcionesCalendario.getString(i);
String[] excepcion = exStr.split("/");
calendario.addCalendarException(new SimpleDateFormat("E MMM dd HH:mm:ss zzz yyyy").parse(excepcion[1]), new SimpleDateFormat("E MMM dd HH:mm:ss zzz yyyy").parse(excepcion[2]));
ProjectCalendarException ex = calendario.getException(new SimpleDateFormat("E MMM dd HH:mm:ss zzz yyyy").parse(excepcion[1]));
ex.setName(excepcion[0]);
}
return calendario;
}
}
| [
"diego.ismael.montesdeoca@gmail.com"
] | diego.ismael.montesdeoca@gmail.com |
2b75990c079f384083469aaea76a5d379238b338 | b7deb3efd55e9a8511ec8aaa1d9d6a18861ba5d9 | /benchmarks/src/util/bitset/src/bitset/entity/withlock/BitSet.java | 7e3da2bfc002ec0b4ac4a05d9e0baf3f08c51fa3 | [] | no_license | AyeshaSadiq7/AutoLock | 892defadc11009a0152290006fdeaab725ad34d1 | 3f2208d66cc1e0f145be8bef6b59723cf3fcd1fc | refs/heads/master | 2022-03-01T17:07:03.290105 | 2019-11-23T01:17:40 | 2019-11-23T01:17:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,471 | java | package bitset.withlock;
import java.io.*;
import java.util.*;
import top.anonymous.anno.Perm;
import java.util.concurrent.locks.ReentrantReadWriteLock;
public class BitSet implements Cloneable, java.io.Serializable {
public ReentrantReadWriteLock sizeIsSticky_words_wordsInUseLock = new ReentrantReadWriteLock();
private final static int ADDRESS_BITS_PER_WORD = 6;
private final static int BITS_PER_WORD = 1 << ADDRESS_BITS_PER_WORD;
private final static int BIT_INDEX_MASK = BITS_PER_WORD - 1;
private static final long WORD_MASK = 0xffffffffffffffffL;
private static final ObjectStreamField[] serialPersistentFields = {new ObjectStreamField("bits", long[].class)};
private long[] words;
private transient int wordsInUse = 0;
private transient boolean sizeIsSticky = false;
private static final long serialVersionUID = 7997698588986878753L;
@Perm(requires = "no permission in alive", ensures = "no permission in alive")
private static int wordIndex(int bitIndex) {
return bitIndex >> ADDRESS_BITS_PER_WORD;
}
@Perm(requires = "pure(wordsInUse) * pure(words) in alive", ensures = "pure(wordsInUse) * pure(words) in alive")
private void checkInvariants() {
sizeIsSticky_words_wordsInUseLock.readLock().lock();
assert (wordsInUse == 0 || words[wordsInUse - 1] != 0);
assert (wordsInUse >= 0 && wordsInUse <= words.length);
assert (wordsInUse == words.length || words[wordsInUse] == 0);
sizeIsSticky_words_wordsInUseLock.readLock().unlock();
}
@Perm(requires = "share(wordsInUse) * pure(words) in alive", ensures = "share(wordsInUse) * pure(words) in alive")
private void recalculateWordsInUse() {
int i;
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
for (i = wordsInUse - 1; i >= 0; i--)
if (words[i] != 0)
break;
wordsInUse = i + 1;
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "unique(sizeIsSticky) in alive", ensures = "unique(sizeIsSticky) in alive")
public BitSet() {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
initWords(BITS_PER_WORD);
sizeIsSticky = false;
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "unique(sizeIsSticky) in alive", ensures = "unique(sizeIsSticky) in alive")
public BitSet(int nbits) {
if (nbits < 0)
throw new NegativeArraySizeException("nbits < 0: " + nbits);
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
initWords(nbits);
sizeIsSticky = true;
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "unique(words) in alive", ensures = "unique(words) in alive")
private void initWords(int nbits) {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
words = new long[wordIndex(nbits - 1) + 1];
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "share(words) * share(sizeIsSticky) in alive", ensures = "share(words) * share(sizeIsSticky) in alive")
private void ensureCapacity(int wordsRequired) {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
if (words.length < wordsRequired) {
int request = Math.max(2 * words.length, wordsRequired);
words = Arrays.copyOf(words, request);
sizeIsSticky = false;
}
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "share(wordsInUse) in alive", ensures = "share(wordsInUse) in alive")
private void expandTo(int wordIndex) {
int wordsRequired = wordIndex + 1;
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
if (wordsInUse < wordsRequired) {
ensureCapacity(wordsRequired);
wordsInUse = wordsRequired;
}
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "no permission in alive", ensures = "no permission in alive")
private static void checkRange(int fromIndex, int toIndex) {
if (fromIndex < 0)
throw new IndexOutOfBoundsException("fromIndex < 0: " + fromIndex);
if (toIndex < 0)
throw new IndexOutOfBoundsException("toIndex < 0: " + toIndex);
if (fromIndex > toIndex)
throw new IndexOutOfBoundsException("fromIndex: " + fromIndex + " > toIndex: " + toIndex);
}
@Perm(requires = "share(words) in alive", ensures = "share(words) in alive")
public void flip(int bitIndex) {
if (bitIndex < 0)
throw new IndexOutOfBoundsException("bitIndex < 0: " + bitIndex);
int wordIndex = wordIndex(bitIndex);
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
expandTo(wordIndex);
words[wordIndex] ^= (1L << bitIndex);
recalculateWordsInUse();
checkInvariants();
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "share(words) in alive", ensures = "share(words) in alive")
public void flip(int fromIndex, int toIndex) {
checkRange(fromIndex, toIndex);
if (fromIndex == toIndex)
return;
int startWordIndex = wordIndex(fromIndex);
int endWordIndex = wordIndex(toIndex - 1);
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
expandTo(endWordIndex);
long firstWordMask = WORD_MASK << fromIndex;
long lastWordMask = WORD_MASK >>> -toIndex;
if (startWordIndex == endWordIndex) {
words[startWordIndex] ^= (firstWordMask & lastWordMask);
} else {
words[startWordIndex] ^= firstWordMask;
for (int i = startWordIndex + 1; i < endWordIndex; i++)
words[i] ^= WORD_MASK;
words[endWordIndex] ^= lastWordMask;
}
recalculateWordsInUse();
checkInvariants();
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "share(words) in alive", ensures = "share(words) in alive")
public void set(int bitIndex) {
if (bitIndex < 0)
throw new IndexOutOfBoundsException("bitIndex < 0: " + bitIndex);
int wordIndex = wordIndex(bitIndex);
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
expandTo(wordIndex);
words[wordIndex] |= (1L << bitIndex);
checkInvariants();
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "no permission in alive", ensures = "no permission in alive")
public void set(int bitIndex, boolean value) {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
if (value)
set(bitIndex);
else
clear(bitIndex);
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "share(words) in alive", ensures = "share(words) in alive")
public void set(int fromIndex, int toIndex) {
checkRange(fromIndex, toIndex);
if (fromIndex == toIndex)
return;
int startWordIndex = wordIndex(fromIndex);
int endWordIndex = wordIndex(toIndex - 1);
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
expandTo(endWordIndex);
long firstWordMask = WORD_MASK << fromIndex;
long lastWordMask = WORD_MASK >>> -toIndex;
if (startWordIndex == endWordIndex) {
words[startWordIndex] |= (firstWordMask & lastWordMask);
} else {
words[startWordIndex] |= firstWordMask;
for (int i = startWordIndex + 1; i < endWordIndex; i++)
words[i] = WORD_MASK;
words[endWordIndex] |= lastWordMask;
}
checkInvariants();
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "no permission in alive", ensures = "no permission in alive")
public void set(int fromIndex, int toIndex, boolean value) {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
if (value)
set(fromIndex, toIndex);
else
clear(fromIndex, toIndex);
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "share(wordsInUse) * share(words) in alive", ensures = "share(wordsInUse) * share(words) in alive")
public void clear(int bitIndex) {
if (bitIndex < 0)
throw new IndexOutOfBoundsException("bitIndex < 0: " + bitIndex);
int wordIndex = wordIndex(bitIndex);
try {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
if (wordIndex >= wordsInUse)
return;
words[wordIndex] &= ~(1L << bitIndex);
recalculateWordsInUse();
checkInvariants();
} finally {
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
}
@Perm(requires = "share(wordsInUse) * share(words) in alive", ensures = "share(wordsInUse) * share(words) in alive")
public void clear(int fromIndex, int toIndex) {
checkRange(fromIndex, toIndex);
if (fromIndex == toIndex)
return;
int startWordIndex = wordIndex(fromIndex);
try {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
if (startWordIndex >= wordsInUse)
return;
int endWordIndex = wordIndex(toIndex - 1);
if (endWordIndex >= wordsInUse) {
toIndex = length();
endWordIndex = wordsInUse - 1;
}
long firstWordMask = WORD_MASK << fromIndex;
long lastWordMask = WORD_MASK >>> -toIndex;
if (startWordIndex == endWordIndex) {
words[startWordIndex] &= ~(firstWordMask & lastWordMask);
} else {
words[startWordIndex] &= ~firstWordMask;
for (int i = startWordIndex + 1; i < endWordIndex; i++)
words[i] = 0;
words[endWordIndex] &= ~lastWordMask;
}
recalculateWordsInUse();
checkInvariants();
} finally {
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
}
@Perm(requires = "share(wordsInUse) * share(words) in alive", ensures = "share(wordsInUse) * share(words) in alive")
public void clear() {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
while (wordsInUse > 0)
words[--wordsInUse] = 0;
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "pure(wordsInUse) * pure(words) in alive", ensures = "pure(wordsInUse) * pure(words) in alive")
public boolean get(int bitIndex) {
if (bitIndex < 0)
throw new IndexOutOfBoundsException("bitIndex < 0: " + bitIndex);
try {
sizeIsSticky_words_wordsInUseLock.readLock().lock();
checkInvariants();
int wordIndex = wordIndex(bitIndex);
return (wordIndex < wordsInUse) && ((words[wordIndex] & (1L << bitIndex)) != 0);
} finally {
sizeIsSticky_words_wordsInUseLock.readLock().unlock();
}
}
@Perm(requires = "share(words) * share(wordsInUse) in alive", ensures = "share(words) * share(wordsInUse) in alive")
public BitSet get(int fromIndex, int toIndex) {
checkRange(fromIndex, toIndex);
try {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
checkInvariants();
int len = length();
if (len <= fromIndex || fromIndex == toIndex)
return new BitSet(0);
if (toIndex > len)
toIndex = len;
BitSet result = new BitSet(toIndex - fromIndex);
int targetWords = wordIndex(toIndex - fromIndex - 1) + 1;
int sourceIndex = wordIndex(fromIndex);
boolean wordAligned = ((fromIndex & BIT_INDEX_MASK) == 0);
for (int i = 0; i < targetWords - 1; i++, sourceIndex++)
result.words[i] = wordAligned
? words[sourceIndex]
: (words[sourceIndex] >>> fromIndex) | (words[sourceIndex + 1] << -fromIndex);
long lastWordMask = WORD_MASK >>> -toIndex;
result.words[targetWords - 1] = ((toIndex - 1) & BIT_INDEX_MASK) < (fromIndex & BIT_INDEX_MASK)
? ((words[sourceIndex] >>> fromIndex) | (words[sourceIndex + 1] & lastWordMask) << -fromIndex)
: ((words[sourceIndex] & lastWordMask) >>> fromIndex);
result.wordsInUse = targetWords;
result.recalculateWordsInUse();
result.checkInvariants();
} finally {
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
return result;
}
@Perm(requires = "pure(wordsInUse) * pure(words) in alive", ensures = "pure(wordsInUse) * pure(words) in alive")
public int nextSetBit(int fromIndex) {
if (fromIndex < 0)
throw new IndexOutOfBoundsException("fromIndex < 0: " + fromIndex);
try {
sizeIsSticky_words_wordsInUseLock.readLock().lock();
checkInvariants();
int u = wordIndex(fromIndex);
if (u >= wordsInUse)
return -1;
long word = words[u] & (WORD_MASK << fromIndex);
while (true) {
if (word != 0)
return (u * BITS_PER_WORD) + Long.numberOfTrailingZeros(word);
if (++u == wordsInUse)
return -1;
word = words[u];
}
} finally {
sizeIsSticky_words_wordsInUseLock.readLock().unlock();
}
}
@Perm(requires = "pure(wordsInUse) * share(words) in alive", ensures = "pure(wordsInUse) * share(words) in alive")
public int nextClearBit(int fromIndex) {
if (fromIndex < 0)
throw new IndexOutOfBoundsException("fromIndex < 0: " + fromIndex);
try {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
checkInvariants();
int u = wordIndex(fromIndex);
if (u >= wordsInUse)
return fromIndex;
long word = ~words[u] & (WORD_MASK << fromIndex);
while (true) {
if (word != 0)
return (u * BITS_PER_WORD) + Long.numberOfTrailingZeros(word);
if (++u == wordsInUse)
return wordsInUse * BITS_PER_WORD;
word = ~words[u];
}
} finally {
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
}
@Perm(requires = "pure(wordsInUse) * pure(words) in alive", ensures = "pure(wordsInUse) * pure(words) in alive")
public int length() {
try {
sizeIsSticky_words_wordsInUseLock.readLock().lock();
if (wordsInUse == 0)
return 0;
return BITS_PER_WORD * (wordsInUse - 1)
+ (BITS_PER_WORD - Long.numberOfLeadingZeros(words[wordsInUse - 1]));
} finally {
sizeIsSticky_words_wordsInUseLock.readLock().unlock();
}
}
@Perm(requires = "pure(wordsInUse) in alive", ensures = "pure(wordsInUse) in alive")
public boolean isEmpty() {
try {
sizeIsSticky_words_wordsInUseLock.readLock().lock();
return wordsInUse == 0;
} finally {
sizeIsSticky_words_wordsInUseLock.readLock().unlock();
}
}
@Perm(requires = "pure(wordsInUse) * pure(words) in alive", ensures = "pure(wordsInUse) * pure(words) in alive")
public boolean intersects(BitSet set) {
try {
sizeIsSticky_words_wordsInUseLock.readLock().lock();
for (int i = Math.min(wordsInUse, set.wordsInUse) - 1; i >= 0; i--)
if ((words[i] & set.words[i]) != 0)
return true;
} finally {
sizeIsSticky_words_wordsInUseLock.readLock().unlock();
}
return false;
}
@Perm(requires = "pure(wordsInUse) * pure(words) in alive", ensures = "pure(wordsInUse) * pure(words) in alive")
public int cardinality() {
int sum = 0;
sizeIsSticky_words_wordsInUseLock.readLock().lock();
for (int i = 0; i < wordsInUse; i++)
sum += Long.bitCount(words[i]);
sizeIsSticky_words_wordsInUseLock.readLock().unlock();
return sum;
}
@Perm(requires = "share(wordsInUse) * share(words) in alive", ensures = "share(wordsInUse) * share(words) in alive")
public void and(BitSet set) {
if (this == set)
return;
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
while (wordsInUse > set.wordsInUse)
words[--wordsInUse] = 0;
for (int i = 0; i < wordsInUse; i++)
words[i] &= set.words[i];
recalculateWordsInUse();
checkInvariants();
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "share(wordsInUse) * share(words) in alive", ensures = "share(wordsInUse) * share(words) in alive")
public void or(BitSet set) {
if (this == set)
return;
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
int wordsInCommon = Math.min(wordsInUse, set.wordsInUse);
if (wordsInUse < set.wordsInUse) {
ensureCapacity(set.wordsInUse);
wordsInUse = set.wordsInUse;
}
for (int i = 0; i < wordsInCommon; i++)
words[i] |= set.words[i];
if (wordsInCommon < set.wordsInUse)
System.arraycopy(set.words, wordsInCommon, words, wordsInCommon, wordsInUse - wordsInCommon);
checkInvariants();
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "share(wordsInUse) * share(words) in alive", ensures = "share(wordsInUse) * share(words) in alive")
public void xor(BitSet set) {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
int wordsInCommon = Math.min(wordsInUse, set.wordsInUse);
if (wordsInUse < set.wordsInUse) {
ensureCapacity(set.wordsInUse);
wordsInUse = set.wordsInUse;
}
for (int i = 0; i < wordsInCommon; i++)
words[i] ^= set.words[i];
if (wordsInCommon < set.wordsInUse)
System.arraycopy(set.words, wordsInCommon, words, wordsInCommon, set.wordsInUse - wordsInCommon);
recalculateWordsInUse();
checkInvariants();
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "share(wordsInUse) * share(words) in alive", ensures = "share(wordsInUse) * share(words) in alive")
public void andNot(BitSet set) {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
for (int i = Math.min(wordsInUse, set.wordsInUse) - 1; i >= 0; i--)
words[i] &= ~set.words[i];
recalculateWordsInUse();
checkInvariants();
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "pure(wordsInUse) * pure(words) in alive", ensures = "pure(wordsInUse) * pure(words) in alive")
public int hashCode() {
long h = 1234;
sizeIsSticky_words_wordsInUseLock.readLock().lock();
for (int i = wordsInUse; --i >= 0;)
h ^= words[i] * (i + 1);
sizeIsSticky_words_wordsInUseLock.readLock().unlock();
return (int) ((h >> 32) ^ h);
}
@Perm(requires = "pure(words) in alive", ensures = "pure(words) in alive")
public int size() {
try {
sizeIsSticky_words_wordsInUseLock.readLock().lock();
return words.length * BITS_PER_WORD;
} finally {
sizeIsSticky_words_wordsInUseLock.readLock().unlock();
}
}
@Perm(requires = "pure(wordsInUse) * pure(words) in alive", ensures = "pure(wordsInUse) * pure(words) in alive")
public boolean equals(Object obj) {
if (!(obj instanceof BitSet))
return false;
if (this == obj)
return true;
BitSet set = (BitSet) obj;
try {
sizeIsSticky_words_wordsInUseLock.readLock().lock();
checkInvariants();
set.checkInvariants();
if (wordsInUse != set.wordsInUse)
return false;
for (int i = 0; i < wordsInUse; i++)
if (words[i] != set.words[i])
return false;
} finally {
sizeIsSticky_words_wordsInUseLock.readLock().unlock();
}
return true;
}
@Perm(requires = "share(sizeIsSticky) * share(words) in alive", ensures = "share(sizeIsSticky) * share(words) in alive")
public Object clone() {
try {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
if (!sizeIsSticky)
trimToSize();
try {
BitSet result = (BitSet) super.clone();
result.words = words.clone();
result.checkInvariants();
return result;
} catch (CloneNotSupportedException e) {
throw new InternalError();
}
} finally {
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
}
@Perm(requires = "pure(wordsInUse) * share(words) in alive", ensures = "pure(wordsInUse) * share(words) in alive")
private void trimToSize() {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
if (wordsInUse != words.length) {
words = Arrays.copyOf(words, wordsInUse);
checkInvariants();
}
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
@Perm(requires = "share(sizeIsSticky) * share(words) in alive", ensures = "share(sizeIsSticky) * share(words) in alive")
private void writeObject(ObjectOutputStream s) throws IOException {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
checkInvariants();
if (!sizeIsSticky)
trimToSize();
ObjectOutputStream.PutField fields = s.putFields();
fields.put("bits", words);
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
s.writeFields();
}
@Perm(requires = "pure(words) * share(wordsInUse) * share(sizeIsSticky) in alive", ensures = "pure(words) * share(wordsInUse) * share(sizeIsSticky) in alive")
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
ObjectInputStream.GetField fields = s.readFields();
sizeIsSticky_words_wordsInUseLock.readLock().lock();
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
words = (long[]) fields.get("bits", null);
wordsInUse = words.length;
recalculateWordsInUse();
sizeIsSticky = (words.length > 0 && words[words.length - 1] == 0L);
checkInvariants();
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
sizeIsSticky_words_wordsInUseLock.readLock().unlock();
}
@Perm(requires = "pure(wordsInUse) in alive", ensures = "pure(wordsInUse) in alive")
public String toString() {
try {
sizeIsSticky_words_wordsInUseLock.writeLock().lock();
checkInvariants();
int numBits = (wordsInUse > 128) ? cardinality() : wordsInUse * BITS_PER_WORD;
StringBuilder b = new StringBuilder(6 * numBits + 2);
b.append('{');
int i = nextSetBit(0);
if (i != -1) {
b.append(i);
for (i = nextSetBit(i + 1); i >= 0; i = nextSetBit(i + 1)) {
int endOfRun = nextClearBit(i);
do {
b.append(", ").append(i);
} while (++i < endOfRun);
}
}
b.append('}');
return b.toString();
} finally {
sizeIsSticky_words_wordsInUseLock.writeLock().unlock();
}
}
}
| [
"liebes@ifix.com"
] | liebes@ifix.com |
60ddc83f81d75399e36239ba9780b9d70dd00fb2 | e01653182131c84e36e132a427d5d9519293fd99 | /data/src/main/java/com/example/demo/data/domain/dto/BookDTO.java | 480bf4dc02a2d65d5b9671a8bc02f533bc23a667 | [] | no_license | Gamurar/library-spring | fd12b5fcc56d1edf56498f1c70b7eabf13341605 | 0534919c99595435f07cc0335678d037b7d8bece | refs/heads/master | 2022-12-20T13:53:36.986685 | 2019-07-15T12:15:32 | 2019-07-15T12:15:32 | 194,243,932 | 0 | 3 | null | 2022-12-14T20:41:40 | 2019-06-28T09:11:55 | Java | UTF-8 | Java | false | false | 7,249 | java | package com.example.demo.data.domain.dto;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class BookDTO {
public String DEFAULT_PICTURE_CONTENT = "iVBORw0KGgoAAAANSUhEUgAAAPAAAAC4CAIAAABSPPbEAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAABNLSURBVHja7J1pd+JIsoYjUisSm82OcdX0/P/fc+fOlzvT3VPtrinKCxjQgjLvh4R0khKLq20XSPGeOnVsITCgJ0MRkZGR+L//808gkcoiRl8BiYAmkQhoEomAJpEIaBIBTSIR0CQSAU0iEdAkEgFNIqBJJAKaRCKgSSQCmkQioEkENIlEQJNIBDSJRECTSAQ0iYAmkQhoEomAJpEIaBKJgCYR0CQSAU0iEdAkEgFNIhHQJAKaRCKgSSQCmkQioEkkAppEQJNIBDSJRECTSAQ0iYAmnaeEEAd+NU9GEEjfGQF9xkJEHWJEPIA1CkDxchoBTTo784yIBp3y4D7jLR/inJ9o1Alo0k8zzzrN8lGddZ1y9ZB+PgFNOi8H2jgohNAtsSH5EGNVvLg2oXO2Ftq0PYwJIWTkJwAsy3Icx7IsAMiyLI7jF2d663tU0EIT0OdqofHFjZY/OK7rurbneZ7nua7ruq7iVQghhJjNnmez2Wq1EhmX9JOFJp2LgiCwLEvh63nO0dix3W62283Hx9l0Ol0nKWOsgkaagD4aWnDJjbJ5R4MtI3rbeAnA5fH80wVCEASO47iuW6vVHMdyHOe1non6od1u1mrer7/+LjJyOUgaxAY3ytoVQpm3l5ozwNVTEFHa3Rd8Pdu27aPRofGaRlrDeIrrupPJ5PdffyOXo1pphANQ6ijr6TCJNSJurfgGVsUrh40tl0d23QbP8zZh3IlvQGdXHxWGVTZsPyLWal6z3Zo9PhHQVaH5xPSCfuaO44FcnpxJxBnjnMtYzXEcb6MXfAuNrsF03sAb7OYHgP4UHX1E7HavCeiq6LXOpbLNyhYCgG3bjuPU64HjOLZtB0EAp01n7HrYIm9xDyhNszRNl8tlkiTr9Xq5XAJAs9kcDvsy8fySFXGcWuivFhEBXS2yD4d6AjdmuBbUGGNhGFqW5bpuEPhvNVQMv0KzvrBeZ0mSRFGUJInkGIVpohFx/jSL4/iXXz4brxmGIQFdOd9j40ggwNYbZowpt8H3Xdu2Pc87HA6e4qwXOhj6wTRN4ziW4GYpj6IIdufAscjFlz/EcbxYrMKwph93XZdcjuql6Bjzfd9ymKc8X8fZx+4PJML2eRSS3SRZSwOcJAnnXCaPLWT6LHehf6KOqINRFCmgVbqDgC6bzwAAHHYe2k36Oo5jHc2U/fV0ymoRrdfrOI6jKIrjeL1eFwwtQOCCAR4u5Ch8nyggjRPjBM/zOAgGWBjXEtBnna9Qt3V9BoTZlu/7tm27rhsEgT5ncWAA/DDK6jWXyyhN0zRNF4vFer1O01QVK78fTEmS5A/WarV4FRlfEVnoC8BaXi15y261WvVmKGeP9xm506nd5wRLycIgqTRNV6tYbKVS1wCA8L4wCSGiKOIcjBo727aj7SCvwkz45VtoBBSgrLLv+6Ob4b6p432p38ME604w5zyKoihK1kkqIc6yzKgiEjIzDSi4AAQGchaGH70z/MVIgHMuvXD9uO/7i/mzNh9EPvSFeB1CiHa7PRwPTgzRCn81CM6yLEnWi8UiTdP1er1arfS4bWN6tYJ65fPkAOKwZxHK24YTSZLYtm8AXamKjssPCgUAIgC0rtrD0eAUu7tPcZxyzheLhT5nAXxnIprhS9y279X2PfSuYMnhtFqtjAS54zjKbKthRkHhuWc5LMfu97v7XF7DJZCXdr1eJ0kSx3G0XKVpGsepeeb2Dxw2rvpTcnV24r0DwdyYjHOJDse4Y1BQeAH+Rq/Xk0Yoj5S8kHEcy1yvzPnKC29kHnTc856JwaVeCbSbQdsULamTP8wuCiEKs4G2badpSmm7yzHSFmu1Gvnb+moV39/fR1G0TuTlZMqdxf2Jv32+gQHBfv+BF3oa704zggCQk4vGwLZdJ0kSRAsAEDnnHBiiIKDP1UL7npc3nE9P87u7O2WGhRCHPVi9NPTjXYU3iSUEAOc8yzLLsnS/PwzD1WKpRhoiQnmdjotfGCxLcHZv+pBl2devX3OpOp43n4WpukKTfP6XUs4IymBA/35smwFDqMbEysUDbfiyKjbinKOQrqx47YL+i81zMeAiHxe6rquChPy3YQQGBPTPt9D5g47joHgJgFT+4XBdv2GbLxBrjohpmhof0/d9zYzbRkOPfc1ryIf+aVKRkA40bCfPJNPSRT4Q4OfTI9szL2XMcxkarlarfIrGdd1t6RI/EPKWIEVdBqBlUY5ugxExCILlcrlTTHzCQhJ5sud5lmVtl1pdTlCIAACWVfCOw7AW27b6lqJoKTIzFC6Hy1EeoI2scGE5x4EL1mw36vV6GIal66DFAdhgMDDuQiBgtYzm8/lsNluv16WZQSxFLUfG4zjVW7Egou1asm5JLwzKm+RM8DAMR6OBHABlzACw4ngDoRb6tdDv9jvT6fT+/hFK8dnLYI1kUY5xUC5ZlSbqgN/c7/dvb28UzeWuc1CJjh0CGOv1epPJpPDWtBtOENA/Ly5UuSrY9uHMT/X1er3r63a+8UWZTHX+UxeuK6vXg5vbibG0B96/QpCALr5meQttWZbKaXDO8zUMtVrtunu1j+bSYK1PGR4+Mwj8fr9rrIG4uG+gJCtW8kAjYq1WWy2WQluvoTM9HI8g16hF/pokSZZlAAwRhUwHlEiyDUNh2qfT6cwe53Ec6/kiAvosfGjlaeSLNACg0Wo6jmUULnPOp9Pp09NcRv3l64CPWp+GMAwHg4FaIKzw7XQ6f/zxBwBcaFFeSSw05zxNUyNV5/vuYv7iOAohVMaj2aybt2OOv/36exRFiIgCEAABEbBUzjRuyuxExpfPi389/9/f/v6L69qgpTvr9bo0AYVNzMiH/jjbo0p+lbzdKjydfy0Hsnn6t2/f4jhW04on+p0X5EMbddvSVH/58sU4mVno+76cV7rEQKIsQAtYrWLDILmuK/vgaxdMbJ0R84M/Pj7+RDdDFQ+9d5bDUBzHq9Vq96sEtJhcr3OJbnR5ZsUMN1oWMECuM+IPX/t3RXlfc1FS5YBWNrUw0SG9DlWcdG40Q66TORFZdaCV3Y2iKD+nJadX5DnnX6TxE70dAvrs7LRcImow4Xmeimwu4sqRkSagXwr582uedZfjIlghN5qAfpk62bSG0SQz0xcUclWhQOpdVZKJFUQUAEmyNuDw/UtqkCxplsmZ/NJAUoWABgAUsO2/sXP79mpuFCVn3IaCIQoOwnGcbve61WqpB56enr59+56la6hAgxgC2gykENGcI9hycN5vnwsBfs3/9MmsSG61WvV68z+//R5FUTW3ha2uD61aeGVZZtzBwzA8c8PGGJP19fn5QsvCT58+qdW+xGv5gTaKmHXXUx6XhdHn/P6bzaZc2apXsSqyBfKrq6ujE0OkkgBt5ATyS1c8zztnC80YC+phYddqNR8U1EPKflTI5dAhMFLRQoharXbOHAghbHtvKyPlZ+u9vEiVANqw0HqdpF5HenZAIwhRYJ4vtnsTAf2mUj60XmRn2/bZGmkhRGHKWUc5ilTjEYoLKxAU7tyb1yLLTHbDsCZv2Wf4zhngw8ND0eNcnfPw/R4FUFBYlaBwn5FWsm37I9/PTo5iT1GUniBP4+Tu7mvhpUHEu7s7uRiHMVa+FbsE9HEjrQMtedJ7dLy3VMIYt9Jn+PR9WPRds54eHv/4z51MoquTsyy7u/v69DTft1EGKa+SrPo2toA37LfneYwx4B/BtL7Vi977VO+XoL9bxliWZYg4n8/n83m9Xq/VPIEQRclisRBCABewzd9R2q4SQO9LdOiQWZaV8fWH3S5UIvnz58+Pj48PDw+FHW10uysPPj8/Pz8/q5dSBl5VFBKylchy6Ou0DR9aEiZL2D7Y/+n3+17N7fSu/cAzOtro73zf4lzlaeyLFkjlz3JIS5bf01vvYv8x/k/YqF912jIkvbm5sW17n4k9vIdnYWM+UiWyHKqTnTG98vGJDtu2R6ORegOOYw2Hw8K568OkXm5LLgL6zeBmgOskM3CXkdZ73yvUnxtPRnq9EQCrN8NOr2ukX4Dh6fsr57dRJMpLDrRSvqXBB/jQqiCuPxxID8ewvp3OVS0MdqK9jB+1zXlbrrxq8kOqAnS+0v/Ni0gLZ0wQsd5stNutQguKiDc3I8dx1FbyB96SHuYaLbkuax07Af0GkokOo17+zeNChaNiznad4bAvUSzs7oWIN7djaWIPl4Pq+Or9rQVC2Kjffv5Ujl3YCOiTkh6yiNTYRuhtgVYOxkv/aRCTyURtn2X89U3lBmOe541uxqf4DMaMjPxDvu+Px8Mg8Lv9Tr7hPqlsQKsLvFqtjOSd4zhveI/Wd7CVhnM0GumtaQ0rq9vjVqvRbLeORnX5/LR0WuSdodPpNJt1DuR1VMDlkHHhvi5KbzNyLKZT22g02u2mgXKh7yvV73dPvGPoI+Hz58/6bl2Dgdq8i+x0GYHWDXBRFyXnzf+WdANU1tlwFQpDQxWkjiejU+JUZaRHo5G7/Qgbl9225epacjzKCbR+XReLgkQHWkeGweHX3Dkutp40iJvbsU7miY2aHMcZjgcvbwNBdbPObyh/1bluthuQCzc9z+kPewLXhHL5XY48r77vGzvUH+1wbmTHzF8R+v3+DyzxUo5Kr9fbWHpAFGBsIQDbVGC/38371vJFWq1Ws9nMv3g1F9WWFmjlcuhwOI6jTyaf0q/f2AfbKDCq1+v6ToevupnI86+7V7XQV7/q9R7bzk/+cNgvvG+8TEyOx8ojV6yXb9OjSgMNAHGcGpyFYajHc6/1yw077TjOaLTxGSSIp+SV8771ZDKxXSdvVoUQzLbG46Hcvyf/CrrGkxFaTM+9kMtRKqHYTK/ol7bZbHo1Xy1ketVVzy/GHk9u1FZReVdhny+e514m4wpr/29vb/OT9gb08gfbtieTccm2wSWgd7RZ8bGr29ubbrf7qriwMH3RH/ZUa1M183eivc9Pifu+PxgN9Yc4iMFoqHdP1edo8ntbIWIQBJ3etRBC38OKgC4R0PPn/Eppy7J0oH+gOBMRG43G1dWVvpf40SFx9A+1281mu6XGTL/fbTbr+aSHMeNtJLy73W6z2ZRruqppp8sMdJZl0+n0sFv8qgsvuXEcZzgcGs89+jqFfoKhfr8bBAHnvN1udzqdfEIDiopDjJ+Hw/6HLc8hoD9aj/dPy2V02LU43TzLrPN4MmI27uPp6HiAokUJ8n/LskY3w6Be6w97+xIaR5OMzLbGk1HhPrDawGAE9GWGhohfvnxRC1iM9p4/kOgYDAZvXuSkY+o4juyf+1dezfd9fUgoqVXososNAX154pxn6fq3f/8+nd4XGsujZOs+axiG19ftd3qrb+vyNhqb+ifYrdorfRdTu6wfTAgEeOkQMP3vt/nTrNlsBvWwVvPyqYMDnEkIbNseT8ZwwuTij9GsaHur3uaj0SCKlmm8FkIY63NLnAApbx4adzpgyF7o0+n0t3//+o9//PNVWQ756M3tWJ71HjTor/lXaNbn84UQt7e3AkFVL1Uh9VF+Hzrf14LBq21Vb9B/70YI+aVWP/Z59TFs2/bt7a2qma5Cq5oyA60WiRx1Kg6/jizY+ICx9yb+gPH0IPB7vY54t3sLAf2h5hlOmMY7fJkdxzFqnc9/DBvqdDqNRgOqIbv0n9DgdV9IZ8wnKzK8mnv/+P30rMjZfXzBAMCx7H0O9J7xzC+0PaQNFdPegn3tuN5Acf70vGBLfaLuEm/ceivUXdzNxQR6ea38Hi6rTyRtcWCmO9Qqa0mAYdgu1A196YJQYHHNZgz55r/kQ18Au3lf2Ug1qIYEJQuR1ey3ETQbiWqjkJWAPmvl92Fpt9uHuc+v87vEMay9c84YC4JAVqjqNMtiPTi2pICAPiOHUvUKU5fq+vraWBp4tK7tEiMHvT8vY6w/HOSGehbH8eVuUFQ5oCWms9nMmCNECz797bZ93UKLAUMOAhiWoN3FZjH59p/8aAKh0Wp+/uWTau2gRu/z8/NFO1pVzHIIIebzea/XsW3bmHPu9/uDwSBJ1lmWba8rv/AZY2Z8fMSdrmh6qzFEnE6nMhg0YkQC+rzvv1z8+cfX288T5VCqbdQAwHXt6nwzevZ9Or1fJxnmvBRyOS5Ay+Xy69dv+vdQhTVLB5rwzueLwgU+5ENfxnVFxIeHh//+d5rvK1Bisvc14Z3Nnv/8888SfEC7migzxuS8yffv3+M4Hgx6ch2ePqFQEXHOp9P7++n3cnzsygEtUQY1G4y4mD//63nRaNUbjcamE01JgTZmT5bL5Ww2m88XfJ2VZlfPilpoI+kh77mz2TNsu2Tk276UxuXY7hLGOQe1wW5pSqWrmOUwru6m6dHWPAnO41Wk6nJK40/vNPXjHAAsxni28zFLMIArDXThilG9jKE0NBuT2Pr9Ry+mK4GRrnS1XXWCvwPLYUrmVlH5KKlcQT99BSQCmkQioEkkAppEIqBJBDSJRECTSAQ0iURAk0gENImAJpEIaBKJgCaRCGgSiYAmEdAkEgFNIhHQJBIBTSIR0CQCmkQioEkkAppEIqBJJAKaRECTSAQ0iURAk0gENIlEQJMIaBKJgCaRCGgSiYAmkQhoEgFNIhHQJBIBTSK9Wv8/AC55u0zxLeQOAAAAAElFTkSuQmCC";
private String isbn;
private String name;
private PublisherDTO publisher;
private List<AuthorDTO> authors = new ArrayList<>(10);
private String publishYear;
private Integer copies = 0;
private String pictureName;
private String pictureContent = DEFAULT_PICTURE_CONTENT;
}
| [
"iana_gamurari@bk.ru"
] | iana_gamurari@bk.ru |
047e60a6721acf5d19fecd4ff71b1885fe5d5731 | 1f19aec2ecfd756934898cf0ad2758ee18d9eca2 | /u-1/u-11/u-11-f7029.java | 2782546b2bba4758f6a680e9918a38b6a14e70c8 | [] | no_license | apertureatf/perftest | f6c6e69efad59265197f43af5072aa7af8393a34 | 584257a0c1ada22e5486052c11395858a87b20d5 | refs/heads/master | 2020-06-07T17:52:51.172890 | 2019-06-21T18:53:01 | 2019-06-21T18:53:01 | 193,039,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 106 | java | mastercard 5555555555554444 4012888888881881 4222222222222 378282246310005 6011111111111117
3316522402687 | [
"jenkins@khan.paloaltonetworks.local"
] | jenkins@khan.paloaltonetworks.local |
37b8a32f1adf6fe2511da0e9508a4fc9faf3642e | 4c3bfd6d3e71e8b1d07a168e1e8b93bb7401e1af | /src/main/java/com/nju/oawork/model/entity/plan/Plan.java | 6264c15b9d9ae261e731a02d68d1858fd026949e | [
"MIT"
] | permissive | MODmaxM/OAwork | 04e83760b63ef48733eba9b141639750577e766d | ec488311c1fecf02ad3e6aee5d5b71c3f3bad3ac | refs/heads/master | 2022-06-21T04:40:21.340667 | 2020-02-14T14:10:56 | 2020-02-14T14:10:56 | 240,513,693 | 0 | 0 | MIT | 2022-06-21T02:48:04 | 2020-02-14T13:24:37 | JavaScript | UTF-8 | Java | false | false | 4,259 | java | package com.nju.oawork.model.entity.plan;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import com.nju.oawork.model.entity.user.User;
@Entity
@Table(name="aoa_plan_list")
/**
* 计划表
* @author 宋佳
*
*/
public class Plan {
@Id
@Column(name="plan_id")
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long planId;
@Column(name="type_id")
private Long typeId; //类型id
@Column(name="status_id")
private Long statusId; //状态id
@Column(name="attach_id")
private Long attachId; //附件id
@Column(name="start_time")
private Date startTime; //开始时间
@Column(name="end_time")
private Date endTime; //结束时间
@Column(name="create_time")
private Date createTime; //记录创建时间
@NotEmpty(message="标题输入框不能为空")
@Length(min=0,max=50)
private String title; //标题
private String label; //标签
@Column(name="plan_content")
@NotEmpty(message="计划输入框不能为空")
private String planContent; //计划内容
@Column(name="plan_summary")
private String planSummary; //计划总结
@Column(name="plan_comment")
private String planComment; //计划评论
@ManyToOne
@JoinColumn(name="plan_user_id")
private User user; //用户计划外键
public Plan() {}
public Plan(Long typeId, Long statusId, Long attachId, Date startTime, Date endTime, Date createTime, String title,
String label, String planContent, String planSummary, String planComment, User user) {
super();
this.typeId = typeId;
this.statusId = statusId;
this.attachId = attachId;
this.startTime = startTime;
this.endTime = endTime;
this.createTime = createTime;
this.title = title;
this.label = label;
this.planContent = planContent;
this.planSummary = planSummary;
this.planComment = planComment;
this.user = user;
}
public Long getAttachId() {
return attachId;
}
public void setAttachId(Long attachId) {
this.attachId = attachId;
}
public Long getPlanId() {
return planId;
}
public void setPlanId(Long planId) {
this.planId = planId;
}
public Long getTypeId() {
return typeId;
}
public void setTypeId(Long typeId) {
this.typeId = typeId;
}
public Long getStatusId() {
return statusId;
}
public void setStatusId(Long statusId) {
this.statusId = statusId;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getPlanContent() {
return planContent;
}
public void setPlanContent(String planContent) {
this.planContent = planContent;
}
public String getPlanSummary() {
return planSummary;
}
public void setPlanSummary(String planSummary) {
this.planSummary = planSummary;
}
public String getPlanComment() {
return planComment;
}
public void setPlanComment(String planComment) {
this.planComment = planComment;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
@Override
public String toString() {
return "Plan [planId=" + planId + ", typeId=" + typeId + ", statusId=" + statusId + ", startTime=" + startTime
+ ", endTime=" + endTime + ", createTime=" + createTime + ", title=" + title + ", label=" + label
+ ", planContent=" + planContent + ", planSummary=" + planSummary + ", planComment=" + planComment
+ "]";
}
}
| [
"ccy19971024@gmail.com"
] | ccy19971024@gmail.com |
822f62050667b6aba654dfbaa588956393f12f76 | 6cf4066531057d72b8f8e5ab7cd5c84f7b4f4346 | /app/src/main/java/com/example/taper/Models/Likes.java | dc422348369319e97092a0353cca5aee79af82f7 | [] | no_license | Prl-1234/Taper-android-app | d0b978e1bd42e0eee72469e29e2e536813fa452f | 487f38bd9c85eb64455f923b06a222d28d48543f | refs/heads/master | 2023-02-02T04:25:39.192998 | 2020-12-12T12:34:12 | 2020-12-12T12:34:12 | 307,369,709 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 481 | java | package com.example.taper.Models;
public class Likes {
private String user_id;
public Likes(String user_id) {
this.user_id = user_id;
}
public Likes() {
}
public String getUser_id() {
return user_id;
}
public void setUser_id(String user_id) {
this.user_id = user_id;
}
@Override
public String toString() {
return "Likes{" +
"user_id='" + user_id + '\'' +
'}';
}
}
| [
"priyal0917@gmail.com"
] | priyal0917@gmail.com |
cbee799258749394c7c9027e5fea6057754c0483 | 7b01fc739e0af0176a8346361a5ce8b6096ceb83 | /src/dao/ResetCategory.java | d3efb1f1942cf40240b09a918570486107666e65 | [] | no_license | DpprZ/KZSDN | f88fc93b6ad537179726531a370dbc96c64ab0c2 | e7de677f3c7e2584087a080687fe770731f08b9f | refs/heads/master | 2023-02-08T01:45:53.178354 | 2021-01-05T05:47:10 | 2021-01-05T05:47:10 | 326,878,357 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,219 | java | package dao;
import bean.Blog;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;
public class ResetCategory {//返回都是false
public boolean resetBlog(String author,String category,String str) throws ClassNotFoundException, SQLException {
System.out.println(author+" "+category+" "+str);
boolean flag=false;
Properties info=new Properties();
String user = "root";
String password = "dpprz.777";
String Driver = "com.mysql.cj.jdbc.Driver";
String url = "jdbc:mysql://127.0.0.1:3306/cksdn?serverTimezone=GMT";
//注册驱动
Class.forName(Driver);
//获取连接
Connection connection= DriverManager.getConnection(url,user,password);
String sql ="update blog set category=? where author=? and category=?";
PreparedStatement statement=connection.prepareStatement(sql);
statement.setString(1,str);
statement.setString(2,author);
statement.setString(3,category);
int update=statement.executeUpdate();
if(update==1)
flag=true;
return flag;
}
}
| [
"1223788353@qq.com"
] | 1223788353@qq.com |
eb893d4d065e129863d3744535e0ad5b05fbb4e1 | 28f1bd2053f48abad4ee0dc51ccb5d28730937c0 | /疯狂Java讲义(第3版)光盘内容/codes/09/9.1/GenericList.java | 3ffb236106196a9f0ce46584aab26b594ac363e1 | [
"Apache-2.0"
] | permissive | JamesKing9/-Java-3- | ce029cd2d78b50aaf4bdf39f120b83fd9ff1cf94 | 3fa0aae7bc5dd95a119322c431431f116fda9ec8 | refs/heads/master | 2020-12-02T10:03:32.508167 | 2017-07-09T13:05:31 | 2017-07-09T13:05:31 | 96,684,655 | 2 | 1 | null | null | null | null | GB18030 | Java | false | false | 700 | java |
import java.util.*;
/**
* Description:
* <br/>网站: <a href="http://www.crazyit.org">疯狂Java联盟</a>
* <br/>Copyright (C), 2001-2016, Yeeku.H.Lee
* <br/>This program is protected by copyright laws.
* <br/>Program Name:
* <br/>Date:
* @author Yeeku.H.Lee kongyeeku@163.com
* @version 1.0
*/
public class GenericList
{
public static void main(String[] args)
{
// 创建一个只想保存字符串的List集合
List<String> strList = new ArrayList<String>(); // ①
strList.add("疯狂Java讲义");
strList.add("疯狂Android讲义");
// 下面代码将引起编译错误
strList.add(5); // ②
strList.forEach(str -> System.out.println(str.length())); // ③
}
}
| [
"shencheng.wan@outlook.com"
] | shencheng.wan@outlook.com |
ddb70c42a1203b0164343197067c1ce4f31a14ff | f166bac709823f669c1db1982fb8a4bf3188be41 | /Cos.java | be7c66c39e89d12ac815d113220c1b4435e3a3f8 | [] | no_license | ModiEsawi/Mathematical-Expressions-Automatic-Differentiation-and-Algebraic-Simplification | b06b4c2128a7e9bc0918031f61e7c020c8e9e064 | 49f9d13e7c4733758ea20e1fb1eda5483e6bf32d | refs/heads/master | 2022-11-28T16:52:25.768674 | 2020-08-11T11:07:58 | 2020-08-11T11:07:58 | 286,719,961 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,486 | java | import java.util.List;
import java.util.Map;
/**
* The Cos class.
*/
public class Cos extends UnaryExpression implements Expression {
/**
* the given Expression that the current expression gets.
*
* @param singleExpression : the expression.
*/
public Cos(Expression singleExpression) {
super(singleExpression);
}
/**
* the given Expression that the current expression gets.
*
* @param variable : the variable (string).
*/
public Cos(String variable) {
super(variable);
}
/**
* the given Expression that the current expression gets.
*
* @param number : the number.
*/
public Cos(double number) {
super(number);
}
/**
* evaluates the expression by cos function.
*
* @param assignment : holds variable values.
* @return : the result after calculation.
* @throws Exception : ignored
*/
public double evaluate(Map<String, Double> assignment) throws Exception {
return Math.cos((super.getExpression().evaluate(assignment)));
}
/**
* the variables in the expression stored in a list.
*
* @return : the list of variables in the current expression.
*/
public List<String> getVariables() {
return super.getExpression().getVariables();
}
/**
* the expression as a string.
*
* @return the string.
*/
public String toString() {
return "cos" + "(" + super.getExpression().toString() + ")";
}
/**
* assigning expression to a certain value.
*
* @param var : the variable that we will replace with the given expression.
* @param expression : the expression that the "var" will be replaced with.
* @return the new Expression after assignment.
*/
public Expression assign(String var, Expression expression) {
return new Cos(super.getExpression().assign(var, expression));
}
/**
* @param var : a variable differentiating relative.
* @return the derivative of cos which is -> -sin(f(x))' * f(x)'.
*/
public Expression differentiate(String var) {
return new Mult(new Mult(-1, new Sin(super.getExpression())),
super.getExpression().differentiate(var));
}
/**
* simplifying our expression.
*
* @return : the simplified expression.
*/
public Expression simplify() {
if (bonusSimplify() != null) {
return bonusSimplify();
}
if (super.getVariables().isEmpty()) {
/* if the variables list is empty that means we are dealing with a number, so we will just evaluate the
expression */
try {
return new Num(Math.cos((super.getExpression().simplify().evaluate())));
} catch (Exception e) {
basicCase();
}
}
return new Cos(super.getExpression().simplify());
}
/**
* an advanced simplification for the current expression.
*
* @return the simplified expression (may return nul).
*/
private Expression bonusSimplify() {
// cos(-x) = cos(x)
if (super.getExpression().toString().charAt(1) == '-') {
return new Cos(new Neg(super.getExpression()).simplify());
}
return null;
}
}
| [
"noreply@github.com"
] | ModiEsawi.noreply@github.com |
caf35c61c3b1a49594188a9b431115ea9025861d | e30d3a7e5ddc968f50cb0694c877f51e0fe6ca59 | /src/test/java/com/xwintop/xJavaFxTool/javafx/tool/TableBeanTool.java | fdfb38f2c44e586f4e7e8f9d306e1af703408245 | [
"Apache-2.0",
"LicenseRef-scancode-mulanpsl-2.0-en",
"MulanPSL-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | foukation/xJavaFxTool | 0a098e8b9001989080068682c3451f655245f6cb | d9f30ddef75e29c7dfa7204577789d4167090bb9 | refs/heads/master | 2021-05-25T14:43:21.070194 | 2020-03-21T08:00:12 | 2020-03-21T08:00:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,056 | java | package com.xwintop.xJavaFxTool.javafx.tool;
import com.xwintop.xcore.util.StrUtil;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.junit.Test;
import java.lang.reflect.Field;
public class TableBeanTool {
@Test
public void buildTableBean(){
// Class<?> beanClass = EmailToolTableBean.class;
Class<?> beanClass = this.getClass();
Field[] fields = FieldUtils.getAllFields(beanClass);
StringBuffer soutStringBuffer = new StringBuffer();//输出字符串
StringBuffer stringBuffer = new StringBuffer();//构造函数头
StringBuffer stringBuffer2 = new StringBuffer();//构造函数结构
StringBuffer stringBuffer3 = new StringBuffer();//构造函数2头
StringBuffer stringBuffer4 = new StringBuffer();//获取构造函数
StringBuffer stringBuffer5 = new StringBuffer();//获取getSet方法
stringBuffer.append("public ").append(beanClass.getSimpleName()).append("(");
stringBuffer3.append("public ").append(beanClass.getSimpleName()).append("(String propertys) {\nString[] strings = propertys.split(\"__\","+fields.length+");\n");
stringBuffer4.append("public String getPropertys() {\nreturn ");
int i = 0;
for (Field field : fields) {
String fieldName = field.getName();
String typeName = field.getType().getSimpleName();
String typeSimpleName = typeName.substring(6, typeName.indexOf("Property"));
String typeClassName = typeName.substring(6);
String UpFieldName = StrUtil.fristToUpCase(fieldName);
stringBuffer.append(typeSimpleName).append(" "+fieldName+",");
stringBuffer2.append("this."+fieldName+" = new "+typeName+"("+fieldName+");\n");
if("Boolean".equals(typeSimpleName)){
stringBuffer3.append("this."+fieldName+" = new "+typeName+"(Boolean.valueOf(strings["+i+"]));\n");
}else if("Integer".equals(typeSimpleName)){
stringBuffer3.append("this."+fieldName+" = new "+typeName+"(Integer.valueOf(strings["+i+"]));\n");
}else{
stringBuffer3.append("this."+fieldName+" = new "+typeName+"(strings["+i+"]);\n");
}
stringBuffer4.append(fieldName +".get() + \"__\" + ");
if(!"String".equals(typeSimpleName)){
stringBuffer5.append("public "+typeClassName+" "+fieldName+"Property(){\n");
stringBuffer5.append("return "+fieldName+";\n}\n\n");
}
stringBuffer5.append("public "+typeSimpleName+" get"+UpFieldName+"(){\n");
stringBuffer5.append("return "+fieldName+".get();\n}\n\n");
stringBuffer5.append("public void set"+UpFieldName+"("+typeSimpleName+" "+fieldName+"){\n");
stringBuffer5.append("this."+fieldName+".set("+fieldName+");\n}\n\n");
i++;
}
stringBuffer.deleteCharAt(stringBuffer.length()-1).append("){\n");
stringBuffer4.delete(stringBuffer4.length()-10, stringBuffer4.length()).append(";\n");
soutStringBuffer.append(stringBuffer.toString()+stringBuffer2+"}\n\n");
soutStringBuffer.append(stringBuffer3.toString()+"}\n\n");
soutStringBuffer.append(stringBuffer4.toString()+"}\n\n");
soutStringBuffer.append(stringBuffer5.toString()+"\n\n");
System.out.println(soutStringBuffer);
}
}
| [
"1277032935@qq.com"
] | 1277032935@qq.com |
22f9a5524abefcab2b08ab38b9fba47a0696ced6 | 34b2a82e9cedbfcac781790306f27e8dd5634e78 | /144-Binary-Tree-Preorder-Traversal/solution.java | 3c662927d39373d010eb3e2e58666850eff30d98 | [
"MIT"
] | permissive | youhusky/Leetcode | 9d79cbf2ce0d4a52d2fab03c83ad7cfb5da2424a | f24ad46a839b7a6b6ae8ed1370f1da513e80baf1 | refs/heads/master | 2020-04-16T18:06:52.041675 | 2016-10-03T19:57:31 | 2016-10-03T19:57:31 | 51,571,810 | 6 | 1 | null | null | null | null | UTF-8 | Java | false | false | 589 | java | /**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
public class Solution {
public List<Integer> preorderTraversal(TreeNode root) {
ArrayList<Integer> res = new ArrayList<Integer>();
helper(root, res);
return res;
}
private void helper(TreeNode root, ArrayList<Integer> res){
if (root == null)
return;
res.add(root.val);
helper(root.left, res);
helper(root.right, res);
}
} | [
"youhusky@126.com"
] | youhusky@126.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.