예제 #1
0
		public async void ValidaControl(ImageButton valor)
		{
			valor.Background = new ColorDrawable (Color.ParseColor ("#b0ff00"));

			if (IndexControl==int.Parse(valor.Tag.ToString())) {

				IndexControl = IndexControl + 1;

				if (IndexControl == 5) {

				//	Toast.MakeText (this,"+20 pesos a tu cuanta", ToastLength.Short).Show ();

					using (var _Bussines = new Bussines ()) {

						//	listViews = await	_Bussines.GetAllPublicViews ();

						var IdCategory=this.Intent.GetStringExtra("IdCategory");

						CurrentPublicView = await	_Bussines.GetPublicViewsByIdUser(DatoUser.Id,IdCategory, Helpers.EncriptarSHA1 (Imei));

						if (CurrentPublicView != null) {

							Intervalo = CurrentPublicView.TimerOut;
							WebView.LoadUrl (CurrentPublicView.Url);
							PuntosR = PuntosR + CurrentPublicView.Point;

							TxtPuntosR.Text = PuntosR.ToString ();
							
							if (PuntosR >= 1000) {

								TxtPuntosRR.Text = (PuntosRR + int.Parse (TxtPuntosRR.Text.ToString ())).ToString ();

								PuntosR = 0;
							}

							if (DatoUser != null) {

								using (var bussines = new Bussines ()) {

									TxtPuntosR.Text= (await bussines.UpdatePoint (DatoUser.Id, CurrentPublicView.Id, Helpers.EncriptarSHA1 (Imei))).ToString();

								}

							}

						} else {

							WebView.LoadUrl ("http://www.viewin.co/viewpublics/aut.html");
						}

					}



//					if (GetCountViews () < listViews.Count) {
//
//						var Pv = listViews [GetCountViews ()];
//						Intervalo = Pv.TimerOut;
//						WebView.LoadUrl (Pv.Url);
//						var index =	GetCountViews () + 1;
//						SetCountViews (index);
////
////						PuntosR = PuntosR + Pv.Point;
////
////						TxtPuntosR.Text = PuntosR.ToString ();
//
//						if (PuntosR >= 1000) {
//
//							TxtPuntosRR.Text = (PuntosRR + int.Parse (TxtPuntosRR.Text.ToString ())).ToString ();
//
//							PuntosR = 0;
//						}
//
//
//						if (DatoUser != null) {
//							
//							using (var bussines = new Bussines ()) {
//
//								TxtPuntosR.Text= (await bussines.UpdatePoint (DatoUser.Id, Pv.Id, Helpers.EncriptarSHA1 (Imei))).ToString();
//
//							}
//
//						}
//
//					
//
//					} else {
//
//						WebView.LoadUrl ("http://www.viewin.co/viewpublics/aut.html");
//					}


				}

				return;
			}


			valor.Background = new ColorDrawable (Color.ParseColor ("#00000000"));
			Toast.MakeText (this, "por favor presinalas en el orden", ToastLength.Short).Show ();

		}
예제 #2
0
		protected async override void OnStart ()
		{
			base.OnStart ();

			using (var _Bussines = new Bussines ()) {
			
			//	listViews = await	_Bussines.GetAllPublicViews ();
				var IdCategory=this.Intent.GetStringExtra("IdCategory");

				CurrentPublicView = await	_Bussines.GetPublicViewsByIdUser(DatoUser.Id,IdCategory, Helpers.EncriptarSHA1 (Imei));

				if (CurrentPublicView != null) {

					StarUrl = CurrentPublicView.Url;

					WebView.LoadUrl ("http://www.viewin.co/viewquerys/q2.html"); //

				} else {
					
					WebView.LoadUrl ("http://www.viewin.co/viewpublics/aut.html");
				}

			}

		

//			if (listViews.Count != 0) {
//				var index =	GetCountViews ();
//
//				TxtPuntosR.Text = DatoUser.Point.ToString();
//
//				if (index < listViews.Count) {
//
//					var Pv = listViews [index];
//					WebView.LoadUrl (Pv.Url);
//					//SetCountViews (index + 1);
//
//				}else {
//
//					WebView.LoadUrl ("http://www.viewin.co/viewpublics/aut.html");
//
//				}
//
//			} 


		}