示例#1
0
        [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));
        }
示例#2
0
        [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"));
        }
示例#3
0
        [WebMethod(EnableSession = true)] //Session required by SessionCustomerRepository
        public IEnumerable <SelectListItem> GetDropDownItems()
        {
            Thread.Sleep(1000);

            return(new SelectList(SessionProductRepository.All(), "ProductID", "ProductName"));
        }
示例#4
0
        [WebMethod(EnableSession = true)] //Session required by SessionCustomerRepository
        public GridModel Delete(EditableProduct value, GridState state)
        {
            SessionProductRepository.Delete(value);

            return(SessionProductRepository.All().AsQueryable().ToGridModel(state));
        }
示例#5
0
 [WebMethod(EnableSession = true)] //Session required by SessionCustomerRepository
 public GridModel Select(GridState state)
 {
     return(SessionProductRepository.All().AsQueryable().ToGridModel(state));
 }
示例#6
0
        public GridModel Insert(GridState state, EditableProduct value)
        {
            SessionProductRepository.Insert(value);

            return(SessionProductRepository.All().AsQueryable().ToGridModel(state));
        }