public List<getAllEmployeeByDesignation> GetAllEmployee(getEmployeeByDesignation des) { List<getAllEmployeeByDesignation> desList = new List<getAllEmployeeByDesignation>(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("SpSalaryAllocationByEmployeeType"); SqlCmd.Parameters.AddWithValue("@EmployeeType", des.EmployeeType); SqlCmd.Parameters.AddWithValue("@DesignationId", des.DesignationId); SqlCmd.Parameters.AddWithValue("@ActionBy", des.ActionBy); SqlCmd.CommandType = CommandType.StoredProcedure; desList = dbLayer.GetEntityList<getAllEmployeeByDesignation>(SqlCmd); } return desList; }
public HttpResponseMessage GetAllEmployee(getEmployeeByDesignation obj) { HttpResponseMessage message; try { // salaryAllocationDataAccessLayer dal = new salaryAllocationDataAccessLayer(); var dynObj = new { result = _SalaryAllocation.GetAllEmployee(obj) }; message = Request.CreateResponse(HttpStatusCode.OK, dynObj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Somthing wrong, Try Again!" }); ErrorLog.CreateErrorMessage(ex, "SalaryAllocation", "GetAllEmployee"); } return(message); }