public List <SalaryCompensateDTO> GetAllSalaryCompensate(SalaryCompensateGetDTO objSalary) { List <SalaryCompensateDTO> salary = new List <SalaryCompensateDTO>(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("spSelectSalaryComponent"); SqlCmd.CommandType = CommandType.StoredProcedure; SqlCmd.Parameters.AddWithValue("@ActionBy", objSalary.ActionBy); salary = dbLayer.GetEntityList <SalaryCompensateDTO>(SqlCmd); } return(salary); }
public SalaryCompensateDTO GetSalaryCompensateById(SalaryCompensateGetDTO objSalary) { SalaryCompensateDTO accounts = new SalaryCompensateDTO(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("spSelectSalaryComponent"); SqlCmd.CommandType = CommandType.StoredProcedure; SqlCmd.Parameters.AddWithValue("@Id", objSalary.Id); SqlCmd.Parameters.AddWithValue("@ActionBy", objSalary.ActionBy); accounts = dbLayer.GetEntityList <SalaryCompensateDTO>(SqlCmd).FirstOrDefault(); } return(accounts); }
public HttpResponseMessage GetSalaryComponsateById(SalaryCompensateGetDTO objSalary) { HttpResponseMessage message; try { SalaryCompensateDataAccessLayer dal = new SalaryCompensateDataAccessLayer(); var dynObj = new { result = dal.GetSalaryCompensateById(objSalary) }; message = Request.CreateResponse(HttpStatusCode.OK, dynObj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Somthing wrong, Try Again!" }); ErrorLog.CreateErrorMessage(ex, "Salary", "GetSalaryById"); } return(message); }