using System;
|
|
using System.Data.OracleClient;
|
|
namespace CCSTrace.CCS.Object
|
{
|
public class NumberContrast
|
{
|
private string _ccsid;
|
private string _acceptNum;
|
private int _caseId;
|
|
public NumberContrast()
|
{
|
}
|
|
public void SetCcsid(string mCcsid)
|
{
|
_ccsid = mCcsid;
|
}
|
|
public string GetCcsid()
|
{
|
return _ccsid;
|
}
|
|
public void SetAcceptNum(string mAcceptNum)
|
{
|
_acceptNum = mAcceptNum;
|
}
|
|
public string GetAcceptNum()
|
{
|
return _acceptNum;
|
}
|
|
public void SetCaseId(int mCaseId)
|
{
|
_caseId = mCaseId;
|
}
|
|
public int GetCaseId()
|
{
|
return _caseId;
|
}
|
|
public bool Insert(OracleConnection conn, OracleTransaction transaction)
|
{
|
string sqlStmt;
|
|
if (!Check())
|
{
|
return false;
|
}
|
|
sqlStmt = "INSERT INTO CCS.NUM_CONTRAST (CCSID,ACCEPTNUM,CASEID) VALUES ('" + _ccsid + "','" + _acceptNum + "'," + _caseId + ")";
|
|
OracleCommand command = new OracleCommand(sqlStmt, conn, transaction);
|
|
if (command.ExecuteNonQuery() > 0)
|
{
|
command.Dispose();
|
return true;
|
}
|
|
command.Dispose();
|
return false;
|
}
|
|
public bool Update(OracleConnection conn, OracleTransaction transaction)
|
{
|
if (!Check())
|
{
|
return false;
|
}
|
string sqlStmt = "UPDATE CCS.NUM_CONTRAST SET ACCEPTNUM='" + _acceptNum + "',CASEID=" + _caseId + " WHERE CCSID='" + _ccsid + "'";
|
|
OracleCommand command = new OracleCommand(sqlStmt, conn, transaction);
|
|
if (command.ExecuteNonQuery() <= 0)
|
{
|
command.Dispose();
|
return false;
|
}
|
|
command.Dispose();
|
return true;
|
}
|
|
private bool Check()
|
{
|
if (_ccsid == null)
|
return false;
|
|
if (_acceptNum == null)
|
return false;
|
|
if (_caseId == 0)
|
return false;
|
|
return true;
|
}
|
}
|
}
|