Exemplo 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();
        }
Exemplo 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);
            });
        }
Exemplo 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();
            }
        }
Exemplo 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();
            }
        }
Exemplo 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();
            }
        }
Exemplo 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);
            });
        }
Exemplo 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();
            }
        }
Exemplo n.º 8
0
 public ItemStocksAdapter(Context context, ItemStocks items)
     : base(context, R.Layouts.ItemStocksAdapter_Layout)
 {
     this.Update(items);
 }