本文整理汇总了C#中Data.setError方法的典型用法代码示例。如果您正苦于以下问题:C# Data.setError方法的具体用法?C# Data.setError怎么用?C# Data.setError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data.setError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: processTransaction
private int processTransaction(String connectionString, String cus_no, String pwd, Data.Dber dberr)
{
Cp_Txnm tx = new Cp_Txnm(connectionString, TXID, dberr);
// Check if TXNM fetch for transaction type "010" is successful. Return if error encountered
if (dberr.ifError())
{
result = dberr.getErrorDesc(connectionString);
return -1;
}
if(Validation.employeeInitiatedTxn(connectionString, cus_no) == 0)
{
Cp_Empm cpEmpm = new Cp_Empm(connectionString, cus_no, dberr);
if(dberr.ifError())
{
resultP = dberr.getErrorDesc(connectionString);
return -1;
}
if(cpEmpm.empmP.emp_pvg == 5)
{
dberr.setError(Mnemonics.DbErrorCodes.TXERR_ADMIN_PWD_NOCHANGE);
resultP = dberr.getErrorDesc(connectionString);
return -1;
}
if(!Data.EmpmD.UpdatePassword(connectionString, cus_no, pwd, dberr))
{
resultP = dberr.getErrorDesc(connectionString);
return -1;
}
resultP = "Password Changed successfully!";
return 0;
}
Cp_Cstm cstm = new Cp_Cstm(connectionString, cus_no, dberr);
if (cstm.cstmP != null)
cstm.updatePassword(connectionString, cus_no, pwd, dberr);
if (dberr.ifError())
{
dberr = new Data.Dber();
if(!Data.EmpmD.UpdatePassword(connectionString, cus_no, pwd, dberr))
{
dberr.setError(Mnemonics.DbErrorCodes.TXERR_PWD_NOUPDATE);
resultP = dberr.getErrorDesc(connectionString);
return -1;
}
}
//------------------------------
//Entity.Cstm cstm = Data.CstmD.Read(connectionString, acct.actmP.cs_no1, dberr);
String mailResponse = "";
if (!Security.OTPUtility.SendMail("SBS", "[email protected]",
cstm.cstmP.cs_fname + cstm.cstmP.cs_mname + cstm.cstmP.cs_lname, cstm.cstmP.cs_email,
"Update from SBS", "Password updated via transaction: "+ tx.txnmP.tran_desc))
{
mailResponse = "Mail sent.";
}
//-------------------------------
resultP = "Password Changed successfully!" + mailResponse;
//resultP = "Password Updated Successfully!";
return 0;
}
示例2: verifyInitPrivilege
public Boolean verifyInitPrivilege(Data.Dber dberr)
{
if(tx_pvga > ac_pvga)
{
dberr.setError(Mnemonics.DbErrorCodes.TXERR_INIT_PVG);
return false;
}
//Entity.Pendtxn pending = new Entity.Pendtxn();
//Data.PendtxnD.Create(connectionString, pending);
return true; // remove later
}
示例3: Create
public static int Create(string connectionString, Pendtxn dataObject, Data.Dber dberr)
{
try
{
var query = string.Format(@"INSERT INTO [SBS].[dbo].[PENDTXN]
(
[TRAN_DATE]
,[AC_NO]
, [AC_NO2]
,[TRAN_PVGB]
,[INIT_EMPID]
,[INIT_CSNO]
,[DR_AMT]
,[CR_AMT]
, [TRAN_ID]
, [TRAN_DESC]
, [TRAN_DATA])
OUTPUT INSERTED.REF_NO
VALUES
('{0}' ,{1}, {2}, '{3}' , {4} , {5} ,'{6}', '{7}', {8}, '{9}', '{10}')",
dataObject.tran_date,
dataObject.ac_no == "0" ? "null" : dataObject.ac_no,
dataObject.ac_no2 == "0" ? "null" : dataObject.ac_no2,
dataObject.tran_pvgb,
dataObject.init_empid == "0" ? "null" : dataObject.init_empid,
dataObject.init_csno == "0" ? "null" : dataObject.init_csno,
dataObject.dr_amt,
dataObject.cr_amt,
dataObject.tran_id ,
dataObject.tran_desc,
dataObject.tran_data);
return (int)DbAccess.ExecuteScalar(connectionString, CommandType.Text, query);
}
catch
{
dberr.setError(Mnemonics.DbErrorCodes.DBERR_PENDTXN_NOWRITE);
return -1;
}
}