//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; } }
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; } }