Вы находитесь на странице: 1из 30

/*

* To change this template, choose Tools | Templates

* and open the template in the editor.

*/

package com.philit.apps;

import com.philit.apps.dao.TblLoginDao;

import com.philit.apps.dao.TblRegistrationDao;

import com.philit.apps.dao.impl.TblLoginDaoImpl;

import com.philit.apps.dao.impl.TblRegistrationDaoImpl;

import com.philit.apps.entity.TblLogin;

import com.philit.apps.entity.TblRegistration;

import com.philit.apps.util.Constant;

import com.vaadin.addon.tableexport.ExcelExport;

import com.vaadin.annotations.Theme;

import com.vaadin.annotations.VaadinServletConfiguration;

import com.vaadin.server.VaadinRequest;

import com.vaadin.server.VaadinServlet;

import com.vaadin.ui.Alignment;

import com.vaadin.ui.Button;

import com.vaadin.ui.Button.ClickListener;

import com.vaadin.ui.Button.ClickEvent;

import com.vaadin.ui.CheckBox;

import com.vaadin.ui.ComboBox;

import com.vaadin.ui.DateField;
import com.vaadin.ui.Form;

import com.vaadin.ui.HorizontalLayout;

import com.vaadin.ui.Label;

import com.vaadin.ui.Notification;

import com.vaadin.ui.Panel;

import com.vaadin.ui.TabSheet;

import com.vaadin.ui.TabSheet.Tab;

import com.vaadin.ui.Table;

import com.vaadin.ui.TextArea;

import com.vaadin.ui.TextField;

import com.vaadin.ui.UI;

import com.vaadin.ui.VerticalLayout;

import com.vaadin.ui.themes.BaseTheme;

import com.vaadin.ui.themes.ChameleonTheme;

import java.io.Serializable;

import java.util.Collections;

import java.util.Comparator;

import java.util.Date;

import java.util.List;

import javax.servlet.annotation.WebServlet;

//@Theme("mytheme")

@Theme("runo")

//@Theme("liferay")

//@Theme("valo")
@SuppressWarnings("serial")

public class TrainingSystemV72017 extends UI implements ClickListener, Serializable {

/**

* @return the tblRegistration

*/

public TblRegistration getTblRegistration() {

return tblRegistration;

/**

* @param tblRegistration the tblRegistration to set

*/

public void setTblRegistration(TblRegistration tblRegistration) {

this.tblRegistration = tblRegistration;

/**

* @return the lstTblRegistration

*/

public List<TblRegistration> getLstTblRegistration() {

return lstTblRegistration;

/**
* @param lstTblRegistration the lstTblRegistration to set

*/

public void setLstTblRegistration(List<TblRegistration> lstTblRegistration) {

this.lstTblRegistration = lstTblRegistration;

/**

* @return the tblRegistration

*/

// public TblRegistration getTblRegistration() {

// return tblRegistration;

// }

//

// /**

// * @param tblRegistration the tblRegistration to set

// */

// public void setTblRegistration(TblRegistration tblRegistration) {

// this.tblRegistration = tblRegistration;

// }

//STUDENT INFORMATION

private TextField tfSchoolYear = new TextField("School Year");

private TextField tfStudentNo = new TextField("Student No");

private TextField tfCourse = new TextField("Course");

private TextField tfBatchNo = new TextField("Batch No");


private TextField tfLastName = new TextField("Last Name:");

private TextField tfFirstName = new TextField("First Name:");

private TextField tfMiddleName = new TextField("Middle Name:");

private TextField tfExtensionName = new TextField("Extension Name:");

private TextField tfReligion = new TextField("Religion:");

private TextField tfAge = new TextField("Age:");

private ComboBox cbGender = new ComboBox("Gender");

private ComboBox cbCivilStatus = new ComboBox("Civil Status");

private TextField tfSpouse = new TextField("If married name, of spouse:");

private TextField tfAdress = new TextField("(Permanent Adress) House Number , Street:");

private TextField tfBarangay = new TextField("Barangay:");

private TextField tfDistrict = new TextField("District:");

private TextField tfCityMunicipality = new TextField("City/Municipality:");

private TextField tfProvince = new TextField("Province:");

private TextField tfRegion = new TextField("Region:");

private DateField tfBirthday = new DateField("Birthday:");

private TextField tfBirthplace = new TextField("Birthplace(City/Municipality/Province):");

private TextField tfRegion1 = new TextField("Region:");

private TextField tfNationality = new TextField("Nationality:");

private TextField tfMobileNum = new TextField("Mobile Number:");


private TextField tfHomeNum = new TextField("Home Number:");

private TextField tfEmailAdd = new TextField("Email Address:");

//2nd Panel

private TextField tfHSeduc = new TextField("High School Education:");

private TextField tfTertiaryeduc = new TextField("Tertiary Education:");

private TextField tfHSNameSchool = new TextField("Name Of School:");

private TextField tfTSNameSchool = new TextField("Name Of School:");

private TextField tfHSAdress = new TextField("Adress:");

private TextField tfTSAdress = new TextField("Adress:");

// 3rd Panel

private TextField tfFather = new TextField("Father:");

private TextField tfMother = new TextField("Mother:");

// 4rt Panel

private TextField tfEmergencyName = new TextField("Name:");

private TextField tfRelation = new TextField("Relationship:");

private Button btnSave = new Button("Save");

private Button btnNew = new Button("New Ticket");

private Button btnSearch = new Button("Search");

private Button btnDisplayAll = new Button("Display All");

private Button btnClear = new Button("Clear");


private TextField tfTicketId = new TextField("Ticket ID");

private TextField tfAddress = new TextField("Address:");

private TextField tfEmail = new TextField("Email:");

private TextField tfContactNo = new TextField("Contact No:");

private DateField dfBirthDate = new DateField("Date of Birth");

private Table tblSearch = new Table();

private TextField tfCaller = new TextField("Caller:");

private ComboBox cbCategory = new ComboBox("Category");

private ComboBox cbUser = new ComboBox("User");

private ComboBox cbAssetID = new ComboBox("Asset ID");

private ComboBox cbSeverity = new ComboBox("Severity");

private ComboBox cbAssignedTo = new ComboBox("Assigned To:");

private CheckBox cbxNew = new CheckBox("New");

private CheckBox cbxAssigned = new CheckBox("Assigned");

private CheckBox cbxClosed = new CheckBox("Closed");

private CheckBox cbxResolved = new CheckBox("Resolved");

private TextField tfPriorityNo = new TextField("Priority No:");

private TextField tfSearch = new TextField();

private TextArea taTicketNotes = new TextArea("Ticket Notes/Details");

private TextArea taTicketResolution = new TextArea("Ticket Resolution");

private Button btnExportExcel1 = new Button("Export to Excel");


//Tables

//private Table tblTickets = new Table();

//Database entities

//private TblLogin tblLogin = new TblLogin();

//List See All Entities (Viewing Purposes)

private List<TblRegistration> lstTblRegistration;

//Update/delete/Add (Action)

private TblRegistration tblRegistration = new TblRegistration();

//private TblLoginDao tblLoginDao = new TblLoginDaoImpl();

//Query... Implementation

private TblRegistrationDao tblRegistrationDao = new TblRegistrationDaoImpl();

//List Components

//Entity

//Notification

private Notification notify;

/**

* @return the notify

*/
public Notification getNotify() {

return notify;

/**

* @return the tblLogin

*/

// public TblLogin getTblLogin() {

// return tblLogin;

// }

/**

* @param tblLogin the tblLogin to set

*/

// public void setTblLogin(TblLogin tblLogin) {

// this.tblLogin = tblLogin;

// }

/**

* @return the lstTblRegistration

*/

// public List<TblRegistration> getLstTblRegistration() {

// return lstTblRegistration;

// }

/**

* @param lstTblRegistration the lstTblRegistration to set

*/
// public void setLstTblRegistration(List<TblRegistration> lstTblRegistration) {

// this.lstTblRegistration = lstTblRegistration;

// }

@WebServlet(value = "/*", asyncSupported = true)

@VaadinServletConfiguration(productionMode = false, ui = TrainingSystemV72017.class, widgetset =


"com.philit.trainingsystemv1.AppWidgetSet")

public static class Servlet extends VaadinServlet {

//UI

@Override

protected void init(VaadinRequest request) {

// setSizeFull();

final VerticalLayout layout = new VerticalLayout();

// layout.setSizeFull();

layout.setMargin(true);

layout.setSpacing(true);

setContent(layout);

String buttonWidth = "150px";

btnSave.setWidth(buttonWidth);

btnSave.addClickListener((Button.ClickListener) this);

btnSearch.setWidth(buttonWidth);

btnSearch.addClickListener((Button.ClickListener) this);
btnDisplayAll.setWidth(buttonWidth);

btnDisplayAll.addClickListener((Button.ClickListener) this);

btnExportExcel1.addListener((Button.ClickListener) this);

btnExportExcel1.setWidth("150px");

Panel pnlTraining = new Panel("STUDENT REGISTRATION");

pnlTraining.setWidth("90%");

pnlTraining.setSizeFull();

String tfWidth = "400px";

//2nd Horizontal

tfFirstName.setWidth(tfWidth);

tfMiddleName.setWidth(tfWidth);

tfLastName.setWidth("180");

tfEmail.setWidth(tfWidth);

HorizontalLayout hlStudentName = new HorizontalLayout();

hlStudentName.setSpacing(true);

hlStudentName.addComponent(tfFirstName);

hlStudentName.addComponent(tfMiddleName);

hlStudentName.addComponent(tfLastName);

hlStudentName.addComponent(tfExtensionName);

//1st Horizontal
tfSchoolYear.setWidth("300px");

tfStudentNo.setWidth(tfWidth);

tfCourse.setWidth(tfWidth);

tfBatchNo.setWidth("100");

HorizontalLayout hlSchoolControlNo = new HorizontalLayout();

hlSchoolControlNo.setSpacing(true);

hlSchoolControlNo.addComponent(tfSchoolYear);

hlSchoolControlNo.addComponent(tfStudentNo);

hlSchoolControlNo.addComponent(tfCourse);

hlSchoolControlNo.addComponent(tfBatchNo);

// 3rd Horizontal

tfReligion.setWidth("150px");

tfAge.setWidth("150");

cbGender.setWidth("50");

cbCivilStatus.setWidth("100");

tfSpouse.setWidth(tfWidth);

HorizontalLayout hlOtherInfo = new HorizontalLayout();

hlOtherInfo.setSpacing(true);

hlOtherInfo.addComponent(tfReligion);
hlOtherInfo.addComponent(tfAge);

hlOtherInfo.addComponent(cbGender);

hlOtherInfo.addComponent(cbCivilStatus);

hlOtherInfo.addComponent(tfSpouse);

// 4rt Horizontal

tfAdress.setWidth("300px");

tfBarangay.setWidth(tfWidth);

tfDistrict.setWidth(tfWidth);

HorizontalLayout hlAdresses = new HorizontalLayout();

hlAdresses.setSpacing(true);

hlAdresses.addComponent(tfAdress);

hlAdresses.addComponent(tfBarangay);

hlAdresses.addComponent(tfDistrict);

// 5th Horizontal

tfCityMunicipality.setWidth("300px");

tfProvince.setWidth(tfWidth);

tfRegion.setWidth(tfWidth);

HorizontalLayout hlAdresses2 = new HorizontalLayout();

hlAdresses2.setSpacing(true);

hlAdresses2.addComponent(tfCityMunicipality);

hlAdresses2.addComponent(tfProvince);
hlAdresses2.addComponent(tfRegion);

// 6th Horizontal

tfBirthday.setWidth("300px");

tfBirthplace.setWidth(tfWidth);

tfRegion1.setWidth(tfWidth);

tfNationality.setWidth("200");

HorizontalLayout hlBirth = new HorizontalLayout();

hlBirth.setSpacing(true);

hlBirth.addComponent(tfBirthday);

hlBirth.addComponent(tfBirthplace);

hlBirth.addComponent(tfRegion1);

hlBirth.addComponent(tfNationality);

// 7th Horizontal

tfMobileNum.setWidth("300px");

tfHomeNum.setWidth(tfWidth);

tfEmailAdd.setWidth(tfWidth);

// tfEmailAdd.setImmediate(true);

// tfEmailAdd.addListener(new TextField.ValueChangeListener(){

// @Override

// public void valueChange(Property.ValueChangEvent event) {

// if (tfEmailAdd.getvalue() != null
// && tfEmailAdd.getValue().toString().length() > 0

// && tfEmailAdd.getValue().toString().contains("@")

// && tfEmailAdd.getValue().toString().contains(".")) {

// //do nothing

// } else {

// getNotify().show("Invalid email address !");

// tfEmailAdd.focus();

// }

// }

// });

HorizontalLayout hlContactNum = new HorizontalLayout();

hlContactNum.setSpacing(true);

hlContactNum.addComponent(tfMobileNum);

hlContactNum.addComponent(tfHomeNum);

hlContactNum.addComponent(tfEmailAdd);

tfAddress.setWidth(tfWidth);

tfContactNo.setWidth(tfWidth);

cbGender.setWidth(tfWidth);

cbGender.addItem("Male");

cbGender.addItem("Female");

cbGender.addItem("Undefined");
cbCivilStatus.addItem("Single");

cbCivilStatus.addItem("Married");

cbCivilStatus.addItem("Separated");

dfBirthDate.setWidth(tfWidth);

VerticalLayout vlTraining = new VerticalLayout();

vlTraining.setMargin(true);

vlTraining.setSizeUndefined();

vlTraining.addComponent(hlSchoolControlNo);

vlTraining.addComponent(hlStudentName);

vlTraining.addComponent(hlOtherInfo);

vlTraining.addComponent(hlAdresses);

vlTraining.addComponent(hlAdresses2);

vlTraining.addComponent(hlBirth);

vlTraining.addComponent(hlContactNum);

vlTraining.addComponent(btnSave);

pnlTraining.setContent(vlTraining);

Panel pnlAcademic = new Panel("ACADEMIC INFORMATION");

pnlAcademic.setWidth("90%");

pnlAcademic.setSizeFull();

String tfWidth2 = "400px";


// String tfWidth2 = "400px";

Label lblHSeduc = new Label("High School Education");

// lblHSeduc.setContentMode.Label;

// lblHSeduc.setWidth(tfWidth2);

//1st Horizontal 2nd Panel

tfHSeduc.setWidth("600px");

tfTertiaryeduc.setWidth("600px");

HorizontalLayout hlStudentName11 = new HorizontalLayout();

hlStudentName11.setSpacing(true);

hlStudentName11.addComponent(tfHSeduc);

hlStudentName11.addComponent(tfTertiaryeduc);

//2nd Horizontal 2nd Panel

tfHSNameSchool.setWidth(tfWidth);

tfTSNameSchool.setWidth(tfWidth);

HorizontalLayout hlNameofSchool = new HorizontalLayout();

hlNameofSchool.setSpacing(true);
hlNameofSchool.addComponent(tfHSNameSchool);

hlNameofSchool.addComponent(tfTSNameSchool);

//Vertical Layout

VerticalLayout vlAcademic = new VerticalLayout();

vlAcademic.setMargin(true);

vlAcademic.setSizeUndefined();

vlAcademic.addComponent(hlStudentName11);

vlAcademic.addComponent(hlNameofSchool);

pnlAcademic.setContent(vlAcademic);

pnlAcademic.setContent(vlAcademic);

Panel pnlFamilyBackground = new Panel("FAMILY BACKGROUND");

pnlFamilyBackground.setWidth("90%");

pnlFamilyBackground.setSizeFull();

String tfWidth3 = "400px";

//1st Horizontal 3rd Panel

tfFather.setWidth("600px");

tfMother.setWidth("600px");

HorizontalLayout hlParents = new HorizontalLayout();


hlParents.setSpacing(true);

hlParents.addComponent(tfFather);

hlParents.addComponent(tfMother);

// Vertical Layout

VerticalLayout vlFamilyBackground = new VerticalLayout();

vlFamilyBackground.setMargin(true);

vlFamilyBackground.setSizeUndefined();

vlFamilyBackground.addComponent(hlParents);

pnlFamilyBackground.setContent(vlFamilyBackground);

Panel pnlEmergency = new Panel("EMERGENCY CONTACT PERSON (In Case of emergency , please
notify :");

pnlEmergency.setWidth("90%");

pnlEmergency.setSizeFull();

String tfWidth4 = "400px";

//1st Horizontal 3rd Panel

tfEmergencyName.setWidth("600px");

tfRelation.setWidth("600px");

HorizontalLayout hlEmergency1 = new HorizontalLayout();


hlEmergency1.setSpacing(true);

hlEmergency1.addComponent(tfEmergencyName);

hlEmergency1.addComponent(tfRelation);

// Vertical Layout

VerticalLayout vlEmergency = new VerticalLayout();

vlEmergency.setMargin(true);

vlEmergency.setSizeUndefined();

vlEmergency.addComponent(hlEmergency1);

pnlEmergency.setContent(vlEmergency);

// VerticalLayout vlSearch = new VerticalLayout();

// vlSearch.setWidth("100%");

// pnlTraining.setContent(vlSearch);

// pnlTraining.setWidth("90%");

final TabSheet tabSheetSalesDataEntry = new TabSheet();

tabSheetSalesDataEntry.setWidth("90%");

tabSheetSalesDataEntry.setSizeFull();

String tfWidth5 = "400px";


tabSheetSalesDataEntry.setImmediate(true);

final Tab tabInfo1 = tabSheetSalesDataEntry.addTab(pnlTraining, "STUDENT REGISTRATION");

final Tab tabInfo2 = tabSheetSalesDataEntry.addTab(pnlAcademic, "ACADEMIC INFORMATION");

final Tab tabInfo3 = tabSheetSalesDataEntry.addTab(pnlFamilyBackground, "FAMILY BACKGROUND");

final Tab tabInfo4 = tabSheetSalesDataEntry.addTab(pnlEmergency, "EMERGENCY CONTACT PERSON");

tabSheetSalesDataEntry.setSizeFull();

//layout.addComponent(pnlTraining);

// layout.setComponentAlignment(pnlTraining, Alignment.MIDDLE_CENTER);

// layout.addComponent(pnlAcademic);

// layout.setComponentAlignment(pnlAcademic, Alignment.MIDDLE_CENTER);

// layout.addComponent(pnlFamilyBackground);

// layout.setComponentAlignment(pnlFamilyBackground, Alignment.MIDDLE_CENTER);

// layout.addComponent(pnlEmergency);

// layout.setComponentAlignment(pnlEmergency, Alignment.MIDDLE_CENTER);

layout.addComponent(tabSheetSalesDataEntry);

layout.setComponentAlignment(tabSheetSalesDataEntry, Alignment.MIDDLE_CENTER);

//Logic

////

@Override
public void buttonClick(Button.ClickEvent event) {

final Button source = event.getButton();

if (source == btnSave) {

getNotify().show("Button Save was clicked!!");

//tfTicketId.setValue("Ticket Number");

TblRegistration tblRegistrationNew = new TblRegistration();

tblRegistrationNew.setRegistrationSchoolYear(tfSchoolYear.getValue()!=null?
tfSchoolYear.getValue().toString():"");

tblRegistrationNew.setRegistrationStudentNo(tfStudentNo.getValue()!=null?
tfStudentNo.getValue().toString():"");

tblRegistrationNew.setRegistrationCourse(tfCourse.getValue()!=null?
tfCourse.getValue().toString():"");

tblRegistrationNew.setRegistrationFirstName(tfFirstName.getValue()!=null?
tfFirstName.getValue().toString():"");

tblRegistrationNew.setRegistrationMiddleName(tfMiddleName.getValue()!=null?
tfMiddleName.getValue().toString():"");

tblRegistrationNew.setRegistrationLastName(tfLastName.getValue() !=null?
tfLastName.getValue().toString():"");

tblRegistrationNew.setRegistrationContactNo(tfContactNo.getValue() !=null?
tfContactNo.getValue().toString():"");

tblRegistrationNew.setRegistrationGender(cbGender.getValue().toString());

tblRegistrationNew.setRegistrationEmail(tfEmail.getValue().toString());

tblRegistrationNew.setRegistrationBirthDate(dfBirthDate.getValue());

tblRegistrationNew.setRegistrationAddress(tfAddress.getValue().toString());

tblRegistrationDao.save(tblRegistrationNew);

refreshTrainingList();
//This will Save Information to Database

//==================================================================

tblRegistrationDao.save(tblRegistrationNew);

//

clearForm();

refreshTrainingList();

} else if (source == btnNew) {

getNotify().show(event.getButton().getCaption());

} else if (source == btnExportExcel1) {

ExcelExport excelExport;

excelExport = new ExcelExport(tblSearch,"Table Search");

excelExport.setExportFileName("search_" + System.currentTimeMillis() + ".xls");

excelExport.excludeCollapsedColumns();

excelExport.setReportTitle("Table Search");

excelExport.export();

} else if (source == btnSearch) {

refreshTrainingList();

} else if (source == btnDisplayAll) {


tfSearch.setValue("");

refreshTrainingList();

} else if (source == btnClear) {

getNotify().show(event.getButton().getCaption());

} else {

getNotify().show(event.getButton().getCaption());

public void refreshTrainingList() {

tblSearch.removeAllItems();

tblSearch.setStyleName(ChameleonTheme.TABLE_STRIPED);

tblSearch.setWidth("100%");

tblSearch.addContainerProperty("Id", Integer.class, null);//0

tblSearch.addContainerProperty("Name", String.class, null);//0

tblSearch.addContainerProperty("Address ", String.class, null);//1

tblSearch.addContainerProperty("Contact No.", String.class, null);//2

tblSearch.addContainerProperty("View", Button.class, null);

tblSearch.addContainerProperty("Status", String.class, null);

tblSearch.addContainerProperty("Delete", Button.class, null);


//Available Items

//======================================================================

if (tfSearch != null && !tfSearch.getValue().toString().equals("")) {

setLstTblRegistration(tblRegistrationDao.findByNativeQuery("select * from tbl_registration where


"

+ "(registration_first_name like '" + tfSearch.getValue().toString() + "%' or "

+ "registration_middle_name like '" + tfSearch.getValue().toString() + "%' or "

+ "registration_last_name like '" + tfSearch.getValue().toString() + "%' or "

+ "registration_address like '" + tfSearch.getValue().toString() + "%' or "

+ "registration_gender like '" + tfSearch.getValue().toString() + "%' or "

+ "registration_birth_date like '" + tfSearch.getValue().toString() + "%' or "

+ "registration_email like '" + tfSearch.getValue().toString() + "%' or "

+ "registration_contact_no like '" + tfSearch.getValue().toString() + "%')"));

} else {

// setLstTblRegistration(tblRegistrationDao.findByNativeQuery("select * from tbl_registration"));

// Collections.sort(lstTblRegistration, new Comparator<TblRegistration>() {

// public int compare(TblRegistration o1, TblRegistration o2) {

// return
o1.getRegistrationLastName().toString().compareTo(o2.getRegistrationLastName().toString());

// }

// });
for (final TblRegistration tblRegistration : getLstTblRegistration()) {

//

//

Button viewBtn = new Button("View");

viewBtn.setData(String.valueOf(tblRegistration.getRegistrationId()));

//

viewBtn.addListener(new Button.ClickListener() {

@Override

public void buttonClick(Button.ClickEvent event) {

//getWindow().showNotification(event.getButton().getData().toString() + ";;;;" +
event.getButton().getDescription().toString());

getNotify().show(event.getButton().getCaption() + " Button Clicked!!");

//// setTblRegistration(tblRegistration);

//// populateForm();

//// refreshThis();

//// PayrollPayrollPeriodPanelView payrollPayrollPeriodPanelView = new


PayrollPayrollPeriodPanelView(getRoot());

//// getRoot().setPayrollSearchPanelViewTab1(payrollPayrollPeriodPanelView);

});

Button deleteBtn = new Button("Delete");

deleteBtn.setData(String.valueOf(tblRegistration.getRegistrationId()));

deleteBtn.addListener(new Button.ClickListener() {
@Override

public void buttonClick(Button.ClickEvent event) {

getNotify().show(event.getButton().getCaption() + " Button Clicked!!");

// tblRegistrationDao.delete(tblRegistration);

// refreshTrainingList();

});

//

//// Button statusBtn = new Button("Active [" + tblPeriod.getPeriodIsActive() + "]");

//// statusBtn.setData(String.valueOf(tblPeriod.getPeriodId()));

////

//// statusBtn.addListener(new Button.ClickListener() {

//// @Override

//// public void buttonClick(Button.ClickEvent event) {

//// //getWindow().showNotification(event.getButton().getData().toString() + ";;;;" +


event.getButton().getDescription().toString());

//// tblPeriod.setPeriodModifiedTs(new Date());

//// tblPeriod.setPeriodModifiedByLoginId(mainRoot.getTblLogin().getLoginId());

//// if (tblPeriod.getPeriodIsActive().equals("Y")) {

//// tblPeriod.setPeriodIsActive("N");

//// } else {

//// tblPeriod.setPeriodIsActive("Y");

//// }

//// tblPeriodDao.save(tblPeriod);

//// refreshActivePayrollPeriodTableList();

//// }
//// });

//

//

tblSearch.addItem(new Object[]{

tblRegistration.getRegistrationId(),//1

(tblRegistration.getRegistrationFirstName()!=null?tblRegistration.getRegistrationFirstName():"") + " " +


(tblRegistration.getRegistrationLastName()!=null?tblRegistration.getRegistrationLastName():"") + " ",//1

tblRegistration.getRegistrationAddress()!=null?tblRegistration.getRegistrationAddress():"",//2

tblRegistration.getRegistrationContactNo()!=null?tblRegistration.getRegistrationContactNo():"",//3

viewBtn,//5

"Test",//5

deleteBtn}, tblRegistration.getRegistrationId());//7

private void clearForm() {

getNotify().show("=====clearForm()======");

tfSchoolYear.setValue("");

tfStudentNo.setValue("");

tfCourse.setValue("");

tfBatchNo.setValue("");

tfFirstName.setValue("");

tfMiddleName.setValue("");

tfLastName.setValue("");
tfExtensionName.setValue("");

tfEmail.setValue("");

tfReligion.setValue("");

tfAge.setValue("");

cbGender.setValue(null);

cbCivilStatus.setValue(null);

tfSpouse.setValue("");

private void populateForm() {

// getNotify().show("=====populateForm()======");

// tfFirstName.setValue(getTblRegistration().getRegistrationFirstName());

// tfLastName.setValue(getTblRegistration().getRegistrationLastName());

// tfMiddleName.setValue(getTblRegistration().getRegistrationMiddleName());

// }

// /**

// * @return the tblRegistration

// */

// public TblRegistration getTblRegistration() {

// return tblRegistration;

// }

// /**

// * @param tblRegistration the tblRegistration to set


// */

// public void setTblRegistration(TblRegistration tblRegistration) {

// this.tblRegistration = tblRegistration;

Вам также может понравиться