public List<getAllDesignationByDepartment> GetAllDesignation(getDesignationByDepartment des) { List<getAllDesignationByDepartment> desList = new List<getAllDesignationByDepartment>(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("SpSalaryAllocationByEmployeeType"); SqlCmd.Parameters.AddWithValue("@DepartmentId", des.DepartmentId); SqlCmd.Parameters.AddWithValue("@ActionBy", des.ActionBy); SqlCmd.CommandType = CommandType.StoredProcedure; desList = dbLayer.GetEntityList<getAllDesignationByDepartment>(SqlCmd); } return desList; }
public HttpResponseMessage GetAllDesignation(getDesignationByDepartment obj) { HttpResponseMessage message; try { // salaryAllocationDataAccessLayer dal = new salaryAllocationDataAccessLayer(); var dynObj = new { result = _SalaryAllocation.GetAllDesignation(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", "GetAllDesignation"); } return(message); }