protected async override void OnAppearing() { base.OnAppearing(); await _ViewModel.DownloadApiData(); await _ViewModel.GetUsers(); await _ViewModel.Msg(); }
private void PopulateStaticFields() { UsersViewModel viewModel = new UsersViewModel(); viewModel.ViewModelEvent += viewModel_ViewModelEvent; List <DomainsObject> foundDomains = viewModel.GetDomains(WebSessionHandler.SelectedCompanyCode); ddlLoginDomain.DataSource = foundDomains; ddlLoginDomain.DataBind(); // Don't populate Exchange information if the company isn't enabled for Exchange if (CompanyChecks.IsExchangeEnabled(WebSessionHandler.SelectedCompanyCode)) { // Get list of users List <UsersObject> users = viewModel.GetUsers(WebSessionHandler.SelectedCompanyCode); // // User Permissions dropdown boxes // // Filter only users with sAMAccountName List <UsersObject> permissionUsers = users.FindAll(x => !string.IsNullOrEmpty(x.sAMAccountName)); // Bind to list ddlEditMailboxFullAccess.DataSource = permissionUsers; ddlEditMailboxSendAs.DataSource = permissionUsers; ddlEditMailboxSendOnBehalf.DataSource = permissionUsers; ddlEditMailboxFullAccess.DataBind(); ddlEditMailboxSendAs.DataBind(); ddlEditMailboxSendOnBehalf.DataBind(); // // Populate the forward to list // ddlEditMailboxForwardTo.Items.Clear(); ddlEditMailboxForwardTo.Items.Add("Not Selected"); // // Populate the accepted domain fields // var acceptedDomains = from a in foundDomains where a.IsAcceptedDomain select a; // If we found accepted domains then we can show the email section if (acceptedDomains != null && acceptedDomains.Count() > 0) { ddlEditMailboxDomain.DataSource = acceptedDomains; ddlEditMailboxDomain.DataBind(); ddlEditAddEmailAliasDomain.DataSource = acceptedDomains; ddlEditAddEmailAliasDomain.DataBind(); } } }
private void PopulateUsersListView() { UsersViewModel viewModel = new UsersViewModel(); viewModel.ViewModelEvent += viewModel_ViewModelEvent; List <UsersObject> users = viewModel.GetUsers(WebSessionHandler.SelectedCompanyCode); repeaterUsers.DataSource = users; repeaterUsers.DataBind(); panelCreateUser.Visible = false; panelEditUser.Visible = false; panelUserList.Visible = true; }
private async void CheckConnection() { //проверка на подключение к сети if (CrossConnectivity.Current != null && CrossConnectivity.Current.ConnectionTypes != null && CrossConnectivity.Current.IsConnected == true) { var connectionType = CrossConnectivity.Current.ConnectionTypes.FirstOrDefault(); if (connectionType.ToString() == "Cellular") { await DisplayAlert("Нет подключения к сети!", "Подключитесь к сети WiFi", "OK"); //если используется мобильный интернет - выводим ошибку } else { await viewModel.GetUsers(); // если WiFi, то загружаем данные с сервиса } } else { //если подключение не обнаружено, то ошибка await DisplayAlert("Нет подключения к сети!", "Подключитесь к сети WiFi", "OK"); } }