public List <getAllBranchByCustomerDTO> GetAllBranch(getBranchDTO objBranch) { List <getAllBranchByCustomerDTO> barnch = new List <getAllBranchByCustomerDTO>(); using (DbLayer dbLayer = new DbLayer()) { SqlCommand SqlCmd = new SqlCommand("spSelectBranch"); SqlCmd.Parameters.AddWithValue("@CustomerId", objBranch.CustomerId); SqlCmd.Parameters.AddWithValue("@ActionBy", objBranch.ActionBy); SqlCmd.CommandType = CommandType.StoredProcedure; barnch = dbLayer.GetEntityList <getAllBranchByCustomerDTO>(SqlCmd); } return(barnch); }
public HttpResponseMessage getBranch(getBranchDTO branch) { HttpResponseMessage message; try { // SiteMappingDataAccessLayer dal = new SiteMappingDataAccessLayer(); var dynObj = new { result = _Site.GetAllBranch(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", "getBranch"); } return(message); }