public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); // Prepare the picker such that it starts up faster. SIBarcodePicker.Prepare(appKey, SICameraFacingDirection.Back); using (var db = new SQLite.SQLiteConnection(_pathToDatabase)) { people = new List <Person> (from p in db.Table <Person> () select p); states = new List <State> (from s in db.Table <State> () select s); terms = new List <Terms> (from t in db.Table <Terms> () select t); privacyNotices = new List <PrivacyNotice> (from pr in db.Table <PrivacyNotice> () select pr); } if (people.Count > 0) { Person user = people.ElementAt(0); MainView.userId = user.ID; Console.WriteLine("El Id de usuario es: " + user.ID); } if (states.Count > 0) { State estado = states.ElementAt(0); MainView.localityId = estado.localityId; Console.WriteLine("El Id de localidad es: " + estado.localityId); } if (terms.Count < 1) { UIAlertView alert = new UIAlertView() { Title = "Espera!", Message = "Para poder utilizar FixBuy primero debes aceptar los terminos y condiciones" }; alert.AddButton("Aceptar"); alert.Clicked += (s, o) => { TermsView termsView = new TermsView(); NavigationController.PushViewController(termsView, true); }; alert.Show(); return; } if (privacyNotices.Count < 1) { UIAlertView alert = new UIAlertView() { Title = "Espera!", Message = "Para poder utilizar FixBuy primero debes aceptar el aviso de privacidad" }; alert.AddButton("Aceptar"); alert.Clicked += (s, o) => { PrivacyNoticeView privacyNoticeView = new PrivacyNoticeView(); NavigationController.PushViewController(privacyNoticeView, true); }; alert.Show(); return; } }
public ScanditSDKDemoViewController() : base("ScanditSDKDemoViewController", null) { if (appKey.Length != 43) { UIAlertView alert = new UIAlertView() { Title = "App key not set", Message = "Please set the app key in the ScanditSDKDemoViewController class." }; alert.AddButton("OK"); alert.Show(); } else { // Prepare the picker such that it starts up faster. SIBarcodePicker.Prepare(appKey, SICameraFacingDirection.Back); } }
public MainView() : base(UserInterfaceIdiomIsPhone ? "MainView_iPhone" : "MainView_iPad", null) { Title = "FixBuy"; if (appKey.Length != 43) { UIAlertView alert = new UIAlertView() { Title = "Llave de scanner invalida", Message = "Contacte al administrador de la aplicacion" }; alert.AddButton("Aceptar"); alert.Show(); } else { // Prepare the picker such that it starts up faster. SIBarcodePicker.Prepare(appKey, SICameraFacingDirection.Back); } }