📄 itrequestcontroller.java
字号:
}
}catch(SQLException e)
{
//return null;
}
return array;
}
public ArrayList getRequestByRequestor(String name)
{
ArrayList array=new ArrayList();
try
{
String selectSql="select * from request where user_name = '"+name.trim()+"'";
ResultSet rs=wearnesDB.select(selectSql);
while (rs.next())
{
request=new ITRequest(
rs.getString("user_name"),
rs.getString("req_date"),
rs.getString("company"),
rs.getString("department"),
rs.getString("category"),
rs.getString("item"),
rs.getString("description"),
rs.getString("impact"),
rs.getString("process_status"),
rs.getString("expected_completion_date")
);
request.setReq_id(rs.getInt("req_id"));
array.add(request);
}
}catch(SQLException e)
{
//return null;
}
return array;
}
public ArrayList getRequestByCategory(String name)
{
ArrayList array=new ArrayList();
try
{
String selectSql="select * from request where category = '"+name.trim()+"'";
ResultSet rs=wearnesDB.select(selectSql);
while (rs.next())
{
request=new ITRequest(
rs.getString("user_name"),
rs.getString("req_date"),
rs.getString("company"),
rs.getString("department"),
rs.getString("category"),
rs.getString("item"),
rs.getString("description"),
rs.getString("impact"),
rs.getString("process_status"),
rs.getString("expected_completion_date")
);
request.setReq_id(rs.getInt("req_id"));
array.add(request);
}
}catch(SQLException e)
{
// return null;
}
return array;
}
public ArrayList getRequestByStatus(String s)
{
ArrayList array=new ArrayList();
try
{
String selectSql="select * from request where process_status = '"+s.trim()+"'";
ResultSet rs=wearnesDB.select(selectSql);
while (rs.next())
{
request=new ITRequest(
rs.getString("user_name"),
rs.getString("req_date"),
rs.getString("company"),
rs.getString("department"),
rs.getString("category"),
rs.getString("item"),
rs.getString("description"),
rs.getString("impact"),
rs.getString("process_status"),
rs.getString("expected_completion_date")
);
request.setReq_id(rs.getInt("req_id"));
array.add(request);
}
}catch(SQLException e)
{
//return null;
}
return array;
}
public ArrayList getRequestByCompany(String c)
{
ArrayList array=new ArrayList();
try
{
String selectSql="select * from request where company = '"+c.trim()+"'";
ResultSet rs=wearnesDB.select(selectSql);
while (rs.next())
{
request=new ITRequest(
rs.getString("user_name"),
rs.getString("req_date"),
rs.getString("company"),
rs.getString("department"),
rs.getString("category"),
rs.getString("item"),
rs.getString("description"),
rs.getString("impact"),
rs.getString("process_status"),
rs.getString("expected_completion_date")
);
request.setReq_id(rs.getInt("req_id"));
array.add(request);
}
}catch(SQLException e)
{
//return null;
}
return array;
}
public ArrayList getAllRequest()
{
ArrayList array=new ArrayList();
try
{
String selectSql="select * from request order by req_id desc";
ResultSet rs=wearnesDB.select(selectSql);
while (rs.next())
{
request=new ITRequest(
rs.getString("user_name"),
rs.getString("req_date"),
rs.getString("company"),
rs.getString("department"),
rs.getString("category"),
rs.getString("item"),
rs.getString("description"),
rs.getString("impact"),
rs.getString("process_status"),
rs.getString("expected_completion_date")
);
request.setReq_id(rs.getInt("req_id"));
array.add(request);
}
}catch(SQLException e)
{
//return null;
}
return array;
}
public void itReceivedRequest(String name,String date,String solution,String cost)
{
}
public void userManagerApprove(String name,String date,String yes)
{
}
public void ITGroupMgrApprove(String name,String date,String yes)
{
}
public void FCApprove(String name,String date,String yes)
{
}
public void ITCompleteRequest(String name,String date,String solution)
{
}
public void userSignOff(String name,String date,String yes)
{
}
private boolean loginActiveDirectory(String userName,String pwd)
{
return true;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -