本文整理汇总了C#中TransactionResponse.setMessageType方法的典型用法代码示例。如果您正苦于以下问题:C# TransactionResponse.setMessageType方法的具体用法?C# TransactionResponse.setMessageType怎么用?C# TransactionResponse.setMessageType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransactionResponse
的用法示例。
在下文中一共展示了TransactionResponse.setMessageType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: 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);
}
示例3: 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;
}
}
示例4: 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;
}
示例5: 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;
}
示例6: DeleteApplicat
public TransactionResponse DeleteApplicat(Vacancy vacancy, string eid)
{
TransactionResponse response = new TransactionResponse();
try
{
//Add List of Arguments for new employee @EID
IDictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("@vacancy_No", vacancy.VacancyNo);
parameters.Add("@vancacy_Date", vacancy.PostedDate);
parameters.Add("@EID", eid);
//get report for the Processor
DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spDeleteApplicant, parameters);
DataTable dataTable = dpOperation.getRecord();
response.Data = dataTable;
response.setSuccess(true);
response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
}
catch (Exception ex)
{
//Write this exception to file for investigation of the issue later.
logException(ex);
LoggerManager.upDateWithGenericErrorMessage(response);
}
return response;
}
示例7: updateVacancyDetailNotAssignedtoHROfficer
public TransactionResponse updateVacancyDetailNotAssignedtoHROfficer(Vacancy vacancy)
{
TransactionResponse response = new TransactionResponse();
try
{
//Add List of Arguments for new employee
IDictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("@vacancy_No", vacancy.VacancyNo);
parameters.Add("@posted_date", vacancy.PostedDate);
parameters.Add("@Vancay_title", vacancy.VancayTitle);
parameters.Add("@branch_id", vacancy.BranchId);
parameters.Add("@vancy_deadline", vacancy.VancyDeadline);
parameters.Add("@vacancy_for_JobGrade", vacancy.VacancyforJobGrade);
parameters.Add("@year_gen_required", vacancy.YearRequiredforGeneral);
parameters.Add("@year_spec_required", vacancy.YearRequiredforSpec);
parameters.Add("@general_wrk_expr_percent", vacancy.GeneralWrkExprPercent);
parameters.Add("@specific_wrk_expr_percent", vacancy.SpecificWrkExprPercent);
parameters.Add("@related_wrk_expr_percent", vacancy.RelatedWrkExprPercent);
parameters.Add("@examination_percent", vacancy.ExaminationPercent);
parameters.Add("@manager_Recom_percent", vacancy.ManagerRecPercent);
parameters.Add("@interview_percent", vacancy.InterviewPercent);
parameters.Add("@JobBenefit", vacancy.SalaryAndBenefit);
parameters.Add("@JobDescription", vacancy.JobDescription);
parameters.Add("@JobRequirement", vacancy.JobRequirement);
//get report for the Processor
DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spUpdateNotAssignedVacancyDetail, parameters);
DataTable dataTable = dpOperation.getRecord();
response.Data = dataTable;
response.setSuccess(true);
response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
response.setMessage(DBOperationErrorConstants.M_VACANCY_UPDATE_OK);
}
catch (Exception ex)
{
//Write this exception to file for investigation of the issue later.
logException(ex);
LoggerManager.upDateWithGenericErrorMessage(response);
}
return response;
}
示例8: 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;
}
示例9: 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;
}
示例10: storeInactiveEmployee
// Insert Inactive Employeee into DB
public TransactionResponse storeInactiveEmployee()
{
//Add List of Arguments for new employee
IDictionary<string, object> employeeArgumentaMap = new Dictionary<string, object>();
employeeArgumentaMap.Add("@EmpID", employee.EmpID);
employeeArgumentaMap.Add("@FName", employee.FName);
employeeArgumentaMap.Add("@MName", employee.MName);
employeeArgumentaMap.Add("@LName", employee.LName);
employeeArgumentaMap.Add("@Sex", employee.Sex);
employeeArgumentaMap.Add("@JobTitle", employee.JobTitle);
employeeArgumentaMap.Add("@branch", employee.Branch);
employeeArgumentaMap.Add("@dateOfEmp", inactiveEmployee.DateOfEmployment);
employeeArgumentaMap.Add("@dateOfTerm", inactiveEmployee.DateOfTermination);
employeeArgumentaMap.Add("@majorCategory", inactiveEmployee.MajorCategory);
employeeArgumentaMap.Add("@ReasonForleave", inactiveEmployee.ReasonForLeave);
//Pass Stored Procedure Name and parameter list.
DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spAddInactiveEmployee, employeeArgumentaMap);
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_INACTIVE_EMPLOYEE_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);
response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_EVIL_ERROR);
response.setMessage(DBOperationErrorConstants.M_UNKNOWN_EVIL_ERROR);
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setSuccess(false);
return response;
}
return response;
}
示例11: storeEmployeefromOtherDistrictForPromotion
/**
* Add promoted employee from other district
*/
public TransactionResponse storeEmployeefromOtherDistrictForPromotion(string minNumber, string districtID)
{
//Add List of Arguments for new employee
IDictionary<string, object> employeeArgumentaMap = new Dictionary<string, object>();
employeeArgumentaMap.Add("@Minute_No", minNumber);
employeeArgumentaMap.Add("@Emp_ID", employee.EmpID);
employeeArgumentaMap.Add("@First_Name", employee.FName);
employeeArgumentaMap.Add("@Middle_Name", employee.MName);
employeeArgumentaMap.Add("@Last_Name", employee.LName);
employeeArgumentaMap.Add("@Curr_Jtitle", employee.PrevJob);
employeeArgumentaMap.Add("@Curr_JGrade", employee.PrevJobGrade);
employeeArgumentaMap.Add("@Exp_JGrade", employee.JobGrade);
employeeArgumentaMap.Add("@Salary", employee.Salary);
employeeArgumentaMap.Add("@district", districtID);
employeeArgumentaMap.Add("@status", "Active");
//Pass Stored Procedure Name and parameter list.
DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spAddPromotedEmployeefromOtherDistrict, employeeArgumentaMap);
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_EMPLOYEE_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;
}
示例12: manageProcessingAndCheckingPermission
/**
* Checkes if Processor and Checker has a permission to evaluate the current employee.
*/
private void manageProcessingAndCheckingPermission(Employee replyEmployee, string hrOfficerType, TransactionResponse response)
{
if (PageConstants.PROCESSOR.Equals(hrOfficerType))
{
if (replyEmployee.CheckedDate != null && replyEmployee.ProcessedDate != null)
{
response.setMessage(DBOperationErrorConstants.M_EMPLOYEE_ALREADY_CHECKED);
response.setMessageType(TransactionResponse.SeverityLevel.WARNING);
//log permission refusal reason.
LoggerManager.LogInfo("Applicant : " + replyEmployee.EmpID + " can not be processed; Because it is already checked. Checked date : "
+ replyEmployee.CheckedDate + "Processed date : " + replyEmployee.ProcessedDate, logger);
}
else
{
response.setMessage(DBOperationErrorConstants.M_EMPLOYEE_ALREADY_PROCESSED_BY_YOU);
response.setMessageType(TransactionResponse.SeverityLevel.INFO);
}
}
else if (PageConstants.CHECKER.Equals(hrOfficerType))
{
if (replyEmployee.ProcessedDate == null)
{
response.setMessage(DBOperationErrorConstants.M_EMPLOYEE_NOT_PROCESSED_YET);
response.setMessageType(TransactionResponse.SeverityLevel.WARNING);
LoggerManager.LogInfo("Applicant : " + replyEmployee.EmpID + " can not be checked; Because it is not processed yet. Checked date : "
+ replyEmployee.CheckedDate + "Processed date : " + replyEmployee.ProcessedDate, logger);
}
else
{
//CHECK if the vacancy is still in ASSIGNED STATE
Vacancy currentVacancy = new Vacancy();
currentVacancy.VacancyNo = vacanyEvaluationForm.VacancyNo;
currentVacancy.PostedDate = vacanyEvaluationForm.VacancyDate;
//initialise before calling method : getCurrentStatusOfVacancy
this.vacancy = currentVacancy;
TransactionResponse vacancyStatusResp = getCurrentStatusOfVacancy();
string vacancyStatus = "";
if (vacancyStatusResp.Data != null)
{
vacancyStatus = (string)vacancyStatusResp.Data;
}
// check if Vacancy is still in assigned state or processing done state, but not checking done state
if (!vacancyStatus.Equals("") && (VacancyConstants.VACANCY_ASSIGNED_TO_HR_OFFICERS.Equals(vacancyStatus)
|| VacancyConstants.VACANCY_PROCESSING_DONE.Equals(vacancyStatus)) && replyEmployee.CheckedDate != null)
{
response.setMessage(DBOperationErrorConstants.M_EMPLOYEE_ALREADY_CHECKED_BY_YOU);
response.setMessageType(TransactionResponse.SeverityLevel.INFO);
}
//check if the status is neither not-in-Assigned-state nor in processing done state
//it means the vacancy is either cancelled/readvertised,... OR checking is done. state.
else if (!VacancyConstants.VACANCY_ASSIGNED_TO_HR_OFFICERS.Equals(vacancyStatus)
&& !VacancyConstants.VACANCY_PROCESSING_DONE.Equals(vacancyStatus))
{
response.setMessage(DBOperationErrorConstants.M_VACANCY_NOT_IN_ASSIGNED_STATE);
response.setMessageType(TransactionResponse.SeverityLevel.WARNING);
}
}
}
}
示例13: updateVacancyStatusToVacActiveforVacancyReversal
public TransactionResponse updateVacancyStatusToVacActiveforVacancyReversal()
{
TransactionResponse response = new TransactionResponse();
try
{
bool updateStatus = sendVacancyUpdateStatus(response);
if (updateStatus)
{
response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
response.setMessage(DBOperationErrorConstants.M_VACANCY_REVERSED_SUCCESS);
response.setSuccess(true);
}
else
{
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_VACANCY_REVERSE_FAIL);
response.setErrorCode(DBOperationErrorConstants.E_VACANCY_REVERSE_FAILED);
response.setSuccess(true);
}
}
catch (SqlException ex)
{
//Other SqlException is catched
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_VACANCY_REVERSE_FAIL);
response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
response.setSuccess(false);
}
return response;
}
示例14: updateVacancyStatusToReadvertiseFromProfileArrived
//this methode is used to update vacancy status from profile arrived to readvertise
//and also set profile arrived & applicant registeration to NULL
public TransactionResponse updateVacancyStatusToReadvertiseFromProfileArrived()
{
TransactionResponse response = new TransactionResponse();
bool isUpdated = false;
try
{
try
{
//Add List of Arguments for new employee
IDictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("@vacancy_No", vacancy.VacancyNo.Trim());
parameters.Add("@posted_date ", vacancy.PostedDate.Trim());
parameters.Add("@status", vacancy.Status);
parameters.Add("@vancy_deadline", vacancy.VancyDeadline);
DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spReadvertiseVacFromProfileArr, parameters);
isUpdated = dpOperation.updateRecord();
}
//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);
}
if (isUpdated)
{
response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
response.setMessage(DBOperationErrorConstants.M_VACANCY_READVERTISED_SUCCESS);
response.setSuccess(true);
}
else
{
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_VACANCY_READVERTISED_FAIL);
response.setErrorCode(DBOperationErrorConstants.E_VACANCY_READVERTISE_FAILED);
response.setSuccess(true);
}
}
catch (SqlException ex)
{
//Other SqlException is catched
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_VACANCY_READVERTISED_FAIL);
response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
response.setSuccess(false);
}
return response;
}
示例15: updateVacancyStatusToReAdvertisedAfterRating
/**
* Update status fo Vacancy to Readverised after rating
*/
public TransactionResponse updateVacancyStatusToReAdvertisedAfterRating()
{
TransactionResponse response = new TransactionResponse();
try
{
bool updateStatus = readvertiseVacancyAfterRating(response);
if (updateStatus)
{
response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
response.setMessage(DBOperationErrorConstants.M_VACANCY_READVERTISED_SUCCESS);
response.setSuccess(true);
}
else
{
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_VACANCY_READVERTISE_FAIL);
response.setErrorCode(DBOperationErrorConstants.E_VACANCY_READVERTISE_FAILED);
response.setSuccess(true);
}
}
catch (SqlException ex)
{
//Other SqlException is catched
response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
response.setMessage(DBOperationErrorConstants.M_VACANCY_CANCELLATION_FAIL);
response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
response.setSuccess(false);
}
return response;
}