public List<State> GetStates()
        {
            currentContext.Trace.Warn("GetStates Called");

            //create an instance of database
            VapeEntities db = new VapeEntities();

            //fill list colection
            List<State> states = db.States.ToList();

            var sortedList = states.OrderBy(s => s.State1)
                                    .ToList();

            return states;
        }
示例#2
0
        public List <Category> GetCategories()
        {
            curretnContext.Trace.Warn("GetCategories method called!");

            //Create an instance of datebase
            VapeEntities db = new VapeEntities();

            //fill list collection
            List <Category> categories = db.Categories.ToList();

            var sortedList = categories.OrderBy(s => s.Category1)
                             .ToList();

            return(categories);
        }
        public List <product> GetSelectedProduct(int parSKU)
        {
            currentContext.Trace.Warn("GetSelectedProducts method called!");
            currentContext.Trace.Warn("parSKU =" + parSKU);
            //create an instance of database
            VapeEntities db = new VapeEntities();

            //fill list collection
            List <product> products = db.products.ToList();

            var sortedList = products.Where(s => s.SKU == parSKU)
                             .ToList();

            return(sortedList);
        }
        public List <product> GetProducts()
        {
            currentContext.Trace.Warn("GetProducts method called!");

            //create an instance of database
            VapeEntities db = new VapeEntities();

            //fill list collection
            List <product> products = db.products.ToList();

            var sortedList = products.OrderBy(s => s.Product_Name)
                             .ToList();

            return(sortedList);
        }
示例#5
0
      public List <Customer> GetSelectedCustomer(string parStateID)
      {
          currentContext.Trace.Warn("GetSelectedState method called");
          currentContext.Trace.Warn("ParStateID = " + parStateID);

          //create an instance of the ef database
          VapeEntities db = new VapeEntities();

          //fill a list collection
          List <Customer> customers = db.Customers.ToList();

          var sortedList = customers.Where(s => s.State == parStateID)
                           .ToList();

          return(sortedList);
      }
        public List <product> GetProductsbyCategory(string parCategoryID)
        {
            currentContext.Trace.Warn("GetProducts method called!");
            currentContext.Trace.Warn("parCategoryID =" + parCategoryID);

            //create an instance of database
            VapeEntities db = new VapeEntities();

            //fill list collection
            List <product> products = db.products.ToList();

            var sortedList = products.Where(s => s.CategoryID == parCategoryID)
                             .OrderBy(s => s.Product_Name)
                             .ToList();

            return(sortedList);
        }