public List <EmployeeRoleInfo> getAllEmployeeRole() { SqlConnectionFactory sqlConnection = new SqlConnectionFactory(); using (SqlConnection connection = sqlConnection.GetConnection()) { List <EmployeeRoleInfo> ListEmployeeRole = EmployeeRoleDataLayer.GetInstance().GetAllEmployeeRole(connection); return(ListEmployeeRole); } }
public ActionMessage deleteEmployeeRole(int id) { ActionMessage ret = new ActionMessage(); SqlConnectionFactory sqlConnection = new SqlConnectionFactory(); using (SqlConnection connection = sqlConnection.GetConnection()) { try { EmployeeRoleDataLayer.GetInstance().DeleteEmployeeRole(connection, id); ret.isSuccess = true; } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "Internal Error"; ret.err.msgString = ex.ToString(); } } return(ret); }