Exemplo n.º 1
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     SetContentView(Resource.Layout.updateamount);
     // Create your application here
     ivProduct      = FindViewById <ImageView>(Resource.Id.ivProduct);
     tvTitle        = FindViewById <TextView>(Resource.Id.tvTitle);
     tvAge          = FindViewById <TextView>(Resource.Id.tvprudactid);
     tvPrice        = FindViewById <TextView>(Resource.Id.tvPrice);
     tvpayment      = FindViewById <TextView>(Resource.Id.tvpayment);
     etamount       = FindViewById <EditText>(Resource.Id.etamount);
     btnaddtomylist = FindViewById <Button>(Resource.Id.btnaddtomylist);
     btnaddtomylist.SetOnClickListener(this);
     btncalculate = FindViewById <Button>(Resource.Id.btncalculate);
     btncalculate.SetOnClickListener(this);
     btncancle = FindViewById <Button>(Resource.Id.btncancle);
     btncancle.SetOnClickListener(this);
     pos  = Intent.GetIntExtra("pos", -1);
     pos1 = Intent.GetIntExtra("pos1", -1);
     pos2 = Intent.GetIntExtra("pos2", -1);
     if (pos != -1)
     {
         temp = SportToyActivity.SporttoyList[pos];
         pw   = Helper.BitmapToBase64(temp.GetPic());
         ivProduct.SetImageBitmap(temp.GetPic());
         tvAge.Text     = temp.GetAge().ToString();
         tvTitle.Text   = temp.GetName();
         tvPrice.Text   = temp.GetPrice().ToString();
         tvpayment.Text = "0";
     }
     else if (pos1 != -1)
     {
         temp1 = WarToyActivity.WarToyList[pos1];
         pw    = Helper.BitmapToBase64(temp1.GetPic());
         ivProduct.SetImageBitmap(temp1.GetPic());
         tvAge.Text     = temp1.GetAge().ToString();
         tvTitle.Text   = temp1.GetName();
         tvPrice.Text   = temp1.GetPrice().ToString();
         tvpayment.Text = "0";
     }
     else if (pos2 != -1)
     {
         temp2 = BoxGamesActivity.boxgamesList[pos2];
         pw    = Helper.BitmapToBase64(temp2.GetPic());
         //pw = temp2.GetPic();
         ivProduct.SetImageBitmap(temp2.GetPic());
         tvAge.Text     = temp2.GetAge().ToString();
         tvTitle.Text   = temp2.GetName();
         tvPrice.Text   = temp2.GetPrice().ToString();
         tvpayment.Text = "0";
     }
 }