本文整理汇总了C#中TransactionResponse类的典型用法代码示例。如果您正苦于以下问题:C# TransactionResponse类的具体用法?C# TransactionResponse怎么用?C# TransactionResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TransactionResponse类属于命名空间,在下文中一共展示了TransactionResponse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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;
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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();
}
示例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();
}
}
示例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() + ". ";
}
示例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;
}
示例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;
}