Esempio n. 1
0
        public void Update(ItemStocks items)
        {
            var sortedList = from ItemStocks.StockItem item in items.Items
                             orderby item.Qty
                             select item;

            this.AddAll(sortedList.ToArray());
            this.NotifyDataSetInvalidated();
        }
Esempio n. 2
0
        void ParseItemStocks(string httpRes)
        {
            var xml = XDocument.Parse(httpRes);

            {
                XElement   root = xml.Root;
                ItemStocks data = new ItemStocks(root);
                _savedInstance = data;
            }

            RunOnUiThread(() =>
            {
                PopulateItems(_savedInstance);
            });
        }
Esempio n. 3
0
        protected override void OnCreate(Bundle savedInstance)
        {
            base.OnCreate(savedInstance);
            SetContentView(R.Layouts.ItemStocksActivity_Layout);

            this.ActionBar.SetDisplayHomeAsUpEnabled(true);

            var itemStocks = LastNonConfigurationInstance as ItemStocks;
            if (itemStocks != null)
            {
                PopulateItems(itemStocks);
                _savedInstance = itemStocks;
            }
            else
            {
                RefreshItems();
            }
        }
Esempio n. 4
0
        void PopulateItems(ItemStocks items)
        {
            var listView = FindViewById <ListView>(R.Ids.itemStocksListView);

            if (listView.Adapter == null)
            {
                listView.Adapter = new ItemStocksAdapter(this, items);
            }
            else
            {
                ((ItemStocksAdapter)listView.Adapter).Update(items);
            }
            listView.ItemClick += new EventHandler <ItemClickEventArgs>(listView_ItemClick);

            if (pd != null)
            {
                pd.Dismiss();
            }
        }
Esempio n. 5
0
        protected override void OnCreate(Bundle savedInstance)
        {
            base.OnCreate(savedInstance);
            SetContentView(R.Layouts.ItemStocksActivity_Layout);

            this.ActionBar.SetDisplayHomeAsUpEnabled(true);

            var itemStocks = LastNonConfigurationInstance as ItemStocks;

            if (itemStocks != null)
            {
                PopulateItems(itemStocks);
                _savedInstance = itemStocks;
            }
            else
            {
                RefreshItems();
            }
        }
Esempio n. 6
0
        void ParseItemStocks(string httpRes)
        {
            var xml = XDocument.Parse(httpRes);
            {
                XElement root = xml.Root;
                ItemStocks data = new ItemStocks(root);
                _savedInstance = data;
            }

            RunOnUiThread(() =>
            {
                PopulateItems(_savedInstance);
            });
        }
Esempio n. 7
0
        void PopulateItems(ItemStocks items)
        {
            var listView = FindViewById<ListView>(R.Ids.itemStocksListView);
            if (listView.Adapter == null)
            {
                listView.Adapter = new ItemStocksAdapter(this, items);
            }
            else
            {
                ((ItemStocksAdapter)listView.Adapter).Update(items);
            }
            listView.ItemClick += new EventHandler<ItemClickEventArgs>(listView_ItemClick);

            if (pd != null)
            {
                pd.Dismiss();
            }
        }
Esempio n. 8
0
 public ItemStocksAdapter(Context context, ItemStocks items)
     : base(context, R.Layouts.ItemStocksAdapter_Layout)
 {
     this.Update(items);
 }