public List <getAllCustomerDTO> GetAllCustomer(getCustomerDTO objCustomer) { List <getAllCustomerDTO> site = new List <getAllCustomerDTO>(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("spSiteMappingCustomer"); SqlCmd.Parameters.AddWithValue("@ActionBy", objCustomer.ActionBy); SqlCmd.CommandType = CommandType.StoredProcedure; site = dbLayer.GetEntityList <getAllCustomerDTO>(SqlCmd); } return(site); }
public HttpResponseMessage getAllCustomer(getCustomerDTO branch) { HttpResponseMessage message; try { // SiteMappingDataAccessLayer dal = new SiteMappingDataAccessLayer(); var dynObj = new { result = _Site.GetAllCustomer(branch) }; message = Request.CreateResponse(HttpStatusCode.OK, dynObj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Something wrong. Try Again!" }); ErrorLog.CreateErrorMessage(ex, "SiteMapping", "getAllCustomer"); } return(message); }