using System;
|
using System.Data;
|
using System.Configuration;
|
using System.Web;
|
using System.Web.Security;
|
using System.Web.UI;
|
using System.Web.UI.HtmlControls;
|
using System.Web.UI.WebControls;
|
using System.Web.UI.WebControls.WebParts;
|
|
using System.Data.OracleClient;
|
|
namespace CCSTrace.CCS.Object
|
{
|
public class LocateEquipment
|
{
|
private int CaseID = 0;
|
private int DSUfid = -1;
|
private int Fsc = 0;
|
private int Ufid = 0;
|
private String FDR = "";
|
private String TPCLID = "";
|
|
public LocateEquipment(int m_CaseID, bool hasData,OracleConnection _Conn, OracleTransaction _Transaction)
|
{
|
String SqlStmt;
|
OracleCommand Command = null;
|
OracleDataReader reader = null;
|
|
this.setCaseID(m_CaseID);
|
|
try
|
{
|
if (hasData)
|
{
|
SqlStmt = "SELECT DSUFID,FSC,UFID,FDR,TPCLID FROM EOS.EVENTRECORD_EX WHERE CASEID = " + m_CaseID;
|
|
Command = new OracleCommand(SqlStmt, _Conn, _Transaction);
|
reader = Command.ExecuteReader();
|
|
if (reader.Read())
|
{
|
this.setDSUFID(Convert.ToInt32(reader["DSUFID"].ToString()));
|
this.setFSC(Convert.ToInt32(reader["FSC"].ToString()));
|
this.setUFID(Convert.ToInt32(reader["UFID"].ToString()));
|
this.setFDR(reader["FDR"].ToString());
|
this.setTPCLID(reader["TPCLID"].ToString());
|
}
|
|
|
}
|
else
|
{
|
SqlStmt = "SELECT UFID FROM EOS.DISASTER_EX WHERE ISDISASTER = " + CCS.LocalVariable.isDisaster;
|
|
Command = new OracleCommand(SqlStmt, _Conn, _Transaction);
|
reader = Command.ExecuteReader();
|
|
if (reader.Read())
|
this.setDSUFID(Convert.ToInt32(reader["UFID"].ToString()));
|
}
|
|
}
|
catch (Exception e)
|
{
|
Console.WriteLine(e.Message);
|
Console.WriteLine(e.StackTrace);
|
}
|
finally
|
{
|
reader.Close();
|
Command.Dispose();
|
}
|
}
|
|
public int getCaseID()
|
{
|
return this.CaseID;
|
}
|
|
public void setCaseID(int m_CaseID)
|
{
|
this.CaseID = m_CaseID;
|
}
|
|
public int getDSUFID()
|
{
|
return this.DSUfid;
|
}
|
|
public void setDSUFID(int m_DSUfid)
|
{
|
this.DSUfid = m_DSUfid;
|
}
|
|
public int getFSC()
|
{
|
return this.Fsc;
|
}
|
|
public void setFSC(int m_FSC)
|
{
|
this.Fsc = m_FSC;
|
}
|
|
public int getUFID()
|
{
|
return this.Ufid;
|
}
|
|
public void setUFID(int m_UFID)
|
{
|
this.Ufid = m_UFID;
|
}
|
|
public String getFDR()
|
{
|
return this.FDR;
|
}
|
|
public void setFDR(String m_FDR)
|
{
|
this.FDR = m_FDR;
|
}
|
|
public String getTPCLID()
|
{
|
return this.TPCLID;
|
}
|
|
public void setTPCLID(String m_TPCLID)
|
{
|
this.TPCLID = m_TPCLID;
|
}
|
|
public String getSqlStmt()
|
{
|
String SqlStmt;
|
|
SqlStmt = "INSERT INTO EOS.EVENTRECORD_EX (CASEID,DSUFID,FSC,UFID,TPCLID,FDR) VALUES(" + getCaseID() + "," + getDSUFID() + "," + getFSC()
|
+ "," + getUFID() + ",'" + getTPCLID() + "','" + getFDR() + "')";
|
return SqlStmt;
|
}
|
|
//public String getUpdateSqlStmt()
|
//{
|
// String SqlStmt;
|
|
// SqlStmt = "UPDATE EOS.EVENTRECORD_EX SET DSUFID = " + getDSUFID() + ",FSC = " + getFSC() + ",UFID = " + getUFID() + ",TPCLID = '"
|
// + getTPCLID() + "',FDR = '" + getFDR() + "' WHERE CASEID = " + getCaseID();
|
|
// return SqlStmt;
|
//}
|
}
|
}
|