//--Get by Inactive Data-- public List <CompetitorsDTO> GetInActiveCompetitors(CompetitorsGetDTO objCompetitors) { List <CompetitorsDTO> InActiveList = new List <CompetitorsDTO>(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("spSelectCompetitors"); SqlCmd.CommandType = CommandType.StoredProcedure; SqlCmd.Parameters.AddWithValue("@ActionBy", objCompetitors.ActionBy); InActiveList = dbLayer.GetEntityList <CompetitorsDTO>(SqlCmd); } return(InActiveList); }
//--Get by Id Based Data public List <CompetitorsDTO> GetCompetitorsById(CompetitorsGetDTO objCompetitors) { List <CompetitorsDTO> competitors = new List <CompetitorsDTO>(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("spSelectCompetitors"); SqlCmd.CommandType = CommandType.StoredProcedure; SqlCmd.Parameters.AddWithValue("@ClientId", objCompetitors.ClientId); SqlCmd.Parameters.AddWithValue("@ActionBy", objCompetitors.ActionBy); competitors = dbLayer.GetEntityList <CompetitorsDTO>(SqlCmd); } return(competitors); }
public HttpResponseMessage GetCompetitorsById(CompetitorsGetDTO objCompetitors) { HttpResponseMessage message; try { CompetitorsDataAccessLayer dal = new CompetitorsDataAccessLayer(); var dynObj = new { result = dal.GetCompetitorsById(objCompetitors) }; message = Request.CreateResponse(HttpStatusCode.OK, dynObj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Somthing wrong, Try Again!" }); ErrorLog.CreateErrorMessage(ex, "Competitors", "GetAllCompetitors"); } return(message); }