[WebMethod(EnableSession = true)] //Session required by SessionCustomerRepository public IEnumerable <string> GetProductNames(string text) { Thread.Sleep(1000); List <EditableProduct> products = SessionProductRepository.All().Where((p) => p.ProductName.StartsWith(text, System.StringComparison.OrdinalIgnoreCase)).ToList(); return(products.Select(p => p.ProductName)); }
[WebMethod(EnableSession = true)] //Session required by SessionCustomerRepository public IEnumerable <SelectListItem> GetDropDownItemsWithParams(string text) { Thread.Sleep(1000); List <EditableProduct> products = SessionProductRepository.All().Where((p) => p.ProductName.StartsWith(text, System.StringComparison.OrdinalIgnoreCase)).ToList(); return(new SelectList(products, "ProductID", "ProductName")); }
[WebMethod(EnableSession = true)] //Session required by SessionCustomerRepository public IEnumerable <SelectListItem> GetDropDownItems() { Thread.Sleep(1000); return(new SelectList(SessionProductRepository.All(), "ProductID", "ProductName")); }
[WebMethod(EnableSession = true)] //Session required by SessionCustomerRepository public GridModel Delete(EditableProduct value, GridState state) { SessionProductRepository.Delete(value); return(SessionProductRepository.All().AsQueryable().ToGridModel(state)); }
[WebMethod(EnableSession = true)] //Session required by SessionCustomerRepository public GridModel Select(GridState state) { return(SessionProductRepository.All().AsQueryable().ToGridModel(state)); }
public GridModel Insert(GridState state, EditableProduct value) { SessionProductRepository.Insert(value); return(SessionProductRepository.All().AsQueryable().ToGridModel(state)); }