本文整理汇总了C#中TransactionResponse类的典型用法代码示例。如果您正苦于以下问题:C# TransactionResponse类的具体用法?C# TransactionResponse怎么用?C# TransactionResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TransactionResponse类属于命名空间,在下文中一共展示了TransactionResponse类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: displayMessageToTheUser
private void displayMessageToTheUser(TransactionResponse response, bool noNotification)
{
if (noNotification)
{
InfoDIV.Visible = true;
lblInformationMsg.Text = "You have no notification sent to you";
return;
}
switch (response.getMessageType())
{
case TransactionResponse.SeverityLevel.SUCESS:
SucessDIV.Visible = true;
lblErrorMsg.Text = response.getMessage();
break;
case TransactionResponse.SeverityLevel.INFO:
InfoDIV.Visible = true;
lblInformationMsg.Text = response.getMessage();
break;
case TransactionResponse.SeverityLevel.WARNING:
WarnDIV.Visible = true;
lblWarningMsg.Text = response.getMessage() + response.getErrorCode() ;
break;
case TransactionResponse.SeverityLevel.ERROR:
ErroroDIV.Visible = true;
lblErrorMsg.Text = response.getMessage() + response.getErrorCode();
break;
}
}
开发者ID:jLeta,项目名称:HN_HR_1.0,代码行数:29,代码来源:user-notification.aspx.cs
示例2: getAllActiveVacancy
/**
* Return list of vacancy which have this status.
*/
public static TransactionResponse getAllActiveVacancy(string status)
{
TransactionResponse response = new TransactionResponse();
IDictionary<string, object> statusParams = new Dictionary<string, object>();
statusParams.Add("@status", status);
statusParams.Add("@districtId", PageAccessManager.getDistrictID());
//Pass Stored Procedure Name and parameter list.
DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spAllActiveVacancy, statusParams);
try
{
DataTable dataTable = dpOperation.getRecord();
response.Data = dataTable;
response.setSuccess(true);
}
catch (SqlException ex)
{
//Other SqlException is catched
response.setSuccess(false);
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_UNKNOWN_EVIL_ERROR);
response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
}
//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.
LoggerManager.LogError(ex.ToString(), logger);
LoggerManager.upDateWithGenericErrorMessage(response);
}
return response;
}
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:37,代码来源:VacancyRegistrationAndEvaluationManager.cs
示例3: upDateWithGenericErrorMessage
public static void upDateWithGenericErrorMessage(TransactionResponse response)
{
//Display generic message.
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_SYSTEM_ENCOUNTERED_UNKNOWN_ERROR);
response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_EVIL_ERROR);
response.setSuccess(false);
}
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:8,代码来源:LoggerManager.cs
示例4: getAllNotificationsForCurrentEmployee
public static TransactionResponse getAllNotificationsForCurrentEmployee(MembershipUser currentUser)
{
//get detail of the logged on user.
Employee employee = EmployeeManager.getLoggedOnUser((Guid)currentUser.ProviderUserKey);
if (employee == null)
{
return EmployeeManager.handleLoggedInUserCanNotBeIdentfied();
}
TransactionResponse response = new TransactionResponse();
try
{
IDictionary<string, object> employeeIdMap = new Dictionary<string, object>();
employeeIdMap.Add("@EMP_ID", employee.EmpID);
employeeIdMap.Add("@destrictID", PageAccessManager.getDistrictID());
//Pass Stored Procedure Name and parameter list.
DBOperationsUtil dbOperation = new DBOperationsUtil(DbAccessConstants.spGetAllNotificationForTheCurrentEmployee, employeeIdMap);
DataTable dataTable = dbOperation.getRecord();
//put the data on Transaction response
response.Data = dataTable;
response.setSuccess(true);
response.setMessageType(TransactionResponse.SeverityLevel.INFO);
response.setMessage(DBOperationErrorConstants.M_NOTIFICATION_INFO);
//get Notifications inside the TransactionResponse.
return response;
}
catch (SqlException ex)
{
response.setErrorCode(DBOperationErrorConstants.E_ERROR_WHILE_READING_NOTIFICATION);
response.setMessage(DBOperationErrorConstants.M_ERROR_WHILE_READING_NOTIF);
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.
LoggerManager.LogError(ex.ToString(), logger);
response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_EVIL_ERROR);
response.setMessage(DBOperationErrorConstants.M_UNKNOWN_EVIL_ERROR);
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setSuccess(false);
return response;
}
}
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:49,代码来源:NotificationManager.cs
示例5: getDistrictSettingValue
public static TransactionResponse getDistrictSettingValue(string paramTag)
{
TransactionResponse response = new TransactionResponse();
IDictionary<string, object> argumentsMap = new Dictionary<string, object>();
argumentsMap.Add("@paramter_tag", paramTag);
argumentsMap.Add("@districtID", PageAccessManager.getDistrictID());
//Pass Stored Procedure Name and parameter list.
DBOperationsUtil dbOperation = new DBOperationsUtil(DbAccessConstants.spGetDistrictSetting, argumentsMap);
try
{
DataTable dataTable = dbOperation.getRecord();
if (dataTable != null)
{
foreach (DataRow row in dataTable.Rows)
{
//put the data on Transaction reponse
response.Data = row["parameter_value"].ToString();
response.setSuccess(true);
return response;
}
}
response.Data = PARAMETER_NOT_DEFINED + DBOperationErrorConstants.CONTACT_ADMIN;
response.setSuccess(false);
return response;
}
catch (SqlException ex)
{
response.Data = PARAMETER_NOT_DEFINED + DBOperationErrorConstants.CONTACT_ADMIN;
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.
LoggerManager.LogError(ex.ToString(), logger);
response.Data = PARAMETER_NOT_DEFINED + DBOperationErrorConstants.CONTACT_ADMIN;
response.setSuccess(false);
return response;
}
}
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:44,代码来源:PageAccessManager.cs
示例6: sendInsertPromotionToDb
private TransactionResponse sendInsertPromotionToDb(string spName, IDictionary<string, object> parameters)
{
//Pass Stored Procedure Name and parameter list.
DBOperationsUtil storeToDb = new DBOperationsUtil(spName, parameters);
TransactionResponse response = new TransactionResponse();
try
{
//call store to DB mathod and get reponse.
storeToDb.instertNewRecord();
response.setSuccess(true);
response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
response.setMessage(DBOperationErrorConstants.M_PROMOTION_REGISTER_OK);
}
catch (SqlException ex)
{
//Determine if the cause was duplicate KEY.
if (ex.ToString().Contains(DBOperationErrorConstants.PK_DUPLICATE_INDICATOR))
{
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_DUPLICATE_PROMOTION_KEY_ERROR);
response.setErrorCode(DBOperationErrorConstants.E_DUPLICATE_KEY_ERROR);
}
else
{
//Other SqlException is catched
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_UNKNOWN_ERROR_APP_RATING_REGISTER);
response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
}
}
//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);
LoggerManager.upDateWithGenericErrorMessage(response);
}
return response;
}
开发者ID:jLeta,项目名称:HN_HR_1.0,代码行数:43,代码来源:PromotionManager.cs
示例7: DownloadAllAsync
public TransactionResponse DownloadAllAsync(string orderref = "", bool includeInvoiceAndReceipts = true, DocumentStatus documentStatus = DocumentStatus.Closed)
{
var time =new TimeSpan(0,0,5,0);
var time1 = TimeSpan.FromMinutes(5).Seconds;
var task= Task.Run(async () =>
{
TransactionResponse res=new TransactionResponse();
try
{
string url = string.Format(MiddlewareHttpClient.BaseAddress +
"api/Integrations/Transaction?username={0}&password={1}&integrationModule={2}&documentRef={3}&includeInvoiceAndReceipts={4}&documentStatus={5}",
_userName,
_otherUtilities.MD5Hash(_password),
module, orderref,
includeInvoiceAndReceipts,documentStatus);
Messenger.Default.Send(
string.Format(DateTime.Now.ToString("hh:mm:ss") +
":Contacting Server =>" +
MiddlewareHttpClient.BaseAddress));
HttpResponseMessage response =
await MiddlewareHttpClient.GetAsync(url);
Messenger.Default.Send(
string.Format(DateTime.Now.ToString("hh:mm:ss") +
":Server Response=>" + response.StatusCode));
res=await response.Content.ReadAsAsync<TransactionResponse>();
}catch(Exception ex)
{
}
return res;
});
//Task.Delay(TimeSpan.FromMinutes(5).Seconds);
task.Wait(time);
return task.Result;
}
开发者ID:asanyaga,项目名称:BuildTest,代码行数:41,代码来源:TransactionsDownloadService.cs
示例8: displayMessageToTheUser
private void displayMessageToTheUser(TransactionResponse response)
{
clearMsgPanel();
switch (response.getMessageType())
{
case TransactionResponse.SeverityLevel.SUCESS:
msgPanel.Visible = true;
SucessDIV.Visible = true;
lblSuccessMessage.Text = response.getMessage();
break;
case TransactionResponse.SeverityLevel.INFO:
msgPanel.Visible = true;
InfoDIV.Visible = true;
lblInformationMsg.Text = response.getMessage();
break;
case TransactionResponse.SeverityLevel.WARNING:
msgPanel.Visible = true;
WarnDIV.Visible = true;
if (response.getErrorCode() != null)
{
lblWarningMsg.Text = response.getMessage() + response.getErrorCode();
break;
}
lblWarningMsg.Text = response.getMessage();
break;
case TransactionResponse.SeverityLevel.ERROR:
msgPanel.Visible = true;
ErroroDIV.Visible = true;
if (response.getErrorCode() != null)
{
lblErrorMsg.Text = response.getMessage() + response.getErrorCode();
break;
}
lblErrorMsg.Text = response.getMessage();
break;
}
}
开发者ID:jLeta,项目名称:HN_HR_1.0,代码行数:39,代码来源:get-applicant-passed-for-further-process.aspx.cs
示例9: addNewPromotionAssignment
public TransactionResponse addNewPromotionAssignment()
{
//Add List of Arguments for new promotion Assigment
IDictionary<string, object> promotionAssigmentParameters = new Dictionary<string, object>();
promotionAssigmentParameters.Add("@minNo", promotionAssigment.MinuteNo);
promotionAssigmentParameters.Add("@hROfficerID", promotionAssigment.HROfficerID);
promotionAssigmentParameters.Add("@deadLine", promotionAssigment.DeadLine);
promotionAssigmentParameters.Add("@remark", promotionAssigment.Remark);
//Pass Stored Procedure Name and parameter list.
DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spAddPromotionAssignmentToHROfficer, promotionAssigmentParameters);
TransactionResponse response = new TransactionResponse();
try
{
//call update to DB mathod and get reponse.
dpOperation.updateRecord();
response.setSuccess(true);
response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
response.setMessage(DBOperationErrorConstants.M_VACANCY_ASSIGNED_SUCCESS);
}
catch (SqlException ex)
{
//Other SqlException is catched
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.PK_DUPLICATE_INDICATOR + ". "+ DBOperationErrorConstants.M_DUPLICATE_PROMOTION_ASSIGNEMENT);
response.setErrorCode(DBOperationErrorConstants.E_PROMOTION_ASSIGNEMETN_FAILED);
}
//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);
LoggerManager.upDateWithGenericErrorMessage(response);
}
return response;
}
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:39,代码来源:PromotionManager.cs
示例10: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
VacancyRegistrationAndEvaluationManager manager = new VacancyRegistrationAndEvaluationManager();
TransactionResponse response = new TransactionResponse();
response = manager.getVacancyToAnnounceToOutside();
gvRss.Visible = true;
DataTable vacancyDetail = (DataTable)response.Data;
if (vacancyDetail != null && vacancyDetail.Rows.Count > 0)
{
msgDIV.Visible = false;
noticeDIV.Visible = true;
gvRss.DataSource = vacancyDetail;
gvRss.DataBind();
}
else
{
noticeDIV.Visible = false;
msgDIV.Visible = true;
}
}
开发者ID:jLeta,项目名称:HN_HR_1.0,代码行数:22,代码来源:vacancy-announcement.aspx.cs
示例11: GetTransactions
public TransactionResponse[] GetTransactions()
{
List<TransactionResponse> actResponse = new List<TransactionResponse>();
int count = Convert.ToInt32(UIUtil.DefaultProvider.GetXPathCountByXPath(TransactionRows)) - 1;
for (int i = 0; i < count; i++)
{
TransactionResponse response = new TransactionResponse();
response.Id = UIUtil.DefaultProvider.GetText(string.Format(TransactionRows + "[{0}]/td[1]", i + 1), LocateBy.XPath);
response.Date = UIUtil.DefaultProvider.GetText(string.Format(TransactionRows + "[{0}]/td[2]", i + 1), LocateBy.XPath);
response.Type = UIUtil.DefaultProvider.GetText(string.Format(TransactionRows + "[{0}]/td[3]", i + 1), LocateBy.XPath);
response.Notes = UIUtil.DefaultProvider.GetText(string.Format(TransactionRows + "[{0}]/td[5]", i + 1), LocateBy.XPath);
response.Amount = UIUtil.DefaultProvider.GetText(string.Format(TransactionRows + "[{0}]/td[6]", i + 1), LocateBy.XPath);
response.SubTotal = UIUtil.DefaultProvider.GetText(string.Format(TransactionRows + "[{0}]/td[7]", i + 1), LocateBy.XPath);
response.AddBy = UIUtil.DefaultProvider.GetText(string.Format(TransactionRows + "[{0}]/td[8]", i + 1), LocateBy.XPath);
response.ModBy = UIUtil.DefaultProvider.GetText(string.Format(TransactionRows + "[{0}]/td[9]", i + 1), LocateBy.XPath);
response.Delete = UIUtil.DefaultProvider.GetText(string.Format(TransactionRows + "[{0}]/td[10]", i + 1), LocateBy.XPath);
actResponse.Add(response);
}
return actResponse.ToArray();
}
开发者ID:aliaksandr-trush,项目名称:csharp-automaton,代码行数:23,代码来源:BackendManagerVerify.cs
示例12: btnFinalShowVac_Click
protected void btnFinalShowVac_Click(object sender, EventArgs e)
{
if (DateTime.Parse(dateStart0.Text) > DateTime.Parse(DateEnd0.Text))
{
lblInvalidInput.Visible = true;
lblInvalidInput.Text = "End date can not be before start date.";
//Empty DropDown
DropDownListFinalResult.ClearSelection();
secondPhasePanel.Visible = false;
}
startedDate = dateStart0.Text.Trim();
endedDate = DateEnd0.Text.Trim();
VacancyRegistrationAndEvaluationManager manager = new VacancyRegistrationAndEvaluationManager();
TransactionResponse response = new TransactionResponse();
response = manager.getVacancyToGenerateReportByDateInterval(startedDate, endedDate, DbAccessConstants.spGetFinalPhaseVacancyByDateInterval);
DataTable vacancyDetail = (DataTable)response.Data;
DropDownListFinalResult.Items.Clear();
DropDownListFinalResult.Items.Add(new ListItem(" -- SELECT VACANCY --", "-1"));
if (vacancyDetail != null && vacancyDetail.Rows.Count > 0)
{
clearmsgPanel();
secondPhasePanel.Visible = true;
DropDownListFinalResult.DataSource = vacancyDetail;
DropDownListFinalResult.DataValueField = "vacancy_detail_value";
DropDownListFinalResult.DataTextField = "vacancy_detail";
DropDownListFinalResult.DataBind();
}
else
{
selectedVacancyPanel.Visible = false;
msgPanel.Visible = true;
InfoDIV.Visible = true;
lblInformationMsg.Text = "There is no final phase result bewteen the selected date interval";
DropDownListFinalResult.ClearSelection();
}
}
开发者ID:jLeta,项目名称:HN_HR_1.0,代码行数:44,代码来源:manage-rating-for-hr-officer.aspx.cs
示例13: btnGenerateFinalReport_Click
protected void btnGenerateFinalReport_Click(object sender, EventArgs e)
{
if (DropDownListFinalResult.SelectedValue == "-1")
{
lblVacancyFinal.Visible = true;
return;
}
lblVacancyFinal.Visible = false;
string[] splitter = new string[] { PageConstants.GREATER_GREATER_THAN };
VacancyInfoTosplit = (DropDownListFinalResult.SelectedValue).Split(splitter, StringSplitOptions.RemoveEmptyEntries);
currentVacancyNo = VacancyInfoTosplit[0].Trim();
currentVacancyDate = VacancyInfoTosplit[1].Trim();
Vacancy vacancy = new Vacancy();
vacancy.VacancyNo = currentVacancyNo;
vacancy.PostedDate = currentVacancyDate;
//get and display the vacancy to user.
int isfromAll = 0;
getVacancyReportAndDisplayToUser(vacancy, PageConstants.REPORT_PHASE2, isfromAll);
VacancyRegistrationAndEvaluationManager manager = new VacancyRegistrationAndEvaluationManager();
TransactionResponse response = new TransactionResponse();
//get vacancy detail
response = manager.getVacancyDetail(vacancy);
DataTable dataTable = (DataTable)response.Data;
string postDate = "";
try
{
postDate = String.Format("{0:MMM d, yyyy}", Convert.ToDateTime(dataTable.Rows[0]["posted_date"]));
}
catch (Exception)
{
}
VacDetailFinalPanel.Visible = true;
lblfinalVacancyPost.Text = dataTable.Rows[0]["Vancay_title"].ToString() + " ( JG - " +
dataTable.Rows[0]["vacancy_for_JobGrade"].ToString() + " )";
lblfinalVacancyNum.Text = dataTable.Rows[0]["vacancy_No"].ToString() + " dated " + postDate;
lblfinalJobReq.Text = dataTable.Rows[0]["JobDescription"].ToString() + " " + dataTable.Rows[0]["JobRequirement"].ToString() + ". ";
}
开发者ID:jLeta,项目名称:HN_HR_1.0,代码行数:44,代码来源:manage-rating-for-hr-officer.aspx.cs
示例14: getInactiveEmployeeResult
/**
* Get Inactive employee by date interval
*/
public TransactionResponse getInactiveEmployeeResult(string startedDate, string endDate)
{
TransactionResponse response = new TransactionResponse();
try
{
//Add List of Arguments for new employee
IDictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("@startDate", startedDate);
parameters.Add("@endDate", endDate);
DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spGetInactiveEmployeeDetail, parameters);
DataTable getResult = dpOperation.getRecord();
if (getResult != null && getResult.Rows.Count > 0)
{
response.Data = getResult;
response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
response.setMessage(DBOperationErrorConstants.M_REPORT_GENERATED_SUCCESS);
response.setSuccess(true);
return response;
}
else
{
response.setMessageType(TransactionResponse.SeverityLevel.INFO);
response.setMessage(DBOperationErrorConstants.M_GENERATE_INACTIVE_EMPLOYEE_REPORT_EMPTY);
response.setSuccess(false);
return response;
}
}
catch (SqlException ex)
{
//Other SqlException is catched
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_UNABLE_TO_GENERATE_INACTIVE_EMPLOYEE);
response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
response.setSuccess(false);
}
//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);
LoggerManager.upDateWithGenericErrorMessage(response);
}
return response;
}
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:49,代码来源:EmployeeManager.cs
示例15: AddHROfficerOrClerk
/**
* calls Store to DB utility for the current employee.
*/
public TransactionResponse AddHROfficerOrClerk(string SPName, string EmpID)
{
//Add List of Arguments for new employee
IDictionary<string, object> paramater = new Dictionary<string, object>();
paramater.Add("@Emp_ID", EmpID);
//Pass Stored Procedure Name and parameter list.
DBOperationsUtil storeToDb = new DBOperationsUtil(SPName, paramater);
TransactionResponse response = new TransactionResponse();
//call store to DB mathod and get reponse.
try
{
storeToDb.instertNewRecord();
response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
response.setSuccess(true);
response.setMessage(DBOperationErrorConstants.M_HR_OFFICER_REGISTER_OK);
}
catch (SqlException ex)
{
//Determine if the cause was duplicate KEY.
if (ex.ToString().Contains(DBOperationErrorConstants.PK_DUPLICATE_INDICATOR))
{
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_DUPLICATE_EID_KEY_ERROR);
response.setErrorCode(DBOperationErrorConstants.E_DUPLICATE_KEY_ERROR);
}
else
{
//Other SqlException is catched
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_UNKNOWN_ERROR_EMP_REGISTER);
response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
}
}
//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);
LoggerManager.upDateWithGenericErrorMessage(response);
}
return response;
}
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:52,代码来源:EmployeeManager.cs
示例16: 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;
}
}
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:43,代码来源:EmployeeManager.cs
示例17: VerifyTransactions
public void VerifyTransactions(TransactionResponse[] expectedResponse)
{
TransactionResponse[] actualResponses = GetTransactions();
if (actualResponses.Length != expectedResponse.Length)
{
VerifyTool.VerifyValue(expectedResponse.Length, actualResponses.Length, "There are {0} transactions");
}
else
{
for (int i = 0; i < actualResponses.Length; i++)
{
if (!actualResponses.Equals(expectedResponse))
{
VerifyTool.VerifyValue(expectedResponse[i].Id, actualResponses[i].Id, "The transaction id is {0}");
VerifyTool.VerifyValue(expectedResponse[i].Date, actualResponses[i].Date, "The transaction date is {0}");
VerifyTool.VerifyValue(expectedResponse[i].Type, actualResponses[i].Type, "The transaction type is {0}");
VerifyTool.VerifyValue(expectedResponse[i].Notes, actualResponses[i].Notes, "The transaction notes is {0}");
VerifyTool.VerifyValue(expectedResponse[i].Amount, actualResponses[i].Amount, "The transaction amount is {0}");
VerifyTool.VerifyValue(expectedResponse[i].SubTotal, actualResponses[i].SubTotal, "The transaction sub-total is {0}");
VerifyTool.VerifyValue(expectedResponse[i].AddBy, actualResponses[i].AddBy, "The transaction added by {0}");
VerifyTool.VerifyValue(expectedResponse[i].ModBy, actualResponses[i].ModBy, "The transaction moded by {0}");
VerifyTool.VerifyValue(expectedResponse[i].Delete, actualResponses[i].Delete, "The transaction deleted by {0}");
}
}
}
}
开发者ID:aliaksandr-trush,项目名称:csharp-automaton,代码行数:27,代码来源:BackendManagerVerify.cs
示例18: updatePromotionStatus
public TransactionResponse updatePromotionStatus(Promotion promotion, string promoStatus)
{
TransactionResponse response = new TransactionResponse();
try
{
//Add List of Arguments for new employee
IDictionary<string, object> parameters = new Dictionary<string, object>();
DBOperationsUtil dpOperation = getDBOperationToUpdatePromotionStatus4Assignment(parameters, promotion, promoStatus);
dpOperation.updateRecord();
response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
response.setSuccess(true);
}
catch (SqlException ex)
{
//Other SqlException is catched
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_UNKNOWN_ERROR_UPDATE_VACANCY);
response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
response.setSuccess(false);
}
//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);
LoggerManager.upDateWithGenericErrorMessage(response);
}
return response;
}
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:29,代码来源:PromotionManager.cs
示例19: VerifyTransactionsByOrder
public void VerifyTransactionsByOrder(TransactionResponse expectedResponse, int order)
{
TransactionResponse[] actualResponses = GetTransactions();
if ((0 < order) && (order <= actualResponses.Length))
{
TransactionResponse actualResponse = actualResponses[order - 1];
if (!actualResponse.Equals(expectedResponse))
{
VerifyTool.VerifyValue(expectedResponse.Id, actualResponse.Id, "The transaction id is {0}");
VerifyTool.VerifyValue(expectedResponse.Date, actualResponse.Date, "The transaction date is {0}");
VerifyTool.VerifyValue(expectedResponse.Type, actualResponse.Type, "The transaction type is {0}");
VerifyTool.VerifyValue(expectedResponse.Notes, actualResponse.Notes, "The transaction notes is {0}");
VerifyTool.VerifyValue(expectedResponse.Amount, actualResponse.Amount, "The transaction amount is {0}");
VerifyTool.VerifyValue(expectedResponse.SubTotal, actualResponse.SubTotal, "The transaction sub-total is {0}");
VerifyTool.VerifyValue(expectedResponse.AddBy, actualResponse.AddBy, "The transaction added by {0}");
VerifyTool.VerifyValue(expectedResponse.ModBy, actualResponse.ModBy, "The transaction moded by {0}");
VerifyTool.VerifyValue(expectedResponse.Delete, actualResponse.Delete, "The transaction deleted by {0}");
}
}
else
{
Assert.Fail("This is a wrong order.");
}
}
开发者ID:aliaksandr-trush,项目名称:csharp-automaton,代码行数:25,代码来源:BackendManagerVerify.cs
示例20: getDetailOfSelectedVacancy
private string getDetailOfSelectedVacancy(Vacancy vacancy)
{
VacancyRegistrationAndEvaluationManager manager = new VacancyRegistrationAndEvaluationManager();
TransactionResponse response = new TransactionResponse();
//get vacancy detail
response = manager.getVacancyDetail(vacancy);
DataTable dataTable = (DataTable)response.Data;
return (dataTable.Rows[0]["vacancy_evaluation_form"].ToString().Trim());
}
开发者ID:jLeta,项目名称:HN_HR_1.0,代码行数:11,代码来源:get-applicant-passed-for-further-process.aspx.cs
注:本文中的TransactionResponse类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论