itrequestcontroller.java
来自「provide a room booking system」· Java 代码 · 共 467 行 · 第 1/2 页
JAVA
467 行
}
}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 + =
减小字号Ctrl + -
显示快捷键?