public List <string> Print(string fileName) { this.fileName = fileName + " invoice"; SaveAndLoad.DeleteText(this.fileName); itemList = ItemPrice.OrderWiev(fileName).ToList(); return(itemList); }
protected override void OnResume() { base.OnResume(); var createAdd = FindViewById <Button>(Resource.Id.createAdd); var itemList = FindViewById <ListView>(Resource.Id.orderView); var closeOrder = FindViewById <Button>(Resource.Id.closeOrder); var viewLast = FindViewById <Button>(Resource.Id.viewLast); string[] order = ItemPrice.OrderWiev(ItemPrice.tableFile + tNumber); itemList.Adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, order); if (itemList.Adapter.Count == 0) { createAdd.Text = "Create new order"; closeOrder.Clickable = false; } else { createAdd.Text = "Add item"; closeOrder.Clickable = true; } }
protected override void OnResume() { base.OnResume(); Button addNew = FindViewById <Button>(Resource.Id.addNew); Button mdItem = FindViewById <Button>(Resource.Id.mdItem); var listview = FindViewById <ListView>(Resource.Id.itemView); listview.Adapter = new ArrayAdapter <String>(this, Android.Resource.Layout.SimpleListItem1, ItemPrice.PriceListLines("priceList.txt")); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.priceList); Button addNew = FindViewById <Button>(Resource.Id.addNew); Button mdItem = FindViewById <Button>(Resource.Id.mdItem); var listview = FindViewById <ListView>(Resource.Id.itemView); //SaveAndLoad.DeleteText("priceList.txt"); /*ItemPrice kava = new ItemPrice("Kava", 1); * ItemPrice kavaMleko = new ItemPrice("Kava z mlekom", 1.2); * ItemPrice kavaSmetana = new ItemPrice("Kava s smetano", 1.4); * kava.WriteToFile(); * kavaMleko.WriteToFile(); * kavaSmetana.WriteToFile(); */ listview.Adapter = new ArrayAdapter <String>(this, Android.Resource.Layout.SimpleListItem1, ItemPrice.PriceListLines("priceList.txt")); addNew.Click += (object sender, EventArgs e) => { var intent = new Intent(this, typeof(addNew)); StartActivity(intent); }; mdItem.Click += (object sender, EventArgs e) => { var intent = new Intent(this, typeof(Modify)); StartActivity(intent); }; }