public List<getAllSalaryAllocation> GetAllSalaryReport(getSalaryAllocation des) { List<getAllSalaryAllocation> desList = new List<getAllSalaryAllocation>(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("SpSelectSalaryReport"); SqlCmd.Parameters.AddWithValue("@EmployeeId", (des.EmployeeId == 0) ? null : des.EmployeeId); SqlCmd.Parameters.AddWithValue("@ManpowerId", (des.ManpowerId == 0) ? null : des.ManpowerId); SqlCmd.Parameters.AddWithValue("@ActionBy", des.ActionBy); SqlCmd.CommandType = CommandType.StoredProcedure; desList = dbLayer.GetEntityList<getAllSalaryAllocation>(SqlCmd); } return desList; }
public HttpResponseMessage GetAllSalaryByEmployee(getSalaryAllocation obj) { HttpResponseMessage message; try { // salaryAllocationDataAccessLayer dal = new salaryAllocationDataAccessLayer(); var dynObj = new { result = _SalaryAllocation.GetAllSalaryAllocation(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", "GetAllSalaryByEmployee"); } return(message); }