本文整理汇总了C#中DBOperationsUtil.deleteRecord方法的典型用法代码示例。如果您正苦于以下问题:C# DBOperationsUtil.deleteRecord方法的具体用法?C# DBOperationsUtil.deleteRecord怎么用?C# DBOperationsUtil.deleteRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBOperationsUtil
的用法示例。
在下文中一共展示了DBOperationsUtil.deleteRecord方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: deleteResignedEmployee
//delete resigned employee from database
public TransactionResponse deleteResignedEmployee()
{
TransactionResponse response = new TransactionResponse();
try
{
IDictionary<string, object> argumentMap = new Dictionary<string, object>();
//task referance
argumentMap.Add("@UserId", employee.UserName);
//Pass Stored Procedure Name and parameter list.
DBOperationsUtil dbOperation = new DBOperationsUtil(DbAccessConstants.spDeleteEmployeeInfor, argumentMap);
bool isDeleteOk = dbOperation.deleteRecord();
//put the data on Transaction response
response.Data = isDeleteOk;
response.setSuccess(true);
//get delete status inside the TransactionResponse.
return response;
}
catch (SqlException ex)
{
response.setErrorCode(DBOperationErrorConstants.E_ERROR_WHILE_REMOVING_INACTIVE_EMPLOYEE);
response.setMessage(DBOperationErrorConstants.M_UNABLE_TO_REMOVING_INACTIVE_EMPLOYEE);
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setSuccess(false);
return response;
}
//CATCH ANY OTHER EXCEPTION, dont let user see any kind of unexpected error
catch (Exception ex)
{
//Write this exception to file for investigation of the issue later.
logException(ex);
response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_EVIL_ERROR);
response.setMessage(DBOperationErrorConstants.M_UNKNOWN_EVIL_ERROR);
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setSuccess(false);
return response;
}
}
示例2: deleteNotificationForRatingDonePhase1
public TransactionResponse deleteNotificationForRatingDonePhase1(MembershipUser currentUser)
{
TransactionResponse response = new TransactionResponse();
try
{
//get detail of the logged on user.
Employee employee = EmployeeManager.getLoggedOnUser((Guid)currentUser.ProviderUserKey);
if (employee == null)
{
return EmployeeManager.handleLoggedInUserCanNotBeIdentfied();
}
IDictionary<string, object> argumentMap = new Dictionary<string, object>();
//task referance
argumentMap.Add("@taskRef", vacancy.VacancyNo);
argumentMap.Add("@receiverEID", employee.EmpID);
argumentMap.Add("@destrictID", PageAccessManager.getDistrictID());
//Pass Stored Procedure Name and parameter list.
DBOperationsUtil dbOperation = new DBOperationsUtil(DbAccessConstants.spDeleteMailNotification, argumentMap);
bool isDeleteOk = dbOperation.deleteRecord();
//put the data on Transaction response
response.Data = isDeleteOk;
response.setSuccess(true);
//get delete status inside the TransactionResponse.
return response;
}
catch (SqlException ex)
{
response.setErrorCode(DBOperationErrorConstants.E_ERROR_WHILE_REMOVING_NOTIFICATION);
response.setMessage(DBOperationErrorConstants.M_UNABLE_TO_REMOVE_NOTIFICATION);
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setSuccess(false);
return response;
}
//CATCH ANY OTHER EXCEPTION, dont let user see any kind of unexpected error
catch (Exception ex)
{
//Write this exception to file for investigation of the issue later.
logException(ex);
response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_EVIL_ERROR);
response.setMessage(DBOperationErrorConstants.M_UNKNOWN_EVIL_ERROR);
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setSuccess(false);
return response;
}
}