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

            return(new SelectList(SessionProductRepository.All(), "ProductID", "ProductName"));
        }
Exemple #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));
        }
Exemple #5
0
 [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));
        }