protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.Payment); txtCardNaam = FindViewById <EditText>(Resource.Id.txtCardName); txtCardNum = FindViewById <EditText>(Resource.Id.txtCardNumber); txtCvv = FindViewById <EditText>(Resource.Id.txtCCV); makePayment = FindViewById <Button>(Resource.Id.btnMakePayment); txtCustId = FindViewById <EditText>(Resource.Id.txtCustomerid); email = Intent.GetStringExtra("Email"); password = Intent.GetStringExtra("Password"); service sv = new service(); Customer ct = sv.GetCusts(email, password); txtCustId.Text = ct.Customer_Id.ToString(); makePayment.Click += MakePayment_Click; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.Checkout); deliveryAddress = FindViewById <EditText>(Resource.Id.txtDeliveryAddress); cardName = FindViewById <EditText>(Resource.Id.txtCardName); cardNumber = FindViewById <EditText>(Resource.Id.txtCardNumber); cardCcv = FindViewById <EditText>(Resource.Id.txtCCV); CustId = FindViewById <EditText>(Resource.Id.txtCustomerid); btnOrder = FindViewById <Button>(Resource.Id.btnOrder); totalAmont = Intent.GetStringExtra("total"); qnty = Intent.GetStringExtra("quantity"); Email = Intent.GetStringExtra("Email"); Password = Intent.GetStringExtra("Password"); cust = sev.GetCusts(Email, Password); // Email = Intent.GetStringExtra("Email"); Password = Intent.GetStringExtra("Password"); service sv = new service(); Customer ct = sv.GetCusts(Email, Password); //CustId.Text = ct.Customer_Id.ToString(); // btnOrder.Click += BtnOrder_Click; }
private void BtnLogin_Click(object sender, EventArgs e) { try { //client = new HttpClient(); service serDt = new service(); //DataAccess datA = new DataAccess(); Customer cust = new Customer(); cust = serDt.GetCusts(txtE.Text, txtP.Text); if (String.IsNullOrEmpty(txtE.Text) && String.IsNullOrEmpty(txtP.Text)) { Toast.MakeText(this, "Email and password can't be empty, please provide correct information", ToastLength.Short).Show(); } else if (txtE.Text == cust.Email && txtP.Text == cust.Password) { Android.App.AlertDialog.Builder dialog = new AlertDialog.Builder(this); AlertDialog alert = dialog.Create(); alert.SetTitle(" Login "); alert.SetMessage("Successfully logged on as " + cust.Firstname + " " + cust.Lastname); alert.SetButton("OK", (c, ev) => { // Ok button click task Intent ti = new Intent(this, typeof(RestuarantActivity)); ti.PutExtra("Email", cust.Email); ti.PutExtra("Password", cust.Password); StartActivity(ti); }); alert.Show(); //Toast.MakeText(this, "Successfully logged in " + cust.Firstname + cust.Lastname, ToastLength.Short).Show(); //Intent ti = new Intent(this, typeof(RestuarantActivity)); //StartActivity(ti); } else { Toast.MakeText(this, "Incorrect login details. Register if you havent registered.", ToastLength.Short).Show(); } } catch (Exception ex) { Toast.MakeText(this, ex.ToString(), ToastLength.Short).Show(); } }