예제 #1
0
        protected void Okienko_Dodaj(int position)
        {
            AlertDialog.Builder builder     = new AlertDialog.Builder(mContext);
            AlertDialog         alertDialog = builder.Create();

            alertDialog.SetTitle("Czy chcesz dodaæ produkt do koszyka?");
            alertDialog.SetMessage(mItems[position].Name + "\nCena: " + mItems[position].Price);
            alertDialog.SetButton2("Tak", (s, ev) => { Kosz.Add_produkt(mItems[position]); alertDialog.Cancel(); });
            alertDialog.SetButton("Nie", (s, ev) => { alertDialog.Cancel(); });
            alertDialog.Show();
        }
예제 #2
0
 protected void Okienko_Usun(int position)
 {
     try
     {
         AlertDialog.Builder builder     = new AlertDialog.Builder(mContext);
         AlertDialog         alertDialog = builder.Create();
         alertDialog.SetTitle("Czy chcesz usun¹æ produkt z koszyka?");
         alertDialog.SetMessage(mItems[position].Name + "\nCena: " + mItems[position].Price);
         alertDialog.SetButton2("Tak", (s, ev) => { Kosz.Del_produkt(mItems[position]); NotifyDataSetChanged(); alertDialog.Cancel(); });
         alertDialog.SetButton("Nie", (s, ev) => { alertDialog.Cancel(); });
         alertDialog.Show();
     }
     catch
     {
         NotifyDataSetChanged();
     }
 }
예제 #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Koszyk);
            Context context = this;

            mListView = FindViewById <ListView>(Resource.Id.kosz_listview);
            MyViewAdapter adapter = new MyViewAdapter(this, Kosz.lista, Resource.Layout.Koszyk);

            mListView.Adapter = adapter;

            #region suma
            Button zatwierc = FindViewById <Button>(Resource.Id.kosz_zatwierc);
            text_suma = FindViewById <TextView>(Resource.Id.kosz_cena);
            Kosz.Set_Sum(text_suma);

            #endregion

            // Create your application here
        }