示例#1
0
        public List <string> Print(string fileName)
        {
            this.fileName = fileName + " invoice";
            SaveAndLoad.DeleteText(this.fileName);
            itemList = ItemPrice.OrderWiev(fileName).ToList();


            return(itemList);
        }
示例#2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.order);

            var createAdd  = FindViewById <Button>(Resource.Id.createAdd);
            var itemList   = FindViewById <ListView>(Resource.Id.orderView);
            var closeOrder = FindViewById <Button>(Resource.Id.closeOrder);
            var tnText     = FindViewById <TextView>(Resource.Id.tableNumber);
            var viewLast   = FindViewById <Button>(Resource.Id.viewLast);

            if (tNumber == 0)
            {
                tNumber = Intent.GetIntExtra("tableNumber", 0);
            }


            tnText.Text = "Table number " + tNumber;



            createAdd.Click += (object sender, EventArgs e) =>
            {
                var intent = new Intent(this, typeof(itemChoose));
                intent.PutExtra("tNumber", tNumber);
                StartActivity(intent);
            };

            closeOrder.Click += (object sender, EventArgs e) =>
            {
                AlertDialog.Builder builder = new AlertDialog.Builder(this);
                builder.SetTitle("Are you sure you want to close this order?");
                builder.SetCancelable(false);
                builder.SetPositiveButton("Print invoice", (s, f) =>
                {
                    PrintInvoice invoice = new PrintInvoice();
                    invoice.Print(ItemPrice.tableFile + tNumber);
                    invoice.Output();
                    SaveAndLoad.DeleteText(ItemPrice.tableFile + tNumber);
                });

                builder.SetNegativeButton("Cancel", (s, f) => { });
                builder.Create().Show();
            };
            viewLast.Click += (object sender, EventArgs e) =>
            {
                var intent = new Intent(this, typeof(Invoice));
                intent.PutExtra("fileName", ItemPrice.tableFile + tNumber + " invoice");
                StartActivity(intent);
            };
        }