public List <StockDistributionModel> GetSelectedData(Model.StockEnquiryModel searchData) { var body = JsonConvert.SerializeObject(searchData); var searchDataList = ServerResponse.Invoke <List <StockDistributionModel> >("api/stockDistributions/getSelectedData", body, "POST"); return(searchDataList); }
public List <StockInventoryModel> GetAll(Model.StockEnquiryModel searchData) { var body = JsonConvert.SerializeObject(searchData); var Searchlist = ServerResponse.Invoke <List <StockInventoryModel> >("api/stockInventory/getDetailList", body, "POST"); return(Searchlist); }
public IHttpActionResult GetSearchData(Model.StockEnquiryModel searchData) { var list = db.StockDistributions.Where(x => x.IsActive == true).Include(x => x.Branch).Include(x => x.Product).Include(x => x.Product.Color); if (searchData != null) { if (!string.IsNullOrEmpty(searchData.BranchName)) { list = list.Where(x => x.Branch.Name.Contains(searchData.BranchName)); } if (!string.IsNullOrEmpty(searchData.ProductSKU)) { list = list.Where(x => x.Product.ProductSKU == searchData.ProductSKU); } if (!string.IsNullOrEmpty(searchData.StyleSKU)) { list = list.Where(x => x.Product.StyleSKU == searchData.StyleSKU); } if (!string.IsNullOrEmpty(searchData.ColorCode)) { list = list.Where(x => x.Product.Color.Code.Contains(searchData.ColorCode)); } } return(Ok(list.ToList().RemoveReferences())); }