protected void Page_Load(object sender, EventArgs e) { if (Request.IsAuthenticated) { if (!IsPostBack) { populateVacancy(); } // Get a reference to the currently logged on user MembershipUser currentUser = Membership.GetUser(); // Determine the currently logged on user's UserId value Guid currentUserId = (Guid)currentUser.ProviderUserKey; //prepare parameters IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@UserId", currentUserId); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetEmployeeBranchDetail, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); if (dataTable != null) { foreach (DataRow row in dataTable.Rows) { loggedInEmpID = row["Emp_ID"].ToString(); } } } }
/** * 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; }
public static DataTable getAllBranchEmpStatus() { //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetAllBranchEmployeeStatus, null); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); return dataTable; }
public static DataTable getAllBranchEmpStatus() { //Pass Stored Procedure Name and parameter list. IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@district", PageAccessManager.getDistrictID()); DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetAllBranchEmployeeStatus, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); return dataTable; }
public static DataTable getAssignedEmployeeFormOtherDistrict() { //prepare parameters IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetListOfAssignedEmployeefromOtherDistrict, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); return dataTable; }
public static DataTable getSpecBranchEmpStatus(int branchID) { //prepare parameters IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@branch", branchID); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetBranchEmployeeStatus, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); return dataTable; }
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; } }
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; } }
protected void Page_Load(object sender, EventArgs e) { if (Request.IsAuthenticated) { // Get a reference to the currently logged on user MembershipUser currentUser = Membership.GetUser(); // Determine the currently logged on user's UserId value Guid currentUserId = (Guid)currentUser.ProviderUserKey; //prepare parameters IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@UserId", currentUserId); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetEmployeeBranchDetail, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); if (dataTable != null) { foreach (DataRow row in dataTable.Rows) { fName = row["First_Name"].ToString(); mName = row["Middle_Name"].ToString(); jTittle = row["Job_Tittle"].ToString(); branchName = row["branchName"].ToString(); branchID = Convert.ToInt16(row["branch"].ToString()); } } else { //something went wrong, show correct error to the user } lblBranch.Text = branchName; } if (!IsPostBack) { DataTable getds = BranchEmployeeStatusManager.getSpecBranchEmpStatus(branchID); BindDataSetToGV(getds); } }
/** * gets list of Current branch */ public static DataTable getCurrentBranch() { //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetBranchsList, null); DataTable dataTable = null; try { return dataTable = storeToDb.getRecord(); } catch (SqlException ex) { //return emptylist return dataTable; } //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); return dataTable; } }
/** * gets list of employee for a given Branch */ public List<Employee> getListOfEmployeeByFirstNameOrEmpIdAtBranch() { IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@txtEmpID", employee.UserName); argumentsMap.Add("@branch", employee.Branch); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetEmployeeByFirstNameAutoCompleteSpecBranch, argumentsMap); //call getRecord method and get SqlDataReader DataTable dataTable = null; try { dataTable = storeToDb.getRecord(); //format the Result to return to presentation layer. List<Employee> listOfEmployee = null; if (dataTable != null) { listOfEmployee = new List<Employee>(); foreach (DataRow row in dataTable.Rows) { Employee emply = new Employee(); emply.FName = row["First_Name"].ToString(); emply.MName = row["Middle_Name"].ToString(); emply.LName = row["Last_Name"].ToString(); emply.EmpID = row["Emp_ID"].ToString(); listOfEmployee.Add(emply); } } return listOfEmployee; } catch (SqlException ex) { //return emptylist return new List<Employee>(); } //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); return new List<Employee>(); } }
/** * 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; }
/** * Gives the current active HR amanger. */ public static string getCurrentHRManager() { //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetCurrentHrManager, null); //call getRecord method and get SqlDataReader DataTable dataTable = null; try { dataTable = storeToDb.getRecord(); //The if there was a result if (dataTable != null) { foreach (DataRow row in dataTable.Rows) { return row["HrManagerEmpID"].ToString(); } } return PageConstants.ERROR; } catch (SqlException ex) { return PageConstants.ERROR; } //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); return PageConstants.ERROR; } }
/** * get employee Job title and branch detail. */ public Employee getEmployeeJobTitleAndBranchDetail() { //create parameter to pass IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@Emp_ID", employee.EmpID); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetEmployeeJobTitleBranchAndDistrict, argumentsMap); //call getRecord method and get SqlDataReader DataTable dataTable = null; Employee employeeRply = null; try { dataTable = storeToDb.getRecord(); //The if there was a result if (dataTable != null) { foreach (DataRow row in dataTable.Rows) { employeeRply = new Employee(); employeeRply.EmpID = employee.EmpID; employeeRply.UserName = row["UserId"].ToString(); employeeRply.FName = row["First_Name"].ToString(); employeeRply.MName = row["Middle_Name"].ToString(); employeeRply.LName = row["Last_Name"].ToString(); employeeRply.Sex = row["Sex"].ToString(); employeeRply.PrevJob = row["PrevJob"].ToString(); employeeRply.JobTitle = row["JobTitle"].ToString(); employeeRply.Branch = row["branchName"].ToString(); employeeRply.BranchID = row["branch"].ToString(); employeeRply.JobGrade = row["Grade"].ToString(); employeeRply.Salary = row["Salary"].ToString(); employeeRply.Hdate = row["HDate"].ToString(); employeeRply.District = row["distric_name"].ToString(); //We are seaarching Employee by ID, there an only be only employee return employeeRply; } } return employeeRply; } catch (SqlException ex) { return employeeRply; } //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); return employeeRply; } }
public Employee detailOfEmployeToBeEvaluated(string vacancyNo, string vacancyDate) { //create parameter to pass IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@Emp_ID", employee.EmpID); argumentsMap.Add("@vacancyNo", vacancyNo); argumentsMap.Add("@vacancyDate", vacancyDate); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetEmployeeToBeEvaluated, argumentsMap); //call getRecord method and get SqlDataReader DataTable dataTable = null; Employee employeeRply = null; try { dataTable = storeToDb.getRecord(); //The if there was a result if (dataTable != null) { foreach (DataRow row in dataTable.Rows) { employeeRply = new Employee(); employeeRply.EmpID = employee.EmpID; employeeRply.FName = row["First_Name"].ToString(); employeeRply.MName = row["Middle_Name"].ToString(); employeeRply.LName = row["Last_Name"].ToString(); employeeRply.EducationalQualification = row["Educational Level"].ToString(); employeeRply.JobTitle = row["JobTitle"].ToString(); employeeRply.Branch = row["branchName"].ToString(); employeeRply.EmployeeType = row["applicant_type"].ToString(); if (row["proccessed_date"] != null && !row["proccessed_date"].ToString().Equals("")) { employeeRply.ProcessedDate = row["proccessed_date"].ToString(); } if (row["checked_date"] != null && !row["checked_date"].ToString().Equals("")) { employeeRply.CheckedDate = row["checked_date"].ToString(); } //We are seaarching Employee by ID, there an only be only employee return employeeRply; } } return employeeRply; } catch (SqlException ex) { return employeeRply; } //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); return employeeRply; } }
/** * Get applicant result after checking done, or while interview or exam result is entering */ public TransactionResponse getApplicantPassedToSecPhase(Vacancy vacancy) { TransactionResponse response = new TransactionResponse(); try { //Add List of Arguments for new employee IDictionary<string, object> parameters = new Dictionary<string, object>(); parameters.Add("@vacancyNo", vacancy.VacancyNo); parameters.Add("@vacancyDate", vacancy.PostedDate); DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spGetApplicantPassedToSecPhase, parameters); DataTable appResult = dpOperation.getRecord(); response.Data = appResult; response.setMessageType(TransactionResponse.SeverityLevel.SUCESS); response.setMessage(DBOperationErrorConstants.M_REPORT_GENERATED_SUCCESS); response.setSuccess(true); return response; } catch (SqlException ex) { //Other SqlException is catched response.setMessageType(TransactionResponse.SeverityLevel.ERROR); response.setMessage(DBOperationErrorConstants.M_UNABLE_TO_APPLICANT_RESULT); 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; }
public DataTable getUnassignedPromotion() { //Pass Stored Procedure Name and parameter list. IDictionary<string, object> parameters = new Dictionary<string, object>(); parameters.Add("@districtID", PageAccessManager.getDistrictID()); DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetPromotionAssignedToHROfficer, parameters); DataTable dataTable = null; try { return dataTable = storeToDb.getRecord(); } catch (SqlException ex) { //return emptylist return dataTable; } //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); return dataTable; } }
public DataTable getmanagerialPosition(string branch) { //Pass Stored Procedure Name and parameter list. //Add List of Arguments TO GET managerial position IDictionary<string, object> branchID = new Dictionary<string, object>(); branchID.Add("@branch", branch); DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetEmpAtManagerialPosition, branchID); DataTable dataTable = null; try { return dataTable = storeToDb.getRecord(); } catch (SqlException ex) { //return emptylist return dataTable; } //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); return dataTable; } }
public DataTable UpdateAssignedemployeefromOtherDistrict() { //prepare parameters IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@Emp_ID", employee.EmpID); argumentsMap.Add("@status", employee.Promstatus); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spUpdateListOfAssignedEmployeefromOtherDistrict, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); return dataTable; }
public DataTable UpdateAssignedemployee() { //prepare parameters IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@Emp_ID", employee.EmpID); argumentsMap.Add("@Prev_Job_Tittle", employee.PrevJob); argumentsMap.Add("@Job_Tittle", employee.JobTitle); argumentsMap.Add("@Grade", employee.JobGrade); argumentsMap.Add("@Salary", employee.Salary); argumentsMap.Add("@branch", employee.Branch); argumentsMap.Add("@status", employee.Promstatus); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spUpdateListOfAssignedEmployeeStatus, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); return dataTable; }
//Update Applicant Result public DataTable UpdateApplicantResult(VacancyEvaluationForm vacancyEvaluationForm, Vacancy vacancy) { //prepare parameters IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@Emp_ID", vacancyEvaluationForm.EmpId); argumentsMap.Add("@vacancy_No", vacancy.VacancyNo); argumentsMap.Add("@vacancy_date", vacancy.PostedDate); argumentsMap.Add("@education_level_mark", vacancyEvaluationForm.EducationLevelMark); argumentsMap.Add("@general_work_expr", vacancyEvaluationForm.GeneralWorkExpr); argumentsMap.Add("@specific_work_expr", vacancyEvaluationForm.SpecificWorkRxpr); argumentsMap.Add("@recommendation_of_mgr_line", vacancyEvaluationForm.RecommendationOfMgrLine); argumentsMap.Add("@interview_result_recommendation", vacancyEvaluationForm.InterviewResult); argumentsMap.Add("@remark", vacancyEvaluationForm.Remark); argumentsMap.Add("@evaluation_status", vacancyEvaluationForm.ApplicantStatus); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spUpdateApplicantDetailform1, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); return dataTable; }
/** * Checks if Employee is duplicate by selecting and checking returned result. */ public Boolean isEmployeeAlreadyExist() { //Add List of Arguments for new employee IDictionary<string, object> employeeIDArgumentaMap = new Dictionary<string, object>(); employeeIDArgumentaMap.Add("@Emp_ID", employee.EmpID); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetEmployeeDetail, employeeIDArgumentaMap); //get Record. DataTable dataTable = null; try { dataTable = storeToDb.getRecord(); //if there is anything returned it means employee is duplicate. return dataTable != null && dataTable.Rows.Count > 0; } catch (SqlException ex) { return 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); return false; } }
//Update Employee status public DataTable Updateemployee() { //prepare parameters IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@Emp_ID", employee.EmpID); argumentsMap.Add("@First_Name", employee.FName); argumentsMap.Add("@Middle_Name", employee.MName); argumentsMap.Add("@Last_Name", employee.LName); argumentsMap.Add("@Sex", employee.Sex); argumentsMap.Add("@Prev_Job_Tittle", employee.PrevJob); argumentsMap.Add("@Job_Tittle", employee.JobTitle); argumentsMap.Add("@Grade", employee.JobGrade); argumentsMap.Add("@Salary", employee.Salary); argumentsMap.Add("@branch", employee.Branch); argumentsMap.Add("@HDate", employee.Hdate); argumentsMap.Add("@MajorCategory", employee.MajorCategory); argumentsMap.Add("@district", employee.District); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spUpdateBranchEmployeeStatus, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); return dataTable; }
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; }
public DataTable getAllPromotedEmployee(string promotionStatus) { //prepare parameters IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@Promostatus", promotionStatus); DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetAllPromotedEmp, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); return dataTable; }
public DataTable UpdateemployeeEducationalQual(string EID, string eduLevel, string qualif) { //prepare parameters IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@Emp_ID", EID); argumentsMap.Add("@EducationLevel", eduLevel); argumentsMap.Add("@Qualification", qualif); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spUpdateEmpEducLevel, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); return dataTable; }
//this methode return a list of promoted or Assigned Employee for specified Post public DataTable getSpecifiedPromotionResult(int postID, string promotionOrAssigned) { //prepare parameters IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@Post", postID); argumentsMap.Add("@status", promotionOrAssigned); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spGetPromotedEmpBasedOnPostAndStatus, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); return dataTable; }
public DataTable UpdateHROfficerPMSResult(string EID, string vacNo, string evaFor, string grade, string remark) { //prepare parameters IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@hr_office_EID", EID); argumentsMap.Add("@vacancy_No", vacNo); argumentsMap.Add("@evaluated_for", evaFor); argumentsMap.Add("@grade", grade); argumentsMap.Add("@remark", remark); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spUpdateHROfficerClerkPMSResult, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); return dataTable; }
//Update Promoted Employee Status public DataTable UpdatePromotedemployee() { //prepare parameters IDictionary<string, object> argumentsMap = new Dictionary<string, object>(); argumentsMap.Add("@prev_branch", promotion.PrevBranch); argumentsMap.Add("@branch", promotion.Branch); argumentsMap.Add("@Post", promotion.Post); argumentsMap.Add("@status", promotion.Status); argumentsMap.Add("@Minute_No", promotion.MinuteNo); argumentsMap.Add("@promotionDate", promotion.PromotionDate); //Pass Stored Procedure Name and parameter list. DBOperationsUtil storeToDb = new DBOperationsUtil(DbAccessConstants.spUpdatePromotedEmp, argumentsMap); //call getRecord method and get DataTable DataTable dataTable = storeToDb.getRecord(); return dataTable; }
public static Employee getLoggedOnUser(Guid userId) { //Add List of Arguments for new employee IDictionary<string, object> userIdMap = new Dictionary<string, object>(); userIdMap.Add("@UserId", userId); //Pass Stored Procedure Name and parameter list. DBOperationsUtil dbOperation = new DBOperationsUtil(DbAccessConstants.spGetLoggedOnUser, userIdMap); //get Record. DataTable dataTable = null; Employee employee = null; try { dataTable = dbOperation.getRecord(); employee = new Employee(); if (dataTable != null) { foreach (DataRow row in dataTable.Rows) { employee = new Employee(); employee.FName = row["First_Name"].ToString(); employee.EmpID = row["Emp_ID"].ToString(); } } return employee; } catch (SqlException ex) { return employee; } //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); return employee; } }