Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions testfolder/src/main/java/actionClass/Admin_AddEmp_Action.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package actionClass;

import actionForm.Emp_Login;
import actionForm.Admin_AddEmp;
import daoImpl.Admin_AddEmp_DaoImpl;

import com.opensymphony.xwork2.ActionSupport;

/**
* @author VS60001724
*
*/
public class Admin_AddEmp_Action extends ActionSupport {

private static final long serialVersionUID = -3593298137246621798L;
public Emp_Login adds;
public Admin_AddEmp add;
public Admin_AddEmp_DaoImpl xyz = new Admin_AddEmp_DaoImpl();

/**
* @return Admin add Employee
*/
public String addEmp() {

xyz.addEmp(add);
return SUCCESS;
}

/**
* @return Admin add empolyee
*/
public String addEmps() {

xyz.addEmps(adds);
addActionMessage("Done");
return SUCCESS;
}

public Emp_Login getAdds() {
return adds;
}

public void setAdds(Emp_Login adds) {
this.adds = adds;
}

public Admin_AddEmp getAdd() {
return add;
}

public void setAdd(Admin_AddEmp add) {
this.add = add;
}

public Admin_AddEmp_DaoImpl getXyz() {
return xyz;
}

public void setXyz(Admin_AddEmp_DaoImpl xyz) {
this.xyz = xyz;
}

}
58 changes: 58 additions & 0 deletions testfolder/src/main/java/actionClass/Admin_ClientChPW_Action.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package actionClass;

import actionForm.Admin_ClientChPW;
import com.opensymphony.xwork2.ActionSupport;

import daoImpl.Admin_ClientChPW_DaoImpl;

public class Admin_ClientChPW_Action extends ActionSupport {

private static final long serialVersionUID = -7556338012932718768L;
private Admin_ClientChPW chpw;
private Admin_ClientChPW_DaoImpl xyz = new Admin_ClientChPW_DaoImpl();

/**
* @return Admin Change client passowrd
*/
public String changepw() {

String a = chpw.getNewpw();
String b = chpw.getCnewpw();
String c =chpw.getBank_id();
if(a.equals("") || b.equals("") ||c.equals(""))
{
addActionError("Please Enter All Values");
return ERROR;
}
else
{
if (a.equals(b)) {
String sa = chpw.getBank_id();
System.out.println("From Action" + sa);
xyz.changepw(chpw);
addActionMessage("You have changed Successfully password of Client:"+c);
return SUCCESS;
} else {
addActionError("Password Not matching");
return ERROR;
}
}
}

public Admin_ClientChPW getChpw() {
return chpw;
}

public void setChpw(Admin_ClientChPW chpw) {
this.chpw = chpw;
}

public Admin_ClientChPW_DaoImpl getXyz() {
return xyz;
}

public void setXyz(Admin_ClientChPW_DaoImpl xyz) {
this.xyz = xyz;
}

}
73 changes: 73 additions & 0 deletions testfolder/src/main/java/actionClass/Admin_EmpChPW_Action.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package actionClass;
import actionForm.Admin_EmpChPW;
import com.opensymphony.xwork2.ActionSupport;

import daoImpl.Admin_EmpChPW_DaoImpl;

/**
* @author VS60001724
*
*/
public class Admin_EmpChPW_Action extends ActionSupport{


private static final long serialVersionUID = -6018967805044463550L;
private Admin_EmpChPW chpw ;
private Admin_EmpChPW_DaoImpl xyz =new Admin_EmpChPW_DaoImpl();


/**
* @return Admin change Employee Password
*/
public String changepw()
{
String a = chpw.getNewpw();
String b = chpw.getCnewpw();
String c= chpw.getBank_id();
if(a.equals("") || b.equals("") ||c.equals(""))
{
addActionError("Please Enter All Values");
return ERROR;
}
else
{
if(a.equals(b))
{
xyz.changepw(chpw);
addActionMessage("You have changed Successfully password of Employee:"+c);
return SUCCESS;
}
else
{
addActionError("Password Not Matching");
return ERROR;
}
}
}


public Admin_EmpChPW getChpw() {
return chpw;
}


public void setChpw(Admin_EmpChPW chpw) {
this.chpw = chpw;
}


public Admin_EmpChPW_DaoImpl getXyz() {
return xyz;
}


public void setXyz(Admin_EmpChPW_DaoImpl xyz) {
this.xyz = xyz;
}






}
178 changes: 178 additions & 0 deletions testfolder/src/main/java/actionClass/Admin_Login_Action.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
package actionClass;

import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import actionForm.Admin_Login;

import daoImpl.Admin_Login_DaoImpl;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class Admin_Login_Action extends ActionSupport implements ModelDriven<Object>,
SessionAware {

private Map<String, Object> session;

public void setSession(Map<String, Object> session) {
this.session = session;
}

private static final long serialVersionUID = -8971757688097732500L;
private Admin_Login login = null;
private Admin_Login chpw;

private Admin_Login_DaoImpl loginDAO = new Admin_Login_DaoImpl();
private Admin_Login_DaoImpl xyz = new Admin_Login_DaoImpl();

@Override
public String execute() {

return SUCCESS;

}

public String checkLogin() {

if (login.getUserName().equals("") || login.getPassword().equals("") || login.getBank_id().equals("")) {
addActionError("Please enter all values");

return ERROR;

} else {

login = loginDAO.checkLogin(login);

if (null != login.getBank_id()) {

String uname = login.getUserName();
String other = login.getBank_id();

session.put("user", "admin");
session.put("user0", uname);
session.put("user1", other);




return SUCCESS;

} else {

addActionError("Invalid Admin id/password/ Admin Id");

return ERROR;

}

}

}
public String changepw()

{
String a = chpw.getOldpw();
String b = chpw.getNewpw();
String c = chpw.getCnewpw();
if(a.equals("") || b.equals("") ||c.equals(""))
{
addActionError("Please Enter All Values");
return ERROR;
}
else
{
System.out.println(a);
System.out.println(b);
System.out.println(c);

if (b.equals(c))
{

xyz.changepw(chpw);

String ss = chpw.getTest();

System.out.println("From Action Class: " + ss);
if (chpw.getTest() == "not")
{
addActionError("Old Password not matching ");
return ERROR;

}
if(chpw.getTest() == "good")
{
addActionError("Password changed Successfully. Account will be Logout");
}

}
else
{
addActionError("Password not matching");
return ERROR;
}
return SUCCESS;
}
}

public String logout() throws Exception {

ActionContext context = ActionContext.getContext();
Map<String, Object> session = context.getSession();
session.remove("user");
session.remove("user0");
session.remove("user1");
session.remove("user2");
return SUCCESS;
}


public Admin_Login getChpw() {
return chpw;
}

public void setChpw(Admin_Login chpw) {
this.chpw = chpw;
}

public Admin_Login_DaoImpl getLoginDAO() {
return loginDAO;
}

public void setLoginDAO(Admin_Login_DaoImpl loginDAO) {
this.loginDAO = loginDAO;
}

public Admin_Login_DaoImpl getXyz() {
return xyz;
}

public void setXyz(Admin_Login_DaoImpl xyz) {
this.xyz = xyz;
}

public Object getModel() {

login = new Admin_Login();

return login;

}

public Admin_Login getLogin() {

return login;

}


public void setLogin(Admin_Login login) {

this.login = login;

}


}
Loading