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(); }
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(); } }
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 }