MCA Project Report
MCA Project Report
Every organization has their own human resources in order to perform the internal
and external human resource activities. Among the total human resource activities,
managing the human capital i.e., employees are the significant task to any HR.
The main function of HR is to recruit, manage and store the employee data which
includes their personal information including their job roles, attendance, leaves,
salaries and many more which allows them to face huge workload.
In order to support the HR's work, this project is being developed to help HR’s to
manage the task very easily.
Acknowledgment
It is a genuine pleasure to express my profound gratitude and deep regards to my
guide Mr. Pratik Ramesh Chandgaonkar for his exemplary guidance, monitoring
and constant encouragement. I would like to express my special thanks to IGNOU
who gave me the golden opportunity to do this wonderful project on the topic
Human Resource Management System, which helped me in doing a lot of
Research and I came to know about so many new things.
Table of Contents
Chapter 1: Introduction
3.2 Database design with Data Integrity and Constraints ……. 25-30
3.5 Test Cases (Unit Test & System Test Cases) …………………… 51-52
Chapter 4: Coding
4.2 Complete Project Coding with Required Comments & Description…. 86-285
Chapter 6: Testing
Chapter 8: Reports
Bibliography ………………………………………………………………………………………………… A
List of Figures
Fig 1: Iterative Enhancement Model
Fig 7: ER-Diagram
Chapter 1: Introduction
1.1 Introduction
Nowadays, companies try to enhance their management and have a better
control over their employees. In order to fulfil these requirements in a more
efficient way they need software called Human Resource Management
System (HRMS).
We develop the Human Resource Management System that will meet the
needs for managing the employee personal data, daily attendance, leave
management, payroll processing, employee self-services, system
authentication and authorization of an employee.
1.2 Objectives
The main function of an HRMS is to standardize and consolidate the core
processes related to the Human Resource Management. Below are the
Objectives which we are going to implement into this HRMS project.
validated against the user and based on the validation, home page of the
application would be display with various options like Employee
Information Management, Time and Attendance, Leave, Payroll, System
settings etc.
▪ The HR of the company will run the leave process in the beginning of
each financial year. This leave process will credit the leave balance of all
category of leaves to the employees leave account. Input for this process
would be taken from the system that is entered by the HR of the
company.
The proposed system that is identified at this stage will work as follows
• It will collect the employee information details from the employee
information management module. In first step, the HR of the
company will register the employee into the system and system
will produce one unique employee identification number.
• In above step, the generated unique employee identification
number will be used in each and every module to work with the
employee information like managing attendance, leave, payroll
and system access and authorization.
System Scope: The scope of the system is also recognized at this stage. A
system can be reduced in its scope due to financial, political or time problems.
Alternate Solutions: This phase is also used to find out alternate solutions for
developing the system. The best available solution must be used. The best way
to do this is to interview the concerned people in the organization. It may
include the clients, customer, supplier and consultants etc. The competitors can
also be an important source to find the best way to develop new system.
Economic Feasibility
The project has shown the economic feasibility by the study of the fact
that by using this software the increased number of the employees in a
company who is going to be a user of this application, can be given
service effectively and efficiently. Hence it will save a lot of time and
saving time means saving money. The cost and benefit analysis has
shown that cost that have incurred in developing the project is less than
the benefits that the project is going to provide once it is developed, so
this project has passed the feasibility test.
Technical Feasibility
Technical feasibility centers on the existing computer system (Hardware,
Software etc.) and to what extent it supports the existing system. As the
existing system computer system is viable so there is no matter of
technical feasibility that is the system is technically feasible. In this type
of feasibility study, it is checked whether there is a need of new
hardware/software or not. What are the basic requirements of the project?
If there is need then how it can be fulfilled. In this context, this project
doesn’t need any special hardware or software.
Behavioral Feasibility
The User also interested in this project, as it will help them to do work
with ease and efficiently without complexity, so they supported the
development of this project with full enthusiasm. This shows the
behavioral feasibility of the project.
Time Feasibility
It is the determination of whether a proposed project can be implemented
fully within stipulated time frame. The project was decided to be done in
three months and was thought to be feasible.
Operational Feasibility
In this feasibility study it is determined whether there is need of well
qualified operator or simple user. Is there need to train the operator or
not? This project is supporting the Graphical User Interface; hence
involved is also less. So, one need not perform detailed risk analysis. If
redevelopment Admin is less than development can be started with a smaller
number of people and in next increments others can be involved. As this model
combines the advantage of waterfall model and prototyping, clients are always
aware of the product being delivered and can always suggest changes and
enhancements and can get them implemented. As less amount of customer
communication is required one need not apply spiral model in which all types of
analysis are done in detail. As the deadline is affordable one need not to for
Rapid Application Development model. Iterative enhancement model is useful
when less manpower is available for software development and the release
deadlines are specified. It is best suited for in house product development,
where it is ensured that the user has something to start with. The complete
product is divided into releases and the developer delivers the product release
by release.
element in a schedule, which is not further subdivided. Those items are often
estimated in terms of resource requirements, budget and duration, linked by
dependencies and scheduled.
PERT Chart
The Program Evaluation Review Technique (PERT) is the cost and time
management system. PERT organizes that project is complex that some tasks
must be completed before other can be stated and that the appropriate way to
manage a project is to define and control each task. Because projects often fall
behind schedules, PERT is designed to facilitate getting a project back on
schedule. The PERT chart gives a graphical representation of this information.
Depending on the working priorities, the entire project can be subdivided into
the following main modules, those are: -
• Login Module
• Employee information management
• Absence and leave management
• Time and attendance management
• Payroll management
• Employee self-services
We can construct our activity plan as follows: -
Chart: -
Gantt Chart
A Gantt chart is a popular type of bar chart that illustrates a project schedule.
Gantt charts illustrate the start and finish dates of the terminal elements and
summary elements of a project. Terminal elements and summary elements
comprise the work breakdown structure of the project.
Product perspective
The software product is a Web application. The application will be made
up of two parts, one administrator who has all the rights and the other
user who has limited rights to work with the application. The two users of
the system, namely the HR Manager or Employee Manager or System
Admin and Employees interact with the system in different ways.
Product Functions
When URL of the application is invoked then first it will display the login
page then if user is not registered then user can register itself into the
system. By default, user will have access with attendance and leave
module for submit and view the attendance and leave. Another access
privileges are given by admin on request.
Once user is registered into the system then they can access the full
system based on the outcome of system authentication and authorization.
Admin user will have all the access, they can create, modify and view any
kind of information in system.
Specific Requirements
• Software Requirement Specification
Operating System Microsoft Windows 10 (64 bit)
Memory
4 GB 8 GB or more
(RAM)
30 GB or more, depending on
Disk space 10 GB
usage
Software paradigm refers to method and steps, which are taken while designing
the software programming paradigm is a subset of software design paradigm
which is future for other a subset of software development paradigm. Software
is considered to be a collection of executable programming code, associated
libraries, and documentation. Software development paradigm is also known as
software engineering, all the engineering concepts pertaining to developments
software applied. It consists of the following parts as Requirement Gathering,
Software design, Programming, etc. The software design paradigm is a part of
software development. It includes design, maintenance, programming.
The 0 Level DFD shows flow of data of application. DFD Level 0 is also called
a Context Diagram. It’s a basic overview of the whole system or process being
analyzed or modeled.
DFD Level 1 provides a more detailed breakout of pieces of the Context Level
Diagram. This DFD describes main functions carried out by the system, as we
break down the high-level process of the Context Diagram into its sub-
processes.
The DFD 2 Level describes flow of data in more detail. DFD Level 2 goes one
step deeper into parts of Level 1. It may require more text to reach the necessary
level of detail about the system’s functioning.
Fig 7: ER-Diagram
• Login Module
• Employee Information Management
• Time and Attendance Management
• Leave Management
• Payroll Management
logged-in to the system and then they will see the pending Time-in and
Time out data and then they will approve this attendance data.
4. Leave Management: In this module, the HR of the company will assign
the different types of leaves to their employees leave account at the
beginning of each financial year. As per the government rule and
company policy, the HR of the company will assign the following types
of leaves to the employee leave account.
As per the company policy, The HR of the company will initialize the
above leaves to their employees leave account. The HR will also mark
which leave would be carry forward for the next financial year leave
account of the employee and they will also decide the maximum limit for
the leave type which would be carry forwarded.
Now after initializing the leave balances to each and every employee’s
account in the beginning of financial year, the employees can use this
module to apply the leave into the system and then this applied leave
would be forwarded to the manager of the employee for the approval.
Once the leave approved then system will mark this leave into the
employee daily attendance for their payroll process.
hiring. The CTC would be break into different Earning & Deduction head
as per the company policy. The CTC of the employee would be re-
structured time to time when required by the company like when
appraisal is done or any policy changes in the salary structure. Once the
CTC structure defined into the system for the employee then that CTC
structure would be used for the monthly payroll process.
The salary for the current month would be calculated automatically based
on the formula and salary structure defined into the system. If HR wants
to deduct some other amount from the employee salary or they want to
give some additional amount into the salary then they can make this
additional entry before the payroll process in each month. Example if
employees have taken any loan from the company, then this loan amount
can be deducted from the employee monthly salary until the total loan
amount is deducted by the company. In the same way if company wants
to give bonus in the employee salary, then HR can make this additional
entry in the employee salary for that month.
Below is the list of tables based on ER-Diagram which shows the data integrity
and constraints to be applied on each and every tables as required.
• Login
• Leave Management
• Payroll Management
3.5 Test Cases (Unit Test Cases and System Test Cases)
Ideally, each test case is independent from the others: substitutes like method
stubs, mock objects, fakes and test harnesses can be used to assist testing a
module in isolation. Unit tests are typically written and run by software
developers to ensure that code meets its requirements and behaves as intended.
Its implementation can vary from being very manual (pencil and paper) to being
formalized as part of build automation.
System testing takes as its input modules that have been unit tested, groups
them in larger aggregates, applies tests defined in a System test plan to those
aggregates, and delivers as its output the integrated system ready for system
testing.
Chapter 4: Coding
Procedures
• ANUAL_LEAVE_ACCOUNT_PROCESS.sql
• APPROVE_REJECT_LEAVE_APP.sql
• SUBMIT_LEAVE.sql
• SUBMIT_TIME_IN_OUT.sql
Functions
• GET_ATTENDANCE_SUBMISSION_STATUS.sql
• GET_EMP_DEPT_NAME.sql
• GET_EMP_DESIGNATION.sql
• GET_EMP_GROSS_EARNING.sql
• GET_EMP_NAME.sql
• GET_NEW_ED_CODE.sql
• GET_NEW_EMP_ID.sql
• GET_TIME.sql
• VALIDATE_USER_LOGIN.sql
Triggers
• CTC_PAY_CHANGE_TRG.sql
• CTC_STR_BEFORE_DML_TRG.sql
• DEPT_BEFORE_DML_TRG.sql
• DESIG_BEFORE_DML_TRG.sql
• LOCATION_BEFORE_DML_TRG.sql
Packages
package hrms.view.util;
import hrms.model.common.AppModuleAM;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.math.BigDecimal;
import oracle.jbo.ApplicationModule;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.Properties;
import java.util.ResourceBundle;
import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
import javax.faces.application.FacesMessage;
import javax.faces.application.ViewHandler;
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
import javax.servlet.ServletContext;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.adf.view.rich.component.rich.RichQuery;
import oracle.adf.view.rich.component.rich.data.RichTable;
import oracle.adf.view.rich.context.AdfFacesContext;
import oracle.adf.view.rich.model.FilterableQueryDescriptor;
import oracle.adf.view.rich.model.QueryDescriptor;
import oracle.adf.view.rich.model.QueryModel;
import oracle.binding.BindingContainer;
import oracle.binding.OperationBinding;
import oracle.jbo.Key;
import oracle.jbo.Row;
import oracle.jbo.ViewObject;
import oracle.jbo.server.DBTransaction;
import oracle.jbo.server.DBTransactionImpl;
import oracle.jbo.server.EntityImpl;
import oracle.jbo.server.SequenceImpl;
import oracle.jbo.server.ViewRowImpl;
import org.apache.myfaces.trinidad.context.RequestContext;
import org.apache.myfaces.trinidad.event.SelectionEvent;
import org.apache.myfaces.trinidad.model.UploadedFile;
import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
import org.apache.myfaces.trinidad.util.Service;
return result;
}
}
}
return resource;
}
}
/************************************************** End Private
Methods Section
**************************************************/
/** function take operation name (from page definition) and execute this
operation (e.g Commit, Rollback, Next, CreateInsert, Delete, .....) */
public static void executeOperation(String operationName)
{
OperationBinding operationBinding =
getBindings().getOperationBinding(operationName);
operationBinding.execute();
}
/**
* Function return the operation binding
* @param operationName
*/
public static OperationBinding getOperationBinding(String operationName){
OperationBinding operationBinding =
getBindings().getOperationBinding(operationName);
return operationBinding;
}
/** function used to rollback any changes to the last commit point*/
public static void rollback()
{
executeOperation("Rollback");
}
/** function used to rollback any changes to the last commit point without
changing current row of the passed iterator*/
public static void rollbackAndBeInTheCurrentRow(String iteratorName)
{
try
{
DCIteratorBinding locationsIter = getIterator(iteratorName);
Row lRow = locationsIter.getCurrentRow();
Key key = null;
if (lRow != null)
{
key = lRow.getKey();
}
rollback();
if (key != null)
{
locationsIter.setCurrentRowWithKey(key.toStringFormat(true));
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
/** function take the component id and will return the component object */
public static UIComponent findComponentInRoot(String componentId)
{
UIComponent component = null;
FacesContext context = FacesContext.getCurrentInstance();
if (context != null)
{
UIComponent root = context.getViewRoot();
component = findComponent(root, componentId);
}
return component;
}
///** function take popup id and component id and will show this popup behind
with this component */
// public static void showPopup(String popupName, String alignId)
// {
// StringBuilder strb = new StringBuilder("var pop =
AdfPage.PAGE.findComponentByAbsoluteId(" + popupName + ");");
// strb.append("var hints = {};\n");
// strb.append("hints[AdfRichPopup.HINT_ALIGN_ID] = '" + alignId + "';");
// strb.append("pop.show(hints);");
// writeJavaScriptToClient(strb.toString());
// }
/** function take iterator name and attribute name and value then set this value
to the attribute in the current row of the iterator */
public static void setAttributeInIterator(String iteratorName, String
attributeName, Object value)
{
if (getIterator(iteratorName).getCurrentRow() != null)
{
getIterator(iteratorName).getCurrentRow().setAttribute(attributeName,
value);
}
}
/** function take iterator name and attribute name then return the value of the
attribute from the current row of the iterator */
public static Object getAttributeFromIterator(String iteratorName, String
attributeName)
{
if (getIterator(iteratorName).getCurrentRow() != null)
{
return
getIterator(iteratorName).getCurrentRow().getAttribute(attributeName);
}
return null;
}
/** function take session variable name and object then save this object inside
the variable name in the session scope */
public static void putInSession(String key, Object object)
{
try
{
FacesContext ctx = getFacesContext();
HttpSession session = (HttpSession)
ctx.getExternalContext().getSession(true);
session.setAttribute(key, object);
}
catch (Exception e)
{
System.err.println("storeOnSession -- " + e);
}
}
/** function take session variable name and return the value inside this variable
name from the session scope */
public static Object getFromSession(String key)
{
try
{
FacesContext ctx = getFacesContext();
Map sessionState = ctx.getExternalContext().getSessionMap();
return sessionState.get(key);
}
catch (Exception e)
{
e.printStackTrace();
}
return null;
}
/** function take request variable name and object then save this object inside
the variable name in the request scope */
public static void putInRequest(String name, Object value)
{
getFacesContext().getExternalContext().getRequestMap().put(name, value);
}
/**
* Put value in page flow scope
*/
public static void putInPageFlowScope(String name, Object value){
AdfFacesContext.getCurrentInstance().getPageFlowScope().put(name,
value);
}
/**
* Get value from page flow scope
*/
public static Object getFromPageFlowScope(String name){
return
AdfFacesContext.getCurrentInstance().getPageFlowScope().get(name);
/** function take request variable name and return the value inside this variable
name from the request scope */
public static Object getFromRequest(String name)
{
return getFacesContext().getExternalContext().getRequestMap().get(name);
}
/** function take the resource bundle base Name and the key and return the
value from resource bundle */
public static String getStringFromBundle(String baseName, String key)
{
ResourceBundle bundle = getBundle(baseName);
return getStringSafely(bundle, key, null);
}
/** function For Cancelling any Changes Happened In The Row (Create New
Row or Update Row) */
public static void cancelChangesInCurrentRow(String iteratorName)
{
DCIteratorBinding iterBinding = getIterator(iteratorName);
ViewObject vo = iterBinding.getViewObject();
Row currentRow = vo.getCurrentRow();
currentRow.refresh(Row.REFRESH_REMOVE_NEW_ROWS |
Row.REFRESH_WITH_DB_FORGET_CHANGES);
}
/** function take a message and display it as error message (error icon will
appear) */
public static void showErrorMessage(String message)
{
FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_ERROR,
null, null);
fm.setDetail(message);
FacesContext.getCurrentInstance().addMessage(null, fm);
}
/** function take a message and display it as warning message (warn icon will
appear) */
public static void showWarnMessage(String message)
{
FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_WARN,
null, null);
fm.setDetail(message);
FacesContext.getCurrentInstance().addMessage(null, fm);
}
/** function take viewobject name and refresh this view object */
public static void refreshViewObject(String viewObjectName)
{
ViewObject vo =
getDefaultApplicationModule().findViewObject(viewObjectName);
vo.executeQuery();
}
/** function take iterator name and refresh the view object of that iterator
without losing the current row */
public static void refreshVOByIteratorName(String iteratorName)
{
try
{
DCIteratorBinding locationsIter = getIterator(iteratorName);
Row lRow = locationsIter.getCurrentRow();
Key key = null;
if (lRow != null)
{
key = lRow.getKey();
}
locationsIter.getViewObject().executeQuery();
if (key != null)
{
locationsIter.setCurrentRowWithKey(key.toStringFormat(true));
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
/** function take iterator name and the attribute name then sum all the attribute
values for all rows in the iterator */
public static double getSumOfAttribute(String iteratorName, String
attributeName)
{
DCIteratorBinding dciter = getIterator(iteratorName);
double sum = 0;
Row[] rows = dciter.getViewObject().getAllRowsInRange();
for (Row r : rows)
{
if (r != null && r.getAttribute(attributeName) != null)
{
sum = sum +
Double.parseDouble(r.getAttribute(attributeName).toString());
}
}
return sum;
}
/** function take iterator name and the attribute name then sum all the attribute
values for all rows in the iterator and return long value*/
public static long getSumOfAttributeAsLong(String iteratorName, String
attributeName)
{
DCIteratorBinding dciter = getIterator(iteratorName);
long sum = 0;
Row[] rows = dciter.getViewObject().getAllRowsInRange();
for (Row r : rows)
{
if (r != null && r.getAttribute(attributeName) != null)
{
sum = sum + Long.parseLong(r.getAttribute(attributeName).toString());
}
}
return sum;
}
/** function return the current browser local ( e.g. "ar" - "en" - ....) */
public static String getBrowserLocal()
{
FacesContext ctx = FacesContext.getCurrentInstance();
UIViewRoot uiRoot = ctx.getViewRoot();
return uiRoot.getLocale().toString();
}
context.addMessage(valueChangeEvent.getComponent().getClientId(context),
message);
try
{
out = new FileOutputStream(fileLocation + "" + fileName);
in = file.getInputStream();
context.addMessage(valueChangeEvent.getComponent().getClientId(context),
message);
}
}
{
try
{
File file = new File(fileName);
byte[] b = new byte[(int) file.length()];
FileInputStream fileInputStream = new FileInputStream(file);
fileInputStream.read(b);
outputStream.write(b);
outputStream.flush();
}
catch (Exception e)
{
FacesMessage fm = new
FacesMessage(FacesMessage.SEVERITY_ERROR, null, null);
fm.setDetail("No file found");
FacesContext.getCurrentInstance().addMessage(null, fm);
}
}
/** function take database sequence name and return the next value for this
sequence */
public static BigDecimal getSequenceNextValue(String sequenceName)
{
SequenceImpl seq = new SequenceImpl(sequenceName,
getDefaultDBTransaction());
return new BigDecimal(seq.getSequenceNumber().toString());
}
/** function take view object name and delete all rows in this viewobject */
public static void clearViewObject(String viewObjectName)
{
ViewObject vo =
getDefaultApplicationModule().findViewObject(viewObjectName);
vo.executeQuery();
while (vo.hasNext())
{
vo.next().remove();
if (vo.getEstimatedRowCount() > 0)
{
vo.first();
}
}
if (vo.getEstimatedRowCount() > 0)
{
vo.getCurrentRow().remove();
}
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
try
{
if(cstat != null)
{
cstat.close();
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
/** function take a double number and integer number then round the double
number with the integer number (e.g roundToDecimals(15.22545112, 3) then
the output will be 15.225) */
public static double roundToDecimals(double d, int c)
{
int temp = (int) ((d * Math.pow(10, c)));
return (((double) temp) / Math.pow(10, c));
}
/** function take sql statement and return the result value e.g
(getSqlDescription("select username from users where user_id=10") function
will return username value) */
public static String getSqlDescription(String sql)
{
PreparedStatement stat = null;
ResultSet rs = null;
try
{
stat = getDefaultDBTransaction().createPreparedStatement(sql, 1);
rs = stat.executeQuery();
while (rs.next())
{
return rs.getString(1);
}
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
close(rs);
close(stat);
}
return "";
}
/** function take sql statement and return the result as double */
public static double getSqlAsDuoble(String sql)
{
PreparedStatement stat = null;
ResultSet rs = null;
try
{
stat = getDefaultDBTransaction().createPreparedStatement(sql, 1);
rs = stat.executeQuery();
while (rs.next())
{
return rs.getDouble(1);
}
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
close(rs);
close(stat);
}
return 0;
}
/** function take sql statement and return the result as long */
public static long getSqlAsLong(String sql)
{
PreparedStatement stat = null;
ResultSet rs = null;
try
{
stat = getDefaultDBTransaction().createPreparedStatement(sql, 1);
rs = stat.executeQuery();
while (rs.next())
{
return rs.getLong(1);
}
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
close(rs);
close(stat);
}
return 0;
}
/** function take dml sql statement and execute this statement then return
number of records affects during the execution */
public static int executeDML(String sql)
{
PreparedStatement stat = null;
try
{
stat = getDefaultDBTransaction().createPreparedStatement(sql, 1);
/** function take the name of the view object and return this view object */
public static ViewObject getViewObjectByName(String viewObjectName)
{
return getDefaultApplicationModule().findViewObject(viewObjectName);
}
/** function take iterator name and return the view object associated to this
iterator */
public static ViewObject getViewObjectFromIterator(String iteratorName)
{
return getIterator(iteratorName).getViewObject();
}
/** function can be called when the user override table selectionListener and
want to make the selected row is the current row (e.g
makeTableSelectedRowCurrentRow("#{bindings.UsersView1.treeModel.make
Current}", selectionEvent)) */
public static void makeTableSelectedRowCurrentRow(String exp,
SelectionEvent selectionEvent)
{
invokeMethod(exp, null, new Class[] { SelectionEvent.class }, new Object[]
{ selectionEvent });
}
/** function take iterator name and attribute name and value then set the
attribute with the value for all rows in the iterator */
public static void setValueToAllRowsInTheIterator(String iteratorName,
String attributeName, Object value)
{
DCIteratorBinding itemIter = getIterator(iteratorName);
for (int i = 0; i < itemIter.getViewObject().getEstimatedRowCount(); i++)
{
Row r = itemIter.getRowAtRangeIndex(i);
r.setAttribute(attributeName, value);
}
}
/** function take the folder name (which is located inside Web Content folder)
and will return the real path of that folder */
public static String getContextRealPath(String folderName)
{
String path = "";
try
{
path = getContext().getRealPath("/" + folderName);
}
catch (Exception e)
{
System.out.println(e);
}
return path;
}
/** function take af:table component (RichTable object) and clear all columns
filters */
public static void clearTableFilters(RichTable tableComponent)
{
FilterableQueryDescriptor q = (FilterableQueryDescriptor)
tableComponent.getFilterModel();
Map<String, Object> m = q.getFilterCriteria();
if (m != null)
{
m.clear();
}
}
/** function take af:query component (RichQuery object) and reset query fields
*/
public static void resetQueryFields(RichQuery queryComponent)
{
QueryModel queryModel = queryComponent.getModel();
{
writer.close();
}
catch (Exception ex)
{
}
}
}
}
return null;
}
/** function take iterator name then return the current row of the iterator */
public static Row getCurrentRow(String iteratorName)
{
if (getIterator(iteratorName).getCurrentRow() != null)
{
return getIterator(iteratorName).getCurrentRow();
}
return null;
}
{
ViewObject vo = null;
if(isVo)
{
vo = getViewObjectByName(name);
}
else
{
vo = getIterator(name).getViewObject();
}
if(vo == null)
{
return;
}
r.refresh(Row.REFRESH_REMOVE_NEW_ROWS |
Row.REFRESH_UNDO_CHANGES);
}
}
}
{
HttpServletRequest request = (HttpServletRequest)
FacesContext.getCurrentInstance().getExternalContext().getRequest();
return request.getRemoteHost().split("\\.")[0];
}
if (cookies != null)
{
for (int i = 0; i < cookies.length; i++)
{
String name = cookies[i].getName();
if (cookies != null)
{
for (int i = 0; i < cookies.length; i++)
{
String name = cookies[i].getName();
String value = cookies[i].getValue();
int age = cookies[i].getMaxAge();
{
return value;
}
}
}
return null;
}
currentDateTime=df.format(d);
return currentDateTime;
}
return noOfDays;
}
}else{
throw new RuntimeException("AppModuleAM instance not
found....");
}
}
} catch (Exception e) {
throw e;
}
return conn;
}
import hrms.model.attendance.lov.PeriodOpenLovImpl;
import hrms.model.attendance.lov.periodStatusLOVImpl;
import hrms.model.attendance.query.ApprovalStatusQueryImpl;
import hrms.model.attendance.query.AttendanceApprovalNotificationVOImpl;
import hrms.model.attendance.query.AttendanceApprovalQueryParamVOImpl;
import hrms.model.attendance.query.AttendanceProcessVOImpl;
import hrms.model.attendance.query.AttendanceQueryImpl;
import hrms.model.attendance.query.PeriodQueryVOImpl;
import hrms.model.attendance.query.Time_In_Out_VOImpl;
import hrms.model.attendance.view.AttendancePeriodVOImpl;
import hrms.model.common.AppModuleAM;
import hrms.model.emp.query.DeptQueryImpl;
import hrms.model.emp.query.DesignationQueryImpl;
import hrms.model.emp.view.DepartmentVOImpl;
import hrms.model.emp.view.DesignationVOImpl;
import hrms.model.emp.view.EmployeeVOImpl;
import hrms.model.leave.view.LeaveAppSubmissionRVOImpl;
import hrms.model.leave.view.LeaveAppSubmittedStatusRVOImpl;
import hrms.model.leave.view.LeaveApprovalRVOImpl;
import hrms.model.leave.view.LeaveAvailableBalanceRVOImpl;
import hrms.model.leave.view.LeaveProcessDetailRecRVOImpl;
import hrms.model.leave.view.LeaveProcessMasterRecRVOImpl;
import hrms.model.payroll.query.CTCEDCodeRuleVOImpl;
import hrms.model.payroll.query.CompleteCTCVOImpl;
import hrms.model.payroll.query.PayChangeQueryVOImpl;
import hrms.model.payroll.query.PayEmpDtlQueryVOImpl;
import hrms.model.payroll.query.PayEmpDtlVOImpl;
import hrms.model.payroll.view.CTCEarningVOImpl;
import hrms.model.payroll.view.CTCEmpDeductionVOImpl;
import hrms.model.payroll.view.PayProcessDetailsVOImpl;
import hrms.model.payroll.view.PayProcessMasterVOImpl;
import java.math.BigDecimal;
import java.sql.Timestamp;
import oracle.adf.share.ADFContext;
import oracle.jbo.JboException;
import oracle.jbo.Key;
import oracle.jbo.Row;
import oracle.jbo.RowSetIterator;
import oracle.jbo.server.ApplicationModuleImpl;
import oracle.jbo.server.EntityDefImpl;
import oracle.jbo.server.EntityImpl;
import oracle.jbo.server.ViewLinkImpl;
import oracle.jbo.server.ViewObjectImpl;
/**
* Container's getter for Location1.
* @return Location1
*/
public ViewObjectImpl getLocation1() {
return (ViewObjectImpl) findViewObject("Location1");
}
/**
* Container's getter for Department1.
* @return Department1
*/
public DepartmentVOImpl getDepartment1() {
return (DepartmentVOImpl) findViewObject("Department1");
}
/**
* Container's getter for DeptQuery1.
* @return DeptQuery1
*/
public DeptQueryImpl getDeptQuery1() {
return (DeptQueryImpl) findViewObject("DeptQuery1");
}
/**
* Container's getter for DesignationQuery1.
* @return DesignationQuery1
*/
public DesignationQueryImpl getDesignationQuery1() {
return (DesignationQueryImpl) findViewObject("DesignationQuery1");
}
/**
* Container's getter for Designation1.
* @return Designation1
*/
public DesignationVOImpl getDesignation1() {
return (DesignationVOImpl) findViewObject("Designation1");
/**
* Container's getter for Employee1.
* @return Employee1
*/
public EmployeeVOImpl getEmployee1() {
return (EmployeeVOImpl) findViewObject("Employee1");
}
/**
* Container's getter for SystemUser1.
* @return SystemUser1
*/
public ViewObjectImpl getSystemUser1() {
return (ViewObjectImpl) findViewObject("SystemUser1");
}
/**
* Container's getter for AttendancePeriod1.
* @return AttendancePeriod1
*/
public AttendancePeriodVOImpl getAttendancePeriod1() {
return (AttendancePeriodVOImpl) findViewObject("AttendancePeriod1");
}
/**
/**
* Container's getter for periodStatusLOV1.
* @return periodStatusLOV1
*/
public periodStatusLOVImpl getperiodStatusLOV1() {
return (periodStatusLOVImpl) findViewObject("periodStatusLOV1");
}
/**
* Container's getter for Attendance1.
* @return Attendance1
*/
public ViewObjectImpl getAttendance1() {
return (ViewObjectImpl) findViewObject("Attendance1");
}
String entityName="hrms.model.attendance.entity.AttendanceEO";
EntityDefImpl entityDef=EntityDefImpl.findDefObject(entityName);
Key attendanceKey=new Key(new Object[]{empId+attendanceDate});
EntityImpl entity = entityDef.findByPrimaryKey(getDBTransaction(),
attendanceKey);
boolean flag=false;
if(entity != null){
if(period !=null)
entity.setAttribute("AttendancePeriod", period);
if(attendanceDate !=null)
entity.setAttribute("AttendanceDate", attendanceDate);
if(timeIn !=null)
entity.setAttribute("TimeIn", timeIn);
if(timeOut !=null)
entity.setAttribute("TimeOut", timeOut);
flag=true;
System.out.println("Attendance Record updated successfully....");
}else{
entity=entityDef.createInstance2(getDBTransaction(), null);
if(attendanceDate != null) {
if(empId !=null)
entity.setAttribute("EmployeeId", empId);
if(attendanceDate !=null)
entity.setAttribute("AttendanceDate", attendanceDate);
if(period !=null)
entity.setAttribute("AttendancePeriod", period);
if(timeIn !=null)
entity.setAttribute("TimeIn", timeIn);
if(timeOut !=null)
entity.setAttribute("TimeOut", timeOut);
flag=true;
System.out.println("Attendance Record inserted successfully....");
}
}
if(flag){
try{
getDBTransaction().commit();
}catch(JboException e){
getDBTransaction().rollback();
throw e;
}
}
}
/**
* Container's getter for Time_In_Out_1.
* @return Time_In_Out_1
*/
public Time_In_Out_VOImpl getTime_In_Out_1() {
return (Time_In_Out_VOImpl) findViewObject("Time_In_Out_1");
}
/**
* Container's getter for AttendanceQuery1.
* @return AttendanceQuery1
*/
public AttendanceQueryImpl getAttendanceQuery1() {
return (AttendanceQueryImpl) findViewObject("AttendanceQuery1");
}
/**
* Container's getter for ApprovalStatusQuery1.
* @return ApprovalStatusQuery1
*/
public ApprovalStatusQueryImpl getApprovalStatusQuery1() {
return (ApprovalStatusQueryImpl)
findViewObject("ApprovalStatusQuery1");
}
/**
* Container's getter for AttendanceApprovalQueryParam1.
* @return AttendanceApprovalQueryParam1
*/
public AttendanceApprovalQueryParamVOImpl
getAttendanceApprovalQueryParam1() {
return (AttendanceApprovalQueryParamVOImpl)
findViewObject("AttendanceApprovalQueryParam1");
}
/**
* Container's getter for AttendanceApprovalNotification1.
* @return AttendanceApprovalNotification1
*/
public AttendanceApprovalNotificationVOImpl
getAttendanceApprovalNotification1() {
return (AttendanceApprovalNotificationVOImpl)
findViewObject("AttendanceApprovalNotification1");
}
/**
* Container's getter for LeaveCategory1.
* @return LeaveCategory1
*/
public ViewObjectImpl getLeaveCategory1() {
return (ViewObjectImpl) findViewObject("LeaveCategory1");
}
/**
* Container's getter for LeaveProcessMasterRecR1.
* @return LeaveProcessMasterRecR1
*/
public LeaveProcessMasterRecRVOImpl getLeaveProcessMasterRecR1() {
return (LeaveProcessMasterRecRVOImpl)
findViewObject("LeaveProcessMasterRecR1");
}
/**
* Container's getter for LeaveProcessDetailRecR1.
* @return LeaveProcessDetailRecR1
*/
public LeaveProcessDetailRecRVOImpl getLeaveProcessDetailRecR1() {
return (LeaveProcessDetailRecRVOImpl)
findViewObject("LeaveProcessDetailRecR1");
}
/**
* Container's getter for LeaveProcessMasterDetailVOLink1.
* @return LeaveProcessMasterDetailVOLink1
*/
/**
* Container's getter for LeaveAvailableBalanceR1.
* @return LeaveAvailableBalanceR1
*/
public LeaveAvailableBalanceRVOImpl getLeaveAvailableBalanceR1() {
return (LeaveAvailableBalanceRVOImpl)
findViewObject("LeaveAvailableBalanceR1");
}
/**
* Container's getter for LeaveAppSubmissionR1.
* @return LeaveAppSubmissionR1
*/
public LeaveAppSubmissionRVOImpl getLeaveAppSubmissionR1() {
return (LeaveAppSubmissionRVOImpl)
findViewObject("LeaveAppSubmissionR1");
}
/**
* Container's getter for LeaveAppSubmittedStatusR1.
* @return LeaveAppSubmittedStatusR1
*/
public LeaveAppSubmittedStatusRVOImpl
getLeaveAppSubmittedStatusR1() {
return (LeaveAppSubmittedStatusRVOImpl)
findViewObject("LeaveAppSubmittedStatusR1");
}
/**
* Container's getter for LeaveApprovalR1.
* @return LeaveApprovalR1
*/
public LeaveApprovalRVOImpl getLeaveApprovalR1() {
return (LeaveApprovalRVOImpl) findViewObject("LeaveApprovalR1");
}
/**
* Container's getter for AttendanceProcess1.
* @return AttendanceProcess1
*/
public AttendanceProcessVOImpl getAttendanceProcess1() {
return (AttendanceProcessVOImpl)
findViewObject("AttendanceProcess1");
}
/**
* Container's getter for EDCodeMaster1.
* @return EDCodeMaster1
*/
public ViewObjectImpl getEDCodeMaster1() {
return (ViewObjectImpl) findViewObject("EDCodeMaster1");
}
/**
* Container's getter for PayEmpDtl1.
* @return PayEmpDtl1
*/
public PayEmpDtlVOImpl getPayEmpDtl1() {
return (PayEmpDtlVOImpl) findViewObject("PayEmpDtl1");
}
/**
* Container's getter for PayEmpDtlQuery1.
* @return PayEmpDtlQuery1
*/
public PayEmpDtlQueryVOImpl getPayEmpDtlQuery1() {
return (PayEmpDtlQueryVOImpl) findViewObject("PayEmpDtlQuery1");
}
/**
* Container's getter for CTCEmpDeduction1.
* @return CTCEmpDeduction1
*/
public CTCEmpDeductionVOImpl getCTCEmpDeduction1() {
return (CTCEmpDeductionVOImpl)
findViewObject("CTCEmpDeduction1");
}
/**
* Container's getter for CTCEarning1.
* @return CTCEarning1
*/
public CTCEarningVOImpl getCTCEarning1() {
return (CTCEarningVOImpl) findViewObject("CTCEarning1");
}
/**
* Container's getter for CTCEDCodeRule1.
* @return CTCEDCodeRule1
*/
public CTCEDCodeRuleVOImpl getCTCEDCodeRule1() {
return (CTCEDCodeRuleVOImpl) findViewObject("CTCEDCodeRule1");
}
/**
* Get employee CTC
* @param empId
* @return
*/
public BigDecimal getEmployeeCTC(String empId){
String employeeId = (String) ADFContext.getCurrent()
.getPageFlowScope()
.get("ctc_emp_id");
//System.out.println("employeeId-->"+empId);
BigDecimal empCTC=BigDecimal.ZERO;
/**
* Update employee CTC in employee master entity
* @param empId
* @param empCTC
* @return
*/
public boolean updateEmpCTC(String empId,BigDecimal empCTC){
String entityName="hrms.model.emp.entity.EmployeesEO";
EntityDefImpl entityDef=EntityDefImpl.findDefObject(entityName);
Key empKey=new Key(new Object[]{empId});
EntityImpl entity = entityDef.findByPrimaryKey(getDBTransaction(),
empKey);
if(entity != null){
entity.setAttribute("EmpCtc", empCTC);
//getDBTransaction().commit();
return true;
}
return false;
/**
* Container's getter for CompleteCTC1.
* @return CompleteCTC1
*/
public CompleteCTCVOImpl getCompleteCTC1() {
/**
* Container's getter for PayChangeQuery1.
* @return PayChangeQuery1
*/
public PayChangeQueryVOImpl getPayChangeQuery1() {
return (PayChangeQueryVOImpl) findViewObject("PayChangeQuery1");
}
/**
* Container's getter for CTCPayChange1.
* @return CTCPayChange1
*/
public ViewObjectImpl getCTCPayChange1() {
return (ViewObjectImpl) findViewObject("CTCPayChange1");
}
/**
* Container's getter for PayProcessMaster1.
* @return PayProcessMaster1
*/
public PayProcessMasterVOImpl getPayProcessMaster1() {
return (PayProcessMasterVOImpl)
findViewObject("PayProcessMaster1");
}
/**
* Container's getter for PayProcessDetails1.
* @return PayProcessDetails1
*/
public PayProcessDetailsVOImpl getPayProcessDetails1() {
return (PayProcessDetailsVOImpl)
findViewObject("PayProcessDetails1");
}
/**
* Container's getter for PayMasterDetailsVOLink1.
* @return PayMasterDetailsVOLink1
*/
public ViewLinkImpl getPayMasterDetailsVOLink1() {
return (ViewLinkImpl) findViewLink("PayMasterDetailsVOLink1");
}
/**
* Container's getter for PeriodOpenLov1.
* @return PeriodOpenLov1
*/
public PeriodOpenLovImpl getPeriodOpenLov1() {
return (PeriodOpenLovImpl) findViewObject("PeriodOpenLov1");
}
/**
* Container's getter for ReportMaster1.
* @return ReportMaster1
*/
public ViewObjectImpl getReportMaster1() {
return (ViewObjectImpl) findViewObject("ReportMaster1");
}
/**
* Container's getter for ReportDetail1.
* @return ReportDetail1
*/
public ViewObjectImpl getReportDetail1() {
return (ViewObjectImpl) findViewObject("ReportDetail1");
}
/**
* Container's getter for reportVOLink1.
* @return reportVOLink1
*/
public ViewLinkImpl getreportVOLink1() {
return (ViewLinkImpl) findViewLink("reportVOLink1");
}
}
import hrms.view.util.MyADFUtils;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Types;
import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.adf.view.rich.component.rich.input.RichInputText;
import oracle.adf.view.rich.event.DialogEvent;
import oracle.adf.view.rich.event.PopupCanceledEvent;
import oracle.adf.view.rich.event.PopupFetchEvent;
import oracle.jbo.Row;
import oracle.jbo.ViewObject;
public LoginBean() {
}
}catch(SQLException e){
MyADFUtils.showErrorMessage("Error occur-->"+e.getMessage());
}finally{
MyADFUtils.close(stmt);
}
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("SystemUser1Iterator");
if(vo != null){
MyADFUtils.executeOperation("CreateInsert");
}
}
}
}else{
MyADFUtils.showErrorMessage("Please select user id from the list");
throw new RuntimeException();
}
}
}
}
}
public EmpInfoMgmtBean() {
/*
* If LocationEditFlag is not true then only create the new record
*/
public void createLocationFetchListner(PopupFetchEvent popupFetchEvent)
{
// System.out.println("Create location Popup title --
>"+this.getLocationPopupTitle()+" ; "+this.isLocationEditFlag());
if(!this.isLocationEditFlag())
MyADFUtils.executeOperation("CreateInsert");
else
this.setLocationEditFlag(false);
}
}
}
}
}
row.remove();
MyADFUtils.executeOperation("Commit");
MyADFUtils.executeOperation("Execute");
this.setSuccessMsgTextRC("Record deleted successfully...");
MyADFUtils.showPopup(getSuccessMsgPopup());
}
}catch(Exception e){
MyADFUtils.showErrorMessage("Record not found for
delete."+e.getMessage());
}
}
}
package hrms.view.bean;
import hrms.view.util.ConnectionManager;
import hrms.view.util.MyADFUtils;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Types;
import javax.faces.event.ActionEvent;
import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.adf.view.rich.event.DialogEvent;
import oracle.adf.view.rich.event.PopupCanceledEvent;
import oracle.adf.view.rich.event.PopupFetchEvent;
public AttendanceBean() {
this.setAttendanceTranPageName("status");
this.setConfirmationFlag(false);
this.confirmationFlag = confirmationFlag;
return confirmationFlag;
this.attendanceTranPageName = attendanceTranPageName;
return attendanceTranPageName;
this.setAttendanceTranPageName("periodSetup");
return "attendanceTran";
this.setAttendanceTranPageName("status");
return "attendanceTran";
this.setAttendanceTranPageName("approvalNotification");
return "attendanceTran";
this.setAttendanceTranPageName("inout");
return "attendanceTran";
public void
cancelAttendanceProcessPopupCanceledListner(PopupCanceledEvent
popupCanceledEvent) {
MyADFUtils.executeOperation("Rollback");
MyADFUtils.showPopup(this.getConfirmationPopup());
this.successMessageTxt = successMessageTxt;
return successMessageTxt;
if(dialogEvent.getOutcome()==DialogEvent.Outcome.ok){
this.setConfirmationFlag(true);
processAttendance();
}else{
this.setConfirmationFlag(false);
this.setConfirmationFlag(false);
this.confirmationPopup = confirmationPopup;
return confirmationPopup;
this.successfullMsgPopup = successfullMsgPopup;
return successfullMsgPopup;
/*
*/
Connection con=null;
CallableStatement cstmt=null;
String plsql="{call
ATTENDANCE_PROCESS.process_attendance(?,?,?)}";
String atdPeriod=null,empId=null,msg=null;
if(MyADFUtils.getIterator("AttendanceProcess1Iterator") != null){
atdPeriod =
(String)
MyADFUtils.getAttributeFromIterator("AttendanceProcess1Iterator",
"AttendancePeriod");
empId = (String)
MyADFUtils.getAttributeFromIterator("AttendanceProcess1Iterator",
"EmpId");
if(atdPeriod == null){
//Get DB Connection
try {
con = ConnectionManager.getConnection();
} catch (Exception e) {
MyADFUtils.showErrorMessage("Unable to get DB
Connection.Contact IT.");
try {
cstmt=con.prepareCall(plsql);
cstmt.setString(1, atdPeriod);
if(empId==null){
cstmt.setNull(2, Types.VARCHAR);
}else{
cstmt.setString(2, empId);
cstmt.registerOutParameter(3, Types.VARCHAR);
cstmt.executeQuery();
msg=cstmt.getString(3);
if(msg != null){
this.setSuccessMessageTxt(msg);
}else{
MyADFUtils.showPopup(this.getSuccessfullMsgPopup());
} catch (SQLException e) {
}finally{
ConnectionManager.releaseConnetion(con);
MyADFUtils.close(cstmt);
this.reportName = reportName;
return reportName;
this.setReportName("Attendance_detail");
return "print_report";
package hrms.view.bean;
import hrms.model.AppModuleAMImpl;
import hrms.model.attendance.query.common.ApprovalStatusQuery;
import hrms.model.attendance.query.common.Time_In_Out_VO;
import hrms.view.util.ConnectionManager;
import hrms.view.util.HRMSException;
import hrms.view.util.MyADFUtils;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
import java.time.LocalDate;
import java.time.LocalDateTime;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
import javax.faces.validator.ValidatorException;
import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.adf.view.rich.component.rich.input.RichInputDate;
import oracle.adf.view.rich.component.rich.input.RichSelectBooleanCheckbox;
import oracle.adf.view.rich.component.rich.input.RichSelectOneChoice;
import oracle.adf.view.rich.event.DialogEvent;
import oracle.adf.view.rich.event.PopupCanceledEvent;
import oracle.adf.view.rich.event.PopupFetchEvent;
import oracle.jbo.Row;
import oracle.jbo.ViewObject;
import org.eclipse.persistence.jpa.rs.util.HrefHelper;
public AttendanceTranBean() {
MyADFUtils.executeOperation("CreateInsert");
MyADFUtils.executeOperation("Rollback");
MyADFUtils.showPopup(this.getPeriodOpenClosePopup());
return null;
MyADFUtils.showPopup(this.getPeriodOpenClosePopup());
this.periodOpenClosePopup = periodOpenClosePopup;
return periodOpenClosePopup;
this.successMsgPopup = successMsgPopup;
return successMsgPopup;
this.successMsgTxt = successMsgTxt;
return successMsgTxt;
MyADFUtils.executeOperation("Commit");
MyADFUtils.showPopup(this.getSuccessMsgPopup());
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("PeriodQuery1Iterator");
vo.executeQuery();
}else{
MyADFUtils.executeOperation("Rollback");
String period=null,status=null;
AppModuleAMImpl
am=(AppModuleAMImpl)MyADFUtils.getDefaultApplicationModule();
Row
row=MyADFUtils.getViewObjectFromIterator("PeriodQuery1Iterator").getCurr
entRow();
if(row != null){
if(am.updateAttendancePeriod(period, status)){
MyADFUtils.showPopup(this.getSuccessMsgPopup());
MyADFUtils.getViewObjectFromIterator("PeriodQuery1Iterator").executeQuer
y();
}else{
}else{
if(empId == null){
if(atdPeriod == null){
Time_In_Out_VO vo = (Time_In_Out_VO)
MyADFUtils.getViewObjectFromIterator("Time_In_Out_1Iterator");
if(vo != null){
vo.getEmpAttendance(empId, atdPeriod);
boolean selectFlag=false;
String employeeId,attendancePeriod;
Timestamp timeIn,timeOut,attendanceDate;
LocalDate atdDate=null;
LocalDateTime inTime=null,outTime=null;
if(MyADFUtils.getViewObjectFromIterator("Time_In_Out_1Iterator") !=
null){
employeeId =
(String)MyADFUtils.getAttributeFromIterator("Time_In_Out_1Iterator",
"EmployeeId");
attendancePeriod =
(String)MyADFUtils.getAttributeFromIterator("Time_In_Out_1Iterator",
"AttendancePeriod");
attendanceDate =
(Timestamp)MyADFUtils.getAttributeFromIterator("Time_In_Out_1Iterator",
"AttendanceDate");
timeIn =
(Timestamp)MyADFUtils.getAttributeFromIterator("Time_In_Out_1Iterator",
"TimeIn");
timeOut =
(Timestamp)MyADFUtils.getAttributeFromIterator("Time_In_Out_1Iterator",
"TimeOut");
if(MyADFUtils.getAttributeFromIterator("Time_In_Out_1Iterator",
"selectionFlag") !=null)
selectFlag =
Boolean.parseBoolean(MyADFUtils.getAttributeFromIterator("Time_In_Out_1
Iterator", "selectionFlag").toString());
if(selectFlag){
try{
inTime=timeIn.toLocalDateTime();
outTime=timeOut.toLocalDateTime();
if(inTime.getDayOfMonth() != outTime.getDayOfMonth() ||
inTime.getDayOfWeek() != outTime.getDayOfWeek() ||
inTime.getHour()> outTime.getHour()
){
this.setErrorMessageText(errMsg);
}catch(HRMSException he){
// MyADFUtils.showPopup(this.getErrorMessagePopup());
MyADFUtils.showErrorMessage(he.toString());
try{
if(this.submitEmployeeAttendance(employeeId,
attendancePeriod, attendanceDate, timeIn, timeOut)){
this.setSuccessMsgTxt("Attendance submitted
Successfully...");
MyADFUtils.showPopup(this.getSuccessMsgPopup());
MyADFUtils.getViewObjectFromIterator("Time_In_Out_1Iterator").executeQu
ery();
}else{
MyADFUtils.showPopup(this.getErrorMessagePopup());
}catch(Exception e){
e.printStackTrace();
this.setErrorMessageText("Error occur-->"+e.getMessage());
MyADFUtils.showPopup(this.getErrorMessagePopup());
}else{
MyADFUtils.showPopup(this.getErrorMessagePopup());
}else{
MyADFUtils.showPopup(this.getErrorMessagePopup());
MyADFUtils.executeOperation("CreateInsert");
Timestamp timeOut){
Connection con=null;
CallableStatement stmt=null;
String status="Fail";
boolean flag=false;
try{
con=ConnectionManager.getConnection();
stmt=con.prepareCall(plsql);
stmt.setString(1, empId);
stmt.setString(2, period);
stmt.setTimestamp(3, attendanceDate);
stmt.setTimestamp(4, timeIn);
stmt.setTimestamp(5, timeOut);
stmt.registerOutParameter(6, Types.VARCHAR);
stmt.execute();
status=stmt.getString(6);
}catch(Exception se){
se.printStackTrace();
}finally{
MyADFUtils.close(stmt);
ConnectionManager.releaseConnetion(con);
flag= true;
return flag;
boolean flag=false;
Connection con=null;
CallableStatement stmt=null;
String plsql="{?=call
GET_ATTENDANCE_SUBMISSION_STATUS(?,?)}";
String status="FOUND";
try{
con=ConnectionManager.getConnection();
stmt=con.prepareCall(plsql);
stmt.setString(2, empId);
stmt.setObject(3, attendanceDate);
stmt.registerOutParameter(1, Types.VARCHAR);
stmt.execute();
status=stmt.getString(1);
// System.out.println("Attendance Status-->"+status);
}catch(Exception se){
se.printStackTrace();
}finally{
MyADFUtils.close(stmt);
ConnectionManager.releaseConnetion(con);
flag= true;
return flag;
this.errorMessagePopup = errorMessagePopup;
return errorMessagePopup;
this.errorMessageText = errorMessageText;
return errorMessageText;
this.attendancePeriodRC = attendancePeriodRC;
return attendancePeriodRC;
this.attendanceDateRC = attendanceDateRC;
return attendanceDateRC;
this.timeInRC = timeInRC;
return timeInRC;
this.timeOutRC = timeOutRC;
return timeOutRC;
this.selectAttendanceRecRC = selectAttendanceRecRC;
return selectAttendanceRecRC;
if(valueChangeEvent.getNewValue().toString().equals("true")){
MyADFUtils.setAttributeInIterator("Time_In_Out_1Iterator",
"selectionFlag", "true");
this.setAtnSelectCB(true);
} else{
MyADFUtils.setAttributeInIterator("Time_In_Out_1Iterator",
"selectionFlag", "false");
this.setAtnSelectCB(false);
this.atnSelectCB = atnSelectCB;
return atnSelectCB;
String errMsg=null,employeeId=null;
Object
attendanceDate=Timestamp.valueOf(object.toString()).toLocalDateTime().toLo
calDate();
if(object != null){
employeeId =
(String)MyADFUtils.getAttributeFromIterator("Time_In_Out_1Iterator",
"EmployeeId");
//System.out.println("Dt Val--
>"+validateAttendanceDetails(employeeId,attendanceDate));
if(validateAttendanceDetails(employeeId,attendanceDate)==false)
ApprovalStatusQuery vo =
(ApprovalStatusQuery)
MyADFUtils.getViewObjectFromIterator("ApprovalStatusQuery1Iterator");
System.out.println("Period selected--
>"+valueChangeEvent.getNewValue().toString());
vo.setAttendancePeriodForQueryAndExecute(valueChangeEvent.getNewValue
().toString());
this.approveAllCBRC = approveAllCBRC;
return approveAllCBRC;
this.approveCBRC = approveCBRC;
return approveCBRC;
this.rejectAllCBRC = rejectAllCBRC;
return rejectAllCBRC;
this.rejectCBRC = rejectCBRC;
return rejectCBRC;
if(MyADFUtils.getIterator("AttendanceApprovalNotification1Iterator")!=
null){
if(valueChangeEvent.getNewValue().toString().equals("true")){
MyADFUtils.setAttributeInIterator("AttendanceApprovalNotification1Iterator",
"approve", "Y");
}else{
MyADFUtils.setAttributeInIterator("AttendanceApprovalNotification1Iterator",
"approve", "N");
}else{
if(MyADFUtils.getIterator("AttendanceApprovalNotification1Iterator")!=
null){
if(valueChangeEvent.getNewValue().toString().equals("true")){
MyADFUtils.setAttributeInIterator("AttendanceApprovalNotification1Iterator",
"reject", "Y");
}else{
MyADFUtils.setAttributeInIterator("AttendanceApprovalNotification1Iterator",
"reject", "N");
}else{
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("AttendanceApprovalNotification
1Iterator");
boolean flag=true;
if(valueChangeEvent.getNewValue().toString().equals("true")){
vo.setCurrentRow(vo.first());
while(flag){
Row row=vo.getCurrentRow();
if(row != null){
row.setAttribute("approve", "Y");
//this.getApproveCBRC().setChanged(Boolean.TRUE);
this.getApproveCBRC().setValue(Boolean.TRUE);
if(vo.hasNext()){
vo.setCurrentRow(vo.next());
}else{
flag=false;
}else{
vo.setCurrentRow(vo.first());
while(flag){
Row row=vo.getCurrentRow();
if(row != null){
row.setAttribute("approve", "N");
//this.getApproveCBRC().setChanged(Boolean.FALSE);
this.getApproveCBRC().setValue(Boolean.FALSE);
if(vo.hasNext()){
vo.setCurrentRow(vo.next());
}else{
flag=false;
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("AttendanceApprovalNotification
1Iterator");
boolean flag=true;
String empId=null,cb=null;
Object attendancedate=null,timeIn=null,timeOut=null;
PreparedStatement ps=null;
Connection con=null;
"where employee_id=?"+
"and attendance_date=?";
try{
con=ConnectionManager.getConnection();
ps=con.prepareStatement(sql);
if(vo != null){
vo.setCurrentRow(vo.first());
while(flag){
Row row=vo.getCurrentRow();
if(row != null){
attendancedate=row.getAttribute("AttendanceDate");
timeIn=row.getAttribute("TimeIn");
timeOut=row.getAttribute("TimeOut");
cb = (String) row.getAttribute("approve");
approveAttendanceInDB(empId,attendancedate,ps,"Y");
}else{
}else{
if(vo.hasNext()){
vo.setCurrentRow(vo.next());
}else{
flag=false;
ps.executeBatch();
con.commit();
MyADFUtils.showPopup(this.getSuccessMsgPopup());
MyADFUtils.getViewObjectFromIterator("AttendanceApprovalNotification1Ite
rator").executeQuery();
}catch(HRMSException e){
MyADFUtils.showErrorMessage(e.toString());
}catch(Exception ex){
MyADFUtils.showErrorMessage(ex.getMessage());
}finally{
MyADFUtils.close(ps);
ConnectionManager.releaseConnetion(con);
this.approveCB = approveCB;
return approveCB;
/**
* @param empId
* @param atnDate
* @param ps
* @throws HRMSException
*/
PreparedStatement ps,
try{
ps.setObject(1, approvalFlag);
ps.setObject(2, empId);
ps.setObject(3, atnDate);
ps.addBatch();
}catch(SQLException ex){
package hrms.view.bean;
import hrms.model.leave.view.LeaveAppSubmittedStatusRVOImpl;
import hrms.view.util.ConnectionManager;
import hrms.view.util.MyADFUtils;
import java.math.BigDecimal;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Timestamp;
import java.sql.Types;
import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.adf.view.rich.component.rich.input.RichSelectBooleanCheckbox;
import oracle.adf.view.rich.context.AdfFacesContext;
import oracle.adf.view.rich.event.DialogEvent;
import oracle.adf.view.rich.event.PopupCanceledEvent;
import oracle.adf.view.rich.event.PopupFetchEvent;
import oracle.jbo.Row;
import oracle.jbo.ViewObject;
public LeaveBean() {
finYear=MyADFUtils.getCurrentFinYear();
runFlagValue=false;
this.successfullMessagePopup = successfullMessagePopup;
return successfullMessagePopup;
boolean flag=true,dmlFlag=false;
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("LeaveCategory1Iterator");
// System.out.println("Vo-->"+vo.getName());
//System.out.println("Row--
>"+vo.getCurrentRow().getAttribute("LeaveType"));
if(vo != null){
vo.setCurrentRow(vo.first());
while(flag){
dmlFlag=true;
break;
if(vo.hasNext()){
vo.next();
}else{
flag=false;
if(dmlFlag){
MyADFUtils.executeOperation("Commit");
MyADFUtils.showPopup(this.getSuccessfullMessagePopup());
}else{
MyADFUtils.showPopup(this.getSuccessfullMessagePopup());
this.successfullMessageText = successfullMessageText;
return successfullMessageText;
this.finYear = finYear;
return finYear;
this.finalRunCBRC = finalRunCBRC;
return finalRunCBRC;
/*
*/
String runFlag="N";
if(getFinalRunCBRC().getValue().toString().equals("true")){
runFlag="Y";
this.runFlagValue = runFlagValue;
return runFlagValue;
Connection con=null;
CallableStatement cstmt=null;
String returnMsg=null;
try{
con=ConnectionManager.getConnection();
cstmt=con.prepareCall(sql);
cstmt.setString(1, finYear);
cstmt.setString(2, runFlag);
cstmt.setString(3, processedBy);
cstmt.registerOutParameter(4,Types.VARCHAR);
cstmt.execute();
returnMsg=cstmt.getString(4);
this.setSuccessfullMessageText(returnMsg);
MyADFUtils.showPopup(this.getSuccessfullMessagePopup());
}catch(Exception e){
}finally{
MyADFUtils.close(cstmt);
ConnectionManager.releaseConnetion(con);
//Put Finyear in pageflow scope that will use in Leave balance where
clause
AdfFacesContext.getCurrentInstance().getPageFlowScope().put("p_finyear",
this.getFinYear());
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("LeaveAppSubmissionR1Iterator
");
if(vo != null)
MyADFUtils.executeOperation("CreateInsertLeaveAppRecord");
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("LeaveAppSubmissionR1Iterator
");
if(vo != null)
MyADFUtils.executeOperation("Rollback");
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("LeaveAppSubmissionR1Iterator
");
ViewObject leaveAppSubmittedVo =
MyADFUtils.getViewObjectByName("LeaveAppSubmittedStatusR1");
String fromDt=null,toDate=null,empLeaveCodeKey=null;
BigDecimal noOfDays=null;
if(dialogEvent.getOutcome()==DialogEvent.Outcome.ok){
if(vo != null){
empLeaveCodeKey = (String)
vo.getCurrentRow().getAttribute("EmpLeaveCodeKey");
noOfDays = new
BigDecimal(vo.getCurrentRow().getAttribute("NoOfDays").toString());
submitLeaveDataToDB(empLeaveCodeKey,fromDt,toDate,noOfDays);
if(leaveAppSubmittedVo != null){
System.out.println("Row count--
>"+leaveAppSubmittedVo.getEstimatedRowCount());
leaveAppSubmittedVo.executeQuery();
}else{
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("LeaveAppSubmissionR1Iterator
");
String fromDt=null,toDate=null,leaveCode=null,empLeaveCodeKey=null;
long noOfDays=0;
if(vo != null){
//If Leave is Half day type then we will assign 0.5 in no_Of_days
if(fromDt.equals(toDate)){
vo.getCurrentRow().setAttribute("NoOfDays", 0.5);
}else{
}else{
vo.getCurrentRow().setAttribute("NoOfDays", noOfDays+1);
empLeaveCodeKey= (String)
MyADFUtils.getFromSession("personId")+leaveCode;
if(empLeaveCodeKey != null){
vo.getCurrentRow().setAttribute("EmpLeaveCodeKey",
empLeaveCodeKey);
}else{
MyADFUtils.showErrorMessage("empLeaveCodeKey found
null.Please contact IT.");
Connection con=null;
CallableStatement cstmt=null;
String returnMsg=null;
try{
con=ConnectionManager.getConnection();
cstmt=con.prepareCall(sql);
cstmt.setString(1, empLeaveCodekey);
cstmt.setObject(2, fromDate);
cstmt.setObject(3, toDate);
cstmt.setObject(4, noOfDays);
cstmt.registerOutParameter(5,Types.VARCHAR);
cstmt.execute();
returnMsg=cstmt.getString(5);
this.setSuccessfullMessageText(returnMsg);
MyADFUtils.showPopup(this.getSuccessfullMessagePopup());
}catch(Exception e){
}finally{
MyADFUtils.close(cstmt);
ConnectionManager.releaseConnetion(con);
String empLeaveKey=null,actionFlag="Approve";
Timestamp fromDate=null,toDate=null;
ViewObject
vo=MyADFUtils.getViewObjectByName("LeaveApprovalR1");
Row row=vo.getCurrentRow();
System.out.println("selected record-->"+fromDate);
approveRejectLeave(empLeaveKey,fromDate,toDate,approvedBy,actionFlag);
vo.executeQuery();
String empLeaveKey=null,actionFlag="Reject";
Object fromDate=null,toDate=null;
ViewObject
vo=MyADFUtils.getViewObjectByName("LeaveApprovalR1");
Row row=vo.getCurrentRow();
fromDate = row.getAttribute("LeaveFromDate");
toDate = row.getAttribute("LeaveFromDate");
System.out.println("selected record-->"+fromDate);
approveRejectLeave(empLeaveKey,fromDate,toDate,approvedBy,actionFlag);
vo.executeQuery();
Connection con=null;
CallableStatement cstmt=null;
String returnMsg=null;
try{
con=ConnectionManager.getConnection();
cstmt=con.prepareCall(sql);
cstmt.setString(1, empLeaveCodekey);
cstmt.setObject(2, fromDate);
cstmt.setObject(3, toDate);
cstmt.setObject(4, approvedBy);
cstmt.setObject(5, actionFlag);
cstmt.registerOutParameter(6,Types.VARCHAR);
cstmt.execute();
returnMsg=cstmt.getString(6);
this.setSuccessfullMessageText(returnMsg);
MyADFUtils.showPopup(this.getSuccessfullMessagePopup());
}catch(Exception e){
e.printStackTrace();
}finally{
MyADFUtils.close(cstmt);
ConnectionManager.releaseConnetion(con);
package hrms.view.bean;
import hrms.model.payroll.query.CTCEDCodeRuleVORowImpl;
import hrms.model.payroll.view.CTCEarningVORowImpl;
import hrms.model.payroll.view.CTCEmpDeductionVORowImpl;
import hrms.view.util.ConnectionManager;
import hrms.view.util.HRMSException;
import hrms.view.util.MyADFUtils;
import java.math.BigDecimal;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
import javax.faces.validator.ValidatorException;
import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.adf.view.rich.component.rich.input.RichInputListOfValues;
import oracle.adf.view.rich.component.rich.input.RichInputText;
import oracle.adf.view.rich.component.rich.input.RichSelectBooleanCheckbox;
import oracle.adf.view.rich.component.rich.input.RichSelectOneChoice;
import oracle.adf.view.rich.component.rich.input.RichSelectOneRadio;
import oracle.adf.view.rich.component.rich.layout.RichPanelBox;
import oracle.adf.view.rich.component.rich.layout.RichPanelFormLayout;
import oracle.adf.view.rich.event.DialogEvent;
import oracle.adf.view.rich.event.PopupCanceledEvent;
import oracle.adf.view.rich.event.PopupFetchEvent;
import oracle.binding.OperationBinding;
import oracle.jbo.Row;
import oracle.jbo.RowSetIterator;
import oracle.jbo.ViewObject;
import org.apache.myfaces.trinidad.event.DisclosureEvent;
public PayrollBean() {
MyADFUtils.executeOperation("CreateInsert");
MyADFUtils.executeOperation("Rollback");
MyADFUtils.refreshVOByIteratorName("EDCodeMaster1Iterator");
this.successMsgPopup = successMsgPopup;
return successMsgPopup;
this.successMsgTxt = successMsgTxt;
return successMsgTxt;
String description=(String)
MyADFUtils.getAttributeFromIterator("EDCodeMaster1Iterator",
"Description");
char edType;
if(edCode.length()<5){
edType=edCode.charAt(0);
if(edType=='E' || edType=='D'){
else{
if(description.length()>100){
if(dialogEvent.getOutcome()==DialogEvent.Outcome.ok){
MyADFUtils.executeOperation("Commit");
MyADFUtils.refreshViewObject("EDCodeMaster1");
MyADFUtils.showPopup(this.getSuccessMsgPopup());
}else{
this.isActiveEDCodeRC = isActiveEDCodeRC;
return isActiveEDCodeRC;
this.isTaxableEDCodeRC = isTaxableEDCodeRC;
return isTaxableEDCodeRC;
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("EDCodeMaster1Iterator");
Row row=null;
valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentIn
stance());
if(valueChangeEvent.getNewValue().toString().equals("true")){
if(vo != null){
row=vo.getCurrentRow();
row.setAttribute("IsActive", "Y");
}else{
if(vo != null){
row=vo.getCurrentRow();
row.setAttribute("IsActive", "N");
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("EDCodeMaster1Iterator");
Row row=null;
valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentIn
stance());
if(valueChangeEvent.getNewValue().toString().equals("true")){
if(vo != null){
row=vo.getCurrentRow();
row.setAttribute("IsTaxable", "Y");
}else{
if(vo != null){
row=vo.getCurrentRow();
row.setAttribute("IsTaxable", "N");
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("EDCodeMaster1Iterator");
Row row=null;
if(vo != null){
row=vo.getCurrentRow();
if(row.getAttribute("IsActive")==null ||
row.getAttribute("IsActive").equals("N")){
this.setIsActiveEditCBValue(false);
}else{
this.setIsActiveEditCBValue(true);
if(row.getAttribute("IsTaxable")==null ||
row.getAttribute("IsTaxable").equals("N")){
this.setIsTaxableEditCBValue(false);
}else{
this.setIsTaxableEditCBValue(true);
this.edCodeTypeRBValue = edCodeTypeRBValue;
return edCodeTypeRBValue;
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("EDCodeMaster1Iterator");
String edCodeValue=null,edCodeType=null;
Row row=null;
if(vo != null){
row=vo.getCurrentRow();
edCodeValue=MyADFUtils.getSqlDescription("select
GET_NEW_ED_CODE('"+edCodeType+"') from dual");
row.setAttribute("EdCode", edCodeValue);
MyADFUtils.executeOperation("Rollback");
MyADFUtils.refreshVOByIteratorName("EDCodeMaster1Iterator");
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("EDCodeMaster1Iterator");
Row row=null;
valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentIn
stance());
if(valueChangeEvent.getNewValue().toString().equals("true")){
if(vo != null){
row=vo.getCurrentRow();
row.setAttribute("IsActive", "Y");
}else{
if(vo != null){
row=vo.getCurrentRow();
row.setAttribute("IsActive", "N");
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("EDCodeMaster1Iterator");
Row row=null;
valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentIn
stance());
if(valueChangeEvent.getNewValue().toString().equals("true")){
if(vo != null){
row=vo.getCurrentRow();
row.setAttribute("IsTaxable", "Y");
}else{
if(vo != null){
row=vo.getCurrentRow();
row.setAttribute("IsTaxable", "N");
if(dialogEvent.getOutcome()==DialogEvent.Outcome.ok){
MyADFUtils.executeOperation("Commit");
MyADFUtils.refreshViewObject("EDCodeMaster1");
MyADFUtils.showPopup(this.getSuccessMsgPopup());
MyADFUtils.putInSession("ConfirmationOperationFlag",
"DELETE_ED_CODE_RECORD");
MyADFUtils.showPopup(this.getConfirmationMsgPopup());
if(dialogEvent.getOutcome()==DialogEvent.Outcome.yes){
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("EDCodeMaster1Iterator");
if(vo != null){
Row row=vo.getCurrentRow();
if(row != null){
MyADFUtils.executeOperation("Delete");
MyADFUtils.executeOperation("Commit");
MyADFUtils.refreshViewObject("EDCodeMaster1");
MyADFUtils.showPopup(this.getSuccessMsgPopup());
MyADFUtils.putInSession("ConfirmationOperationFlag", null);
this.confirmationMsgTxt = confirmationMsgTxt;
return confirmationMsgTxt;
this.confirmationMsgPopup = confirmationMsgPopup;
return confirmationMsgPopup;
this.isActiveEditCBValue = isActiveEditCBValue;
return isActiveEditCBValue;
this.isTaxableEditCBValue = isTaxableEditCBValue;
return isTaxableEditCBValue;
this.initEDCodeCheckBoxesAttributes();
this.editEDCodeIstaxableCBRC = editEDCodeIstaxableCBRC;
return editEDCodeIstaxableCBRC;
this.editEDCodeIsActiveCBRC = editEDCodeIsActiveCBRC;
return editEDCodeIsActiveCBRC;
String empId=null;
BigDecimal empCTC=null;
MyADFUtils.putInPageFlowScope("ctc_emp_id", empId);
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("PayEmpDtl1Iterator");
vo.executeQuery();
ViewObject
ctcEarningvo=MyADFUtils.getViewObjectFromIterator("CTCEarning1Iterator
");
ctcEarningvo.executeQuery();
ViewObject
ctcDeductionvo=MyADFUtils.getViewObjectFromIterator("CTCEmpDeductio
n1Iterator");
ctcDeductionvo.executeQuery();
empCTC = getEmpCTCAmount(empId);
MyADFUtils.putInPageFlowScope("empCTC", empCTC);
this.getEmpCTCInputRC().setValue(empCTC);
BigDecimal empCTC=null;
OperationBinding opBinding =
MyADFUtils.getOperationBinding("getEmployeeCTC");
map.put("empId", empId);
empCTC = ((BigDecimal)
opBinding.execute())==null?BigDecimal.ZERO:(BigDecimal)
opBinding.execute();
MyADFUtils.putInPageFlowScope("empCTC", empCTC);
return empCTC;
ViewObject
earningVO=MyADFUtils.getViewObjectFromIterator("CTCEarning1Iterator");
ViewObject
empDeductionVO=MyADFUtils.getViewObjectFromIterator("CTCEmpDeduct
ion1");
earningVO.executeQuery();
empDeductionVO.executeQuery();
return true;
return false;
ViewObject
ctcVO=MyADFUtils.getViewObjectFromIterator("CTCEarning1Iterator");
ViewObject
empVO=MyADFUtils.getViewObjectFromIterator("PayEmpDtl1Iterator");
Row empRow=empVO.getCurrentRow();
MyADFUtils.executeOperation("CreateInsertCTCEarning");
}else{
return;
ViewObject
ctcVO=MyADFUtils.getViewObjectFromIterator("CTCEarning1Iterator");
if(ctcVO != null){
ctcVO.getCurrentRow().remove();
}else{
return;
StringBuilder errorMsg=null;
errorMsg=validateCTCEntry();
if(errorMsg != null){
this.setErrorMsgHTMLString(errorMsg.toString());
MyADFUtils.showPopup(this.getErrorMsgPopup());
return;
if(this.isMonthlyCTCIncorrect()){
"</b></p></html>";
errorMsg=new StringBuilder();
errorMsg.append(msg);
this.setErrorMsgHTMLString(errorMsg.toString());
MyADFUtils.showPopup(this.getErrorMsgPopup());
return;
try {
MyADFUtils.executeOperation("Commit");
MyADFUtils.showPopup(this.getSuccessMsgPopup());
//refreshCTCStrVO();
} catch (Exception e) {
e.printStackTrace();
MyADFUtils.showErrorMessage(e.getMessage());
return;
/*
* Clear CTC VO
*/
ViewObject payEmpDtl=null,PayEmpDTLQuery=null,CTCEarning=null;
payEmpDtl=MyADFUtils.getViewObjectByName("payEmpDtl1");
if(payEmpDtl != null)
payEmpDtl.reset();
MyADFUtils.putInPageFlowScope("ctc_emp_id", null);
PayEmpDTLQuery=MyADFUtils.getViewObjectByName("PayEmpDTLQuery
1");
if(PayEmpDTLQuery != null)
PayEmpDTLQuery.reset();
CTCEarning=MyADFUtils.getViewObjectByName("CTCEarning1");
if(CTCEarning != null)
CTCEarning.reset();
MyADFUtils.executeOperation("Rollback");
this.ctcEmpIDQueryLOVRC.setValue(MyADFUtils.getFromPageFlowScope("
ctc_emp_id"));
this.getEmpCTCInputRC().setValue(getEmpCTCAmount(MyADFUtils.getFro
mPageFlowScope("ctc_emp_id").toString()));
MyADFUtils.refreshComponent(this.getCtcEmpIDQueryLOVRC());
ViewObject
payEmpDtl=MyADFUtils.getViewObjectFromIterator("PayEmpDtl1Iterator");
try{
ViewObject
CTCEarning=MyADFUtils.getViewObjectByName("CTCEarning1");
if(CTCEarning != null){
CTCEarningVORowImpl
ctc=(CTCEarningVORowImpl)CTCEarning.getCurrentRow();
if(validateDuplicateEDCodeInCTC(CTCEarning,
"Earning",ctc.getEdCode())!=null){
this.setErrorMsgHTMLString(validateDuplicateEDCodeInCTC(CTCEarning,
"Earning",ctc.getEdCode()).toString());
ctc.setEmployeeId(payEmpDtl.getCurrentRow().getAttribute("EmployeeId").to
String());
}else{
return;
}catch(HRMSException e){
MyADFUtils.showPopup(this.getErrorMsgPopup());
/**
* @return
*/
boolean flag=false;
ViewObject
CTCEarning=MyADFUtils.getViewObjectByName("CTCEarning1");
RowSetIterator ctcEarningIter=CTCEarning.createRowSetIterator(null);
ViewObject
CTCDeduction=MyADFUtils.getViewObjectByName("CTCEmpDeduction1");
RowSetIterator
ctcDeductionIter=CTCDeduction.createRowSetIterator(null);
if(ctcEarningIter != null){
while(ctcEarningIter.hasNext()){
CTCEarningVORowImpl
row=(CTCEarningVORowImpl)ctcEarningIter.next();
if(MyADFUtils.isRowStatusNew(row) ||
MyADFUtils.isRowStatusUpdate(row)){
if(row.getEdCode()==null ||
(row.getAmount()==null ||
if(row.getEdCode()==null){
// msg.append("is mandatory.</p>");
if(row.getAmount()==null){
// msg.append("<p><b>Amount </b>");
if(!flag)
flag=true;
break;
ctcEarningIter.closeRowSetIterator();
if(ctcDeductionIter != null){
while(ctcDeductionIter.hasNext()){
CTCEmpDeductionVORowImpl
row=(CTCEmpDeductionVORowImpl)ctcDeductionIter.next();
if(MyADFUtils.isRowStatusNew(row) ||
MyADFUtils.isRowStatusUpdate(row)){
if(row.getEdCode()==null ||
(row.getAmount()==null ||
if(row.getEdCode()==null){
// msg.append("is mandatory.</p>");
if(row.getAmount()==null){
// msg.append("<p><b>Amount </b>");
if(!flag)
flag=true;
break;
ctcDeductionIter.closeRowSetIterator();
msg.append("<html>");
if(errMap.containsKey("ERR_1")){
msg.append(errMap.get("ERR_1")+"</p>");
if(errMap.containsKey("ERR_2")){
msg.append("<p><b>Amount </b>");
msg.append(errMap.get("ERR_2")+"</p>");
if(errMap.containsKey("ERR_3")){
msg.append(errMap.get("ERR_3")+"</p>");
if(errMap.containsKey("ERR_4")){
msg.append("<p><b>Amount </b>");
msg.append(errMap.get("ERR_4")+"</p>");
msg.append("</html>");
return msg;
return null;
this.errorMsgPopup = errorMsgPopup;
return errorMsgPopup;
this.errorMsgHTMLString = errorMsgHTMLString;
return errorMsgHTMLString;
/**
*/
String edCodeType,
String edCode){
boolean flag=false;
int count=0;
String errMsg=null;
if(edCodeType.equals("Earning") || edCodeType.equals("Deduction")){
msg.append("<html>");
while(rowIter.hasNext()){
Row row=rowIter.next();
if(row.getAttribute("EdCode") != null){
if(edCodeEntry.equals(edCode)){
count++;
if(count>1){
if(row.getAttribute("EDCodeDescription") != null){
errMsg=row.getAttribute("EDCodeDescription")+" already
exist.";
}else{
errMsg="Already exist.";
msg.append("<p>");
msg.append("<b>");
msg.append(errMsg);
msg.append("</b>");
msg.append("</p>");
if(!flag)
flag=true;
break;
msg.append("</html>");
return msg;
return null;
this.ctcTotalAmountRC = ctcTotalAmountRC;
return ctcTotalAmountRC;
this.ctcTotalAnuualAmtRC = ctcTotalAnuualAmtRC;
return ctcTotalAnuualAmtRC;
/**
* @return
*/
BigDecimal totalAmt=BigDecimal.ZERO,
totalAnnualAmt=BigDecimal.ZERO,
amount=null,
annualAmt=null;
HashMap<String,BigDecimal> total=new
HashMap<String,BigDecimal>();
if(vo != null ){
RowSetIterator rs=vo.createRowSetIterator(null);
while(rs.hasNext()){
Row row=rs.next();
if(row != null){
amount = (BigDecimal)row.getAttribute("Amount");
annualAmt = (BigDecimal)row.getAttribute("AnnualAmount");
totalAmt= totalAmt.add((amount !=
null)?amount:BigDecimal.ZERO);
totalAnnualAmt= totalAnnualAmt.add((annualAmt !=
null)?annualAmt:BigDecimal.ZERO);
total.put("totalAmt", totalAmt);
total.put("totalAnnualAmt", totalAnnualAmt);
}else{
total.put("totalAmt", BigDecimal.ZERO);
total.put("totalAnnualAmt", BigDecimal.ZERO);
return total;
this.totalCTCEarning = totalCTCEarning;
ViewObject
CTCEarning=MyADFUtils.getViewObjectByName("CTCEarning1");
HashMap<String,BigDecimal> total=null;
if(CTCEarning != null){
total=calculateTotal(CTCEarning);
this.setTotalCTCEarning(total.get("totalAmt").doubleValue());
return totalCTCEarning;
this.totalAnnualCTCEarning = totalAnnualCTCEarning;
ViewObject
CTCEarning=MyADFUtils.getViewObjectByName("CTCEarning1");
HashMap<String,BigDecimal> total=null;
if(CTCEarning != null){
total=calculateTotal(CTCEarning);
this.setTotalAnnualCTCEarning(total.get("totalAnnualAmt").doubleValue());
return totalAnnualCTCEarning;
this.empDeductionTotal = empDeductionTotal;
ViewObject
CTCDeduction=MyADFUtils.getViewObjectByName("CTCEmpDeduction1");
HashMap<String,BigDecimal> total=null;
if(CTCDeduction != null){
total=calculateTotal(CTCDeduction);
this.setEmpDeductionTotal(total.get("totalAmt").doubleValue());
return empDeductionTotal;
this.empDeductionAnnualTotal = empDeductionAnnualTotal;
ViewObject
CTCDeduction=MyADFUtils.getViewObjectByName("CTCEmpDeduction1");
HashMap<String,BigDecimal> total=null;
if(CTCDeduction != null){
total=calculateTotal(CTCDeduction);
this.setEmpDeductionAnnualTotal(total.get("totalAnnualAmt").doubleValue());
return empDeductionAnnualTotal;
ViewObject
ctcVO=MyADFUtils.getViewObjectFromIterator("CTCEmpDeduction1Iterator
");
ViewObject
empVO=MyADFUtils.getViewObjectFromIterator("PayEmpDtl1Iterator");
Row empRow=empVO.getCurrentRow();
MyADFUtils.executeOperation("CreateInsertCTCDeduction");
}else{
return;
ViewObject
ctcVO=MyADFUtils.getViewObjectFromIterator("CTCEmpDeduction1Iterator
");
if(ctcVO != null){
ctcVO.getCurrentRow().remove();
}else{
return;
valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentIn
stance());
ViewObject
payEmpDtl=MyADFUtils.getViewObjectFromIterator("PayEmpDtl1Iterator");
try{
ViewObject
CTCDeduction=MyADFUtils.getViewObjectByName("CTCEmpDeduction1");
if(CTCDeduction != null){
CTCEmpDeductionVORowImpl
ctc=(CTCEmpDeductionVORowImpl)CTCDeduction.getCurrentRow();
if(validateDuplicateEDCodeInCTC(CTCDeduction,
"Deduction",ctc.getEdCode())!=null){
this.setErrorMsgHTMLString(validateDuplicateEDCodeInCTC(CTCDeduction
, "Deduction",ctc.getEdCode()).toString());
ctc.setEmployeeId(payEmpDtl.getCurrentRow().getAttribute("EmployeeId").to
String());
}else{
return;
}catch(HRMSException e){
MyADFUtils.showPopup(this.getErrorMsgPopup());
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("CompleteCTC1Iterator");
vo.executeQuery();
/**
* @param vo
* @return
*/
boolean flag=false;
if(vo != null){
RowSetIterator rsi=vo.createRowSetIterator(null);
while(rsi.hasNext()){
Row row=rsi.next();
if(MyADFUtils.isRowStatusNew(row) ||
MyADFUtils.isRowStatusUpdate(row)){
flag=true;
break;
return flag;
this.questionAnswerPopup = questionAnswerPopup;
return questionAnswerPopup;
this.warningMsg = warningMsg;
return warningMsg;
this.empCTCInputRC = empCTCInputRC;
return empCTCInputRC;
if(empCTC != null){
try {
OperationBinding opBinding =
MyADFUtils.getOperationBinding("updateEmpCTC");
map.put("empId",
MyADFUtils.getFromPageFlowScope("ctc_emp_id"));
map.put("empCTC",empCTC);
opBinding.execute();
} catch (Exception e) {
e.printStackTrace();
OperationBinding opBinding =
MyADFUtils.getOperationBinding("getCTCEDCodeAmount");
map.put("empId", MyADFUtils.getFromPageFlowScope("ctc_emp_id"));
map.put("edCode",edCode);
String msg="NO_ERROR";
ViewObject vo=
MyADFUtils.getViewObjectFromIterator("CTCEDCodeRule1Iterator");
vo.executeQuery();
while(vo.hasNext()){
CTCEDCodeRuleVORowImpl
rec=(CTCEDCodeRuleVORowImpl)vo.next();
ctcAmount =
getEmpCTCAmount(MyADFUtils.getFromPageFlowScope("ctc_emp_id").toSt
ring());
if(rec.getEdCode().toString().equals("E0001") &&
rec.getEdCode().toString().equals(edCode) &&
ctcAmount.compareTo(BigDecimal.ZERO)<=0){
break;
if(rec.getEdCode().toString().equals("E0001") &&
rec.getEdCode().toString().equals(edCode) &&
ctcAmount.compareTo(BigDecimal.ZERO)>0 &&
rec.getEdCodeCalDepend().toString().equals("CTC")){
String
ctcAmtMonthlyRoundOff=MyADFUtils.roundValueBy2(ctcAmount.doubleVal
ue()/12);
ctcAmountMonthly=new BigDecimal(ctcAmtMonthlyRoundOff);
minRuleAmt=ctcAmountMonthly.multiply(rec.getMinPercent());
maxRuleAmt=ctcAmountMonthly.multiply(rec.getMaxPercent());
if(enteredAmount.compareTo(minRuleAmt)<0 ||
enteredAmount.compareTo(maxRuleAmt)>0
break;
if(rec.getEdCode().toString().equals(edCode)){
edCodeAmount=this.getEmpCTCEDCodeAmount(rec.getEdCodeCalDepend().
toString());
if(edCodeAmount.compareTo(BigDecimal.ZERO)==0){
break;
else{
minRuleAmt=edCodeAmount.multiply(rec.getMinPercent());
maxRuleAmt=edCodeAmount.multiply(rec.getMaxPercent());
String
minRuleAmtRoundOff=MyADFUtils.roundValueBy2(minRuleAmt.doubleVal
ue());
String
maxRuleAmtRoundOff=MyADFUtils.roundValueBy2(maxRuleAmt.doubleVal
ue());
maxRuleAmt=new BigDecimal(maxRuleAmtRoundOff);
minRuleAmt=new BigDecimal(minRuleAmtRoundOff);
if(enteredAmount.compareTo(minRuleAmt)<0 ||
enteredAmount.compareTo(maxRuleAmt)>0
break;
rec.getEdCode().toString().equals(edCode)){
minRuleAmt=rec.getMinAmount();
maxRuleAmt=rec.getMaxAmount();
if(enteredAmount.compareTo(minRuleAmt)<0 ||
enteredAmount.compareTo(maxRuleAmt)>0
break;
return msg;
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("CTCEarning1Iterator");
Row row=vo.getCurrentRow();
CTCEarningVORowImpl erow=(CTCEarningVORowImpl)row;
String msg=this.checkCTCEDCodeValue(erow.getEdCode(),
enteredAmount);
erow.setAmount(null);
this.getEmpCTCEarningAmoutInputRC().setValue(null);
MyADFUtils.refreshComponent(this.getEmpCTCEarningAmoutInputRC());
MyADFUtils.showErrorMessage(msg);
return;
}else{
return;
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("CTCEmpDeduction1Iterator");
Row row=vo.getCurrentRow();
CTCEmpDeductionVORowImpl
erow=(CTCEmpDeductionVORowImpl)row;
String msg=this.checkCTCEDCodeValue(erow.getEdCode(),
enteredAmount);
erow.setAmount(null);
this.getEmpCTCAmoutInputRC().setValue(null);
MyADFUtils.refreshComponent(this.getEmpCTCAmoutInputRC());
MyADFUtils.showErrorMessage(msg);
return;
}else{
return;
this.empCTCAmoutInputRC = empCTCAmoutInputRC;
return empCTCAmoutInputRC;
this.empCTCEarningAmoutInputRC = empCTCEarningAmoutInputRC;
return empCTCEarningAmoutInputRC;
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("CTCEarning1Iterator");
Row row=vo.getCurrentRow();
CTCEarningVORowImpl erow=(CTCEarningVORowImpl)row;
enteredAmount=erow.getAmount();
String msg=this.checkCTCEDCodeValue(erow.getEdCode(),
enteredAmount);
this.ctcEmpIDQueryLOVRC = ctcEmpIDQueryLOVRC;
return ctcEmpIDQueryLOVRC;
/**
* Check the total CTC entered by user is correct or not by validating it with
* @return
*/
boolean flag=false;
BigDecimal
monthlyCTC=null,grossAndEmployerDeduction=BigDecimal.ZERO;
ViewObject earningVO=null,deductionVo=null;
if(this.getEmpCTCInputRC().getValue() != null){
monthlyCTC=new BigDecimal(this.getEmpCTCInputRC()
.getValue()
.toString());
String
mctcRoundOff=MyADFUtils.roundValueBy2(monthlyCTC.doubleValue()/12);
System.out.println("Monthly CTC--->"+monthlyCTC);
earningVO=MyADFUtils.getViewObjectFromIterator("CTCEarning1Iterator");
deductionVo=MyADFUtils.getViewObjectFromIterator("CTCEmpDeduction1I
terator");
RowSetIterator earIterator=earningVO.createRowSetIterator(null);
RowSetIterator dedIterator=deductionVo.createRowSetIterator(null);
while(earIterator.hasNext()){
Row row=earIterator.next();
grossAndEmployerDeduction=grossAndEmployerDeduction.add(amount);
earIterator.closeRowSetIterator();
while(dedIterator.hasNext()){
Row row=dedIterator.next();
row.getAttribute("EdCode").equals("D0002")){
grossAndEmployerDeduction=grossAndEmployerDeduction.add(amount);
dedIterator.closeRowSetIterator();
System.out.println("Entered CTC---
>"+grossAndEmployerDeduction.toString());
if(grossAndEmployerDeduction.compareTo(monthlyCTC)>0){
flag=true;
return flag;
MyADFUtils.putInPageFlowScope("ctc_emp_id",
valueChangeEvent.getNewValue());
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("PayEmpDtl1Iterator");
vo.executeQuery();
MyADFUtils.refreshComponent(this.getCtcPayChangeEmpInfoForm());
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("CTCPayChange1Iterator");
RowSetIterator rsi=vo.createRowSetIterator(null);
boolean flag=false;
try {
if (rsi != null) {
while (rsi.hasNext()) {
validatePayChangeEntry(row);
if(!flag)
flag=true;
rsi.closeRowSetIterator();
if (flag) {
MyADFUtils.executeOperation("Commit");
MyADFUtils.showPopup(this.getSuccessMsgPopup());
MyADFUtils.showErrorMessage(hrmse.toString());
this.ctcPayChangeEmpInfoForm = ctcPayChangeEmpInfoForm;
return ctcPayChangeEmpInfoForm;
MyADFUtils.setAttributeInIterator("CTCPayChange1Iterator",
"PayPeriod", payPeriod);
MyADFUtils.setAttributeInIterator("CTCPayChange1Iterator",
"EmployeeId", empId);
/**
* This method will validate the PayChange Form FromDate and ToDate
entry
* @param payRollPeriod
*/
Timestamp fromDt,
Timestamp toDt){
boolean validationStatus=false;
.parseCaseInsensitive()
.appendPattern("dd-MMM-yyyy")
.toFormatter(Locale.ENGLISH);
String monthYear=d1.getMonth()+"-"+d1.getYear();
//Validate fromDate
if(fromDt != null){
if(monthYear.equalsIgnoreCase(fromDt.toLocalDateTime().getMonth()+"-"+
fromDt.toLocalDateTime().getYear())){
validationStatus=true;
//Validate toDate
if(toDt != null){
if(monthYear.equalsIgnoreCase(toDt.toLocalDateTime().getMonth()+"-
"
+toDt.toLocalDateTime().getYear())){
validationStatus=true;
return validationStatus;
if(amount != null){
if(amount.compareTo(BigDecimal.ZERO)<=0){
try {
} catch (HRMSException e) {
MyADFUtils.setAttributeInIterator("CTCPayChange1Iterator",
"Amount", null);
if(empId != null){
MyADFUtils.executeOperation("CreateInsert");
}else{
/**
*This method will validate all the mandatory fields of Paychange entry form
* @param row
* @throws HRMSException
*/
if(!status){
//Validate To Date
if(!status){
//Validate Amount
if(amount != null){
if(amount.compareTo(BigDecimal.ZERO)<=0){
String p_period=valueChangeEvent.getNewValue().toString();
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("PayProcessMaster1Iterator");
if(vo != null){
MyADFUtils.putInPageFlowScope("pay_period", p_period);
vo.setNamedWhereClauseParam("p_period", p_period);
vo.executeQuery();
this.payrollProcessPeriodRC = payrollProcessPeriodRC;
return payrollProcessPeriodRC;
this.payrollProcessTypeRC = payrollProcessTypeRC;
return payrollProcessTypeRC;
String payrollPeriod=null,processType=null;
if(dialogEvent.getOutcome()== DialogEvent.Outcome.ok){
if(MyADFUtils.getViewObjectFromIterator("PeriodOpenLov1Iterator")
!= null){
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("PeriodOpenLov1Iterator");
payrollPeriod = (String)
vo.getCurrentRow().getAttribute("AttendancePeriod");
MyADFUtils.putInPageFlowScope("pay_period", payrollPeriod);
System.out.println("processType : "+processType);
if(processType.equals("Final-Process")){
MyADFUtils.showPopup(this.getFinalProcessConfirmationPopup());
}else{
try {
startPayrollProcess(payrollPeriod, processType);
executePayMaster(payrollPeriod);
} catch (HRMSException e) {
MyADFUtils.showErrorMessage(e.toString());
return;
}else{
return;
this.finalProcessConfirmationPopup = finalProcessConfirmationPopup;
return finalProcessConfirmationPopup;
String payrollPeriod=null;
if(dialogEvent.getOutcome()==DialogEvent.Outcome.ok){
if(MyADFUtils.getViewObjectFromIterator("PeriodOpenLov1Iterator")
!= null){
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("PeriodOpenLov1Iterator");
payrollPeriod = (String)
vo.getCurrentRow().getAttribute("AttendancePeriod");
try {
startPayrollProcess(payrollPeriod, "Final-Process");
executePayMaster(payrollPeriod);
} catch (HRMSException e) {
MyADFUtils.showErrorMessage(e.toString());
return;
/**
*This method invoke the Database pacakage procedure that will validate all
the
* process and return successfull message else rollback the process with error
* message.
*/
String processMsg=null;
String processFlag=null;
Connection con=null;
CallableStatement cstmt=null;
try{
con=ConnectionManager.getConnection();
cstmt=con.prepareCall(plsqlCall);
cstmt.setString(2, payrollPeriod);
cstmt.setString(3, processType);
cstmt.registerOutParameter(4, Types.VARCHAR);
cstmt.registerOutParameter(1, Types.VARCHAR);
cstmt.execute();
processFlag=cstmt.getString(1);
processMsg=cstmt.getString(4);
}catch(SQLException se){
se.printStackTrace();
MyADFUtils.showErrorMessage(se.getMessage());
}catch(Exception e){
e.printStackTrace();
MyADFUtils.showErrorMessage(e.getMessage());
}finally{
MyADFUtils.close(cstmt);
ConnectionManager.releaseConnetion(con);
System.out.println("processMsg : "+processMsg);
if(processFlag.equals("TRUE")){
this.setSuccessMsgTxt(processMsg);
MyADFUtils.showPopup(this.getSuccessMsgPopup());
}else{
ViewObject
vo=MyADFUtils.getViewObjectFromIterator("PayProcessMaster1Iterator");
if(vo != null){
vo.setNamedWhereClauseParam("p_period", period);
vo.executeQuery();
this.reportName = reportName;
return reportName;
this.setReportName("Pay_process_detail");
return "print_report";
package hrms.view.reports;
import java.io.OutputStream;
import java.sql.Connection;
import java.util.HashMap;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRParameter;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.view.JasperViewer;
JasperReport jasperReport;
JasperPrint jasperPrint;
JasperViewer jasperViewer;
DataSource ds = null;
String url =
FacesContext.getCurrentInstance().getExternalContext().getRealPath("/reports/"
).toString().trim();
JRParameter[] param;
public JasperService() {
super();
try {
ds = (DataSource) ctx.lookup("HRMSDS");
//this is the data source name used from the WebLogic server
con = ds.getConnection();
} catch (Exception e) {
e.printStackTrace();
return con;
if (con != null) {
try {
con.close();
} catch (Exception e) {
e.printStackTrace();
param = jasperReport.getParameters();
} catch (JRException e) {
e.printStackTrace();
return param;
try {
int index = 0;
if (reportInputControlsValues != null) {
if (filteredParam.isForPrompting() &&
!filteredParam.isSystemDefined()) {
parameters.put(filteredParam.getName(),
reportInputControlsValues[index]);
++index;
System.out.println("Done!");
} catch (Exception e) {
e.printStackTrace();
} finally {
System.out.println("closing connection");
close(con);
try {
int index = 0;
if (reportInputControlsValues != null) {
if (filteredParam.isForPrompting() &&
!filteredParam.isSystemDefined()) {
parameters.put(filteredParam.getName(),
reportInputControlsValues[index]);
++index;
JasperExportManager.exportReportToPdfStream(jasperPrint,
outputStream);
System.out.println("Done!");
} catch (Exception e) {
e.printStackTrace();
} finally {
System.out.println("closing connection");
close(con);
try {
JasperExportManager.exportReportToPdfStream(jasperPrint,
outputStream);
System.out.println("Done!");
} catch (Exception e) {
e.printStackTrace();
} finally {
System.out.println("closing connection");
close(con);
this.url = url;
return url;
package hrms.view.bean;
import hrms.view.reports.JasperService;
import hrms.view.util.MyADFUtils;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
import javax.faces.context.FacesContext;
import net.sf.jasperreports.engine.JRParameter;
import oracle.jbo.Row;
import oracle.jbo.RowSetIterator;
import oracle.jbo.ViewObject;
public HRMSReportBean() {
/**
* Execute the Report Master and Details VO to display the Report Param in the
form.
*/
reportName = (String)
MyADFUtils.getFromPageFlowScope("p_report_xml_name");
if(reportName != null){
getReportMasterVO().setNamedWhereClauseParam("p_report_xml_name",
reportName);
getReportMasterVO().executeQuery();
ViewObject vo=MyADFUtils.getViewObjectByName("ReportMaster1");
return vo;
ViewObject vo=MyADFUtils.getViewObjectByName("ReportDetail1");
return vo;
this.reportPath = reportPath;
return reportPath;
this.jasperService = jasperService;
return jasperService;
this.reportName = reportName;
return reportName;
this.reportValues = reportValues;
return reportValues;
/**
* This method set the total parameters of the report in the HashMap object
* @return
*/
if (filteredParam.isForPrompting() &&
!filteredParam.isSystemDefined()) {
reportValues.put(filteredParam.getName(), null);
/**
* This method set the report parameters input values entered by user in the
Param Form
*/
ViewObject vo=getReportDetailVO();
if(vo!= null){
RowSetIterator iter=vo.createRowSetIterator(null);
while(iter.hasNext()){
Row row=iter.next();
if(row.getAttribute("paramInputValue") != null){
if(reportValues.containsKey(reportParameter)){
reportValues.put(reportParameter, paramValues);
iter.closeRowSetIterator();
}else{
if(addInputControls()){
setReportParamValues();
jasperService.runJasperPDF2(getReportNameFromPFScope(),
reportValues, outputStream);
return (String)
MyADFUtils.getFromPageFlowScope("p_report_xml_name");
Efficiency of any system is concern with the proper use of scare recourses by
the system. The need of efficiency arises due to cost considerations. If some
resources are scarce and expensive, it is desirable that those resources be used
efficiency are processor time and memory. An efficient system is concern with
less CPU interaction and less memory. It is important to make my software as a
quick and intelligent to solve the desire purpose with in some fraction of
second. Code efficiency means that especially code that is executed often with
in tight loop.
The said criteria are not nor may independent and increase of one have
unfavorable for another.
A code should be design clearly that can be verifiable, complete (implements all
the specification) and traceable (all design elements can be traced to some
requirements).
A system is said to be error free system if it’s run without any type of
disturbance. To develop error free system, we have to handle the error’s which
can be occur when the program is running.
Error could be due to business logic validation failed or any other system error.
We should display the proper error message to the user so that user can work
with the system happily.
If the system is not having any validation there is a chance of corrupted data can
be saved in our database, which make no sense of having the data with the
system.
It will accept the data only when it’s passes through the validation successfully.
Chapter 6: Testing
6.1 Testing techniques and Testing strategies used
This phase determines the error in the project. If there is any error then it must
be removed before delivery of the project.
Unit Testing: - Unit testing focuses verification effort on the smallest unit of
software design – the module. Using the detail design description as a guide,
important control paths are tested to uncover errors within the boundary of the
module. The relative complexity of tests and the errors detected as a result is
limited by the constrained scope established for unit testing. The unit test is
always white box oriented, and the step can be conducted in parallel for
multiple modules.
Unit testing is normally considered an adjunct to the coding step. After source
level code has been developed, reviewed, and verified for correct syntax, unit
test case design begins.
There are many types of system tests that are worthwhile for software-based
systems: -
Stress tests – Stress tests are designed to confront programs with abnormal
situations.
• User Data Input Testing: In this testing some invalid input values
are entered and tested to make sure the system should accept only
valid entries.
A test case is a set of conditions or variables under which a tester will determine
whether an application, software system or one of its features is working as it
was originally designed for it to do.
Below are the tables which shows the testing results of some important
components of our application.
Login:
Test Case Test Test Case Pre- Test Steps Test Data Expected Actual Status
ID Scenario Condition Result Result Pass/Fail
TC_Login_1 Verify Enter valid Need a valid 1. Enter Valid user Successful Successful Pass
Login user Id and user Id and user Id id and login, login,
password password to 2. Enter Valid home page home page
do login Password password of of
3. Click application application
Login should displayed
display
TC_Login_2 Verify Enter valid Need a valid 1. Enter Valid user No No Pass
Login user Id and user Id and user Id id Matched Matched
invalid password to 2. Enter Invalid User id/ User id/
password do login Password Password Password Password
3. Click
Login
TC_Login_3 Verify Enter Need a valid 1. Enter Invalid No No Pass
Login Invalid user user id and user id user id Matched Matched
id and valid password to 2. Enter and User id/ User id/
password do login Password Valid Password Password
3. Click Password
Login
TC_Login_4 Verify Enter Need a valid 1. Enter Invalid No No Pass
Login Invalid user user id and username user id Matched Matched
id and password to 2. Enter and User id/ User id/
invalid do login Password Invalid Password Password
password 3. Click Password
Login
Employee Master
Test Case Test Test Case Pre- Test Steps Test Data Expected Actual Status
ID Scenario Condition Result Result Pass/Fail
TC_EMP_1 Validate Enter all Need Enter all Employee Successfully Successfully Pass
mandatory the Employee the First Employee Employee
fields on mandatory details to mandatory name, added to the added to the
Save fields enter fields in Last employee employee
button marked as values in the form name, master master
star the and click Date of database database
symbol mandatory on Save birth,
and click fields button Email,
on Save Joining
button date
TC_EMP_2 Validate Skip some Need Enter all Skip some Please enter Please enter Pass
mandatory of the Employee the of the all the all the
fields on mandatory details to mandatory mandatory mandatory mandatory
Save fields to enter fields in fields to fields and fields and
button enter values in the form enter then click then click
the and click on Save on Save
mandatory on Save button button
fields button
Payroll Process
Test Case ID Test Test Case Pre- Test Steps Test Data Expected Actual Status
Scenario Condition Result Result Pass/Fail
TC_PAY_1 Validate Select Need to Select Employee Attendance Attendance Pass
Payroll Payroll have Payroll Attendance and CTC and CTC
Process Period and employee’s period and and CTC not found, not found,
without Process attendance process should cannot do cannot do
having Type and their type and miss in the the Payroll the Payroll
attendance CTC in the click on database Process Process
and CTC database payroll
for the process
employees button
in a pay
month
TC_PAY_2 Validate Select Need to Select Employee Payroll Payroll Pass
Payroll Payroll have Payroll Attendance process process
Process Period and employee’s period and and CTC done done
having Process attendance process should successfully successfully
attendance Type and their type and available
and CTC CTC in the click on in the
for the database payroll database
employees process
in a pay button
month
TC_PAY_3 Check Select Payroll Select Payroll Payroll Payroll Pass
Payroll Payroll period Payroll Period in period is period is not
Period Period and should period and database not open; open; hence
before Process open in the process hence process
Payroll Type system type and process cannot be
process click on cannot be done
begin payroll done
process
button
Below are the roles which assigned to user to manipulate or query the database.
• Admin: This role is assigned to the user who is admin for the application.
Admin user can access any module of the system. Developer of this
system also comes under this role.
• User: User role is created to provide the access of the application based
on modules of the system. Example: A user can have access of any one
module or two modules or all modules.
Admin role users only have direct access to database because it is a database
user having all access for creating and maintaining the database. They can
create, alter or drop any object in the database. They can also manipulate any
table data in the database.
User role users are created and stored in a Security Table. This type of users
are not database users. Security table contains user details based on access to
the system modules. A user can access the system based on the details
defined in this table.
Chapter 8: Reports
Some of the important reports are listed below with their parameter form and
their output.
8.1.1 Employee Details Report [Parameters Input Page]
Further we can enhance the existing modules after the use of modules regularly.
We can develop more reports as required by users in future after using the
system.
We can add some functionality to catch the employee activity with the system
as a history record that can help to the organization in future if something is
deleted from the system.
Based on the future security issued, security can be improved using emerging
technologies.
Bibliography
The following reference has been used to develop the project “Human Resource
Management System”: -
Books: -
Web Source: -
▪ www.google.co.in
▪ www.oracle.com
▪ www.tutorialspoint.com