예제 #1
0
        private void MyItemSelectedMethod3(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            var index = e.Position;

            var value = myUnit1[index];

            if (value == "All Categories")
            {
                showProductList();
            }
            else
            {
                category_dict.TryGetValue(value, out cat);
                ic          = myDB.product_list1(cat);
                myUsersList = new List <UserObject_Order>();
                int i = 0;
                while (ic.MoveToNext())
                {
                    var a = ic.GetString(ic.GetColumnIndex("pro_name"));
                    var b = ic.GetInt(ic.GetColumnIndex("purchase_price"));
                    var c = ic.GetInt(ic.GetColumnIndex("pro_id"));
                    Console.WriteLine(a);
                    Console.WriteLine(b);

                    myUsersList.Add(new UserObject_Order(a, b, c));
                    i++;
                }
                myCAdapter        = new Order_CustomAdapter(this, myUsersList);
                listView1.Adapter = myCAdapter;
            }
        }
예제 #2
0
        public void showProductList()
        {
            ic = myDB.product_list();

            int i = 0;

            myUsersList = new List <UserObject_Order>();
            while (ic.MoveToNext())
            {
                var a = ic.GetString(ic.GetColumnIndex("pro_name"));
                var b = ic.GetInt(ic.GetColumnIndex("purchase_price"));
                var c = ic.GetInt(ic.GetColumnIndex("pro_id"));
                Console.WriteLine(a);
                Console.WriteLine(b);
                myUsersList.Add(new UserObject_Order(a, b, c));
                i++;
            }
            myCAdapter        = new Order_CustomAdapter(this, myUsersList);
            listView1.Adapter = myCAdapter;
        }
예제 #3
0
        private void Sv_QueryTextChange(object sender, Android.Widget.SearchView.QueryTextChangeEventArgs e)
        {
            UserObject_Order        myObj;
            List <UserObject_Order> mylist = new List <UserObject_Order>();
            //throw new System.NotImplementedException();
            var mySearchValue = e.NewText;

            System.Console.WriteLine("Search Text is :  is \n\n " + mySearchValue);

            for (int i = 0; i < myUsersList.Count; i++)
            {
                myObj = myUsersList[i];
                if (myObj.name.ToLower().Contains(mySearchValue))
                {
                    mylist.Add(myUsersList[i]);
                }
            }

            searchAdapter     = new Order_CustomAdapter(this, mylist);
            listView1.Adapter = searchAdapter;
        }