public ChangePassword(PromptPageState promptPageState) { InitializeComponent(); this.promptPageState = promptPageState; configuration = AiDataStore.GetConfiguration(); user = AiDataStore.GetUser(); }
public QSections(DCAnalytics.ObjectType objectType, Questionaire _questionaire, QuestionairePageState questionairePageState = null, Certification _certification = null, FieldInspection _fieldInspection = null) { InitializeComponent(); controls = new UIControls(this); ObjectType = objectType; selectPageState = this; promptPageState = this; picturePageState = this; locationPageState = this; questionaire = null; questionaire = _questionaire; FieldInspection = _fieldInspection; certification = _certification; Title = questionaire.Name; this.questionairePageState = questionairePageState; sectionViews = new List <SectionView>(); _questionaireStatus = string.IsNullOrEmpty(questionaire.Key) ? QuestionaireStatus.Create : QuestionaireStatus.Modify; _dbManager = new DatabaseManager(); user = AiDataStore.GetUser(); configuration = AiDataStore.GetConfiguration(); isValid = true; Sections.Clear(); Sections = (FieldInspection != null) ? FieldInspection.Sections: (certification != null) ? certification.Sections: questionaire.Sections; dependencies.Clear(); navigatedTargetSections.Clear(); controls.targets.Clear(); Init(); }
protected override void OnAppearing() { base.OnAppearing(); try { configuration = AiDataStore.GetConfiguration(); Inspections = configuration.Inspections.Where(x => x.FarmerKey == questionaire.Key).ToList(); if (Inspections.Count > 0) { fields.IsVisible = true; nofields.IsVisible = false; lfieldStack.IsVisible = true; fields.ItemsSource = Inspections; } else { fields.IsVisible = false; nofields.IsVisible = true; lfieldStack.IsVisible = false; } } catch (Exception ex) { } }
public ChangeUsername(PromptPageState promptPageState) { InitializeComponent(); this.promptPageState = promptPageState; this.configuration = AiDataStore.GetConfiguration(); this.user = AiDataStore.GetUser(); Username.Text = user.UserName; }
public Trainings(string Title = null) { InitializeComponent(); if (!string.IsNullOrEmpty(Title)) { this.Title = Title; } this.configuration = AiDataStore.GetConfiguration(); Init(); }
private async void OnSynchronizationTapped(object sender, EventArgs args) { try { configuration = AiDataStore.GetConfiguration(); (Application.Current.MainPage as MasterDetailPage).IsPresented = false; Synchronize = new Synchronize(this); await PopupNavigation.Instance.PushAsync(Synchronize); } catch (Exception ex) { } }
private void Init() { try { configuration = AiDataStore.GetConfiguration(); user = AiDataStore.GetUser(); names.Text = user.Firstname + " " + user.Lastname; username.Text = user.UserName; mail.Text = user.Email; } catch (Exception ex) { } }
private void Init() { configuration = AiDataStore.GetConfiguration(); var _purchases = configuration.Purchases.Where(x => x.Farmer == questionaire.Key).ToList(); if (_purchases.Count > 0) { purchases.IsVisible = true; nextPageFAB.IsVisible = true; nopurchases.IsVisible = false; purchases.ItemsSource = _purchases; } else { purchases.IsVisible = false; nextPageFAB.IsVisible = false; nopurchases.IsVisible = true; } }
private void OnSignOutTapped(object sender, EventArgs args) { try { (Application.Current.MainPage as MasterDetailPage).IsPresented = false; configuration = AiDataStore.GetConfiguration(); if (!IsDataExisting()) { Task.Run(async() => await PopupNavigation.Instance.PushAsync(new MessageBox("You have unsynchronized data, are you sure you want to logout?", MessageType.Logout, this))); } else { OnExit(); } } catch (Exception ex) { } }
public Purchase(Models.Purchase purchase = null, Questionaire questionaire = null) { InitializeComponent(); configuration = AiDataStore.GetConfiguration(); this.questionaire = questionaire; this.purchase = purchase; Question qn = questionaire.Sections.FirstOrDefault().Questions.Find(x => x.QuestionText == "Name"); if (qn != null) { name.Text = qn.Answers.FirstOrDefault().AnswerText; } if (purchase != null) { Init(); } }
private void Init() { try { configuration = AiDataStore.GetConfiguration(); User = AiDataStore.GetUser(); var qns = configuration.Questionaires.Where(x => x.Status == DCAnalytics.Statuses.Partial || x.Status == DCAnalytics.Statuses.Completed).ToList(); questionaires.IsVisible = false; noquestionaires.IsVisible = false; progressIndicator.IsVisible = true; (progressIndicator.Children[0] as ActivityIndicator).IsRunning = true; sQLiteQuestionaires.Clear(); sQLiteQuestionaires = new DatabaseManager().GetSQLiteQuestionaires(); savedQuestionaires.Clear(); annotations.Clear(); qItems.Clear(); if (qns.Count > 0) { foreach (Questionaire qn in qns) { annotations.Add(new SymbolAnnotation { Coordinates = new LatLng(qn.Latitude, qn.Longitude), IconImage = (ImageSource)"ic_marker.png", IconSize = 1, IconColor = Color.Green }); qItems.Add(new QItem { ID = qn.Key, Distance = (location != null) ? Location.CalculateDistance(qn.Latitude, qn.Longitude, location, DistanceUnits.Kilometers) : 0, Name = (qn.Sections.FirstOrDefault().Questions.FirstOrDefault().Answers.Count() > 0)? qn.Sections.FirstOrDefault().Questions.FirstOrDefault().Answers.FirstOrDefault().AnswerText : qn.Key, Sequence = (qns.IndexOf(qn) % 2 == 0) ? 0 : 1 }); } } progressIndicator.IsVisible = false; (progressIndicator.Children[0] as ActivityIndicator).IsRunning = false; //if no questionaires are saved if (qItems.Count == 0) { noquestionaires.IsVisible = true; nextPageFAB.IsVisible = false; questionaires.IsVisible = false; } else { map.ZoomLevel = Device.RuntimePlatform == Device.Android ? 10 : 17; map.LogoEnabled = false; map.CompassEnabled = true; map.ShowUserLocation = true; map.Annotations = annotations; if (location != null) { map.Center = new LatLng(location.Latitude, location.Longitude); } questionaires.IsVisible = true; nextPageFAB.IsVisible = true; questionaires.ItemsSource = null; questionaires.ItemsSource = qItems; } } catch (Exception ex) { Log.Warning("SqlLite Exception ", ex.Message); } }
public SignIn() { InitializeComponent(); configuration = AiDataStore.GetConfiguration(); Password.IsPassword = true; }