bool ConfigureCollectionView(CollectionViewSource cvs) { bool refresh = false; if (!cvs.SortDescriptions.Any() || (cvs.SortDescriptions[0].PropertyName != SettingsProvider.Current.Settings.ContactSettings.ContactListSortField.ToString())) { cvs.SortDescriptions.Clear(); AddSortDescription(cvs); refresh = true; } if (cvs.GroupDescriptions.Any() ^ SettingsProvider.Current.Settings.ContactSettings.GroupContacts) { cvs.GroupDescriptions.Clear(); if (SettingsProvider.Current.Settings.ContactSettings.GroupContacts) { AddGroupDescription(cvs); } refresh = true; } if (showOfflineContacts != SettingsProvider.Current.Settings.ContactSettings.ShowOfflineContacts) { showOfflineContacts = SettingsProvider.Current.Settings.ContactSettings.ShowOfflineContacts; refresh = true; } if (contactListView != SettingsProvider.Current.Settings.ContactSettings.ContactListView) { contactListView = SettingsProvider.Current.Settings.ContactSettings.ContactListView; refresh = true; } return(refresh); }
/// <summary> /// Requires the type of the contactList to be generated /// Once generetaed add the retails of the contacts to the contact list and returns ContactListView to be added to the controls /// </summary> /// <param name="type">The type wether its "load" or "search" and depending on the type the releavant panel is been loaded</param> /// <returns>The List of Contacts that should be added to the panels</returns> private List <ContactListView> GenerateContactList(String type) { this.AddSeachHeaderAndClose(); List <Contact> contactList = new List <Contact>(); if (type.Equals("load")) { contactList = contactHelper.GetUserContacts(); } else if (type.Equals("search")) { contactList = contactHelper.GetUserContactsByName(txt_search.Text.Trim()); } List <ContactListView> contactLists = new List <ContactListView>(); foreach (Contact contactDetails in contactList) { ContactListView contact = new ContactListView(); contact.Tag = contactDetails.ContactId; contact.ContactName = contactDetails.Name; contact.ContactEmail = contactDetails.Email; contact.ContactId = contactDetails.ContactId; contact.ContactImage = commonUtil.Base64ToBitmap(contactDetails.Image); contact.Name = $"ctx_"; contact.Click += new EventHandler(this.ContactControlClick); contactLists.Add(contact); } return(contactLists); }
void UserControl_Loaded(object sender, RoutedEventArgs e) { showOfflineContacts = SettingsProvider.Current.Settings.ContactSettings.ShowOfflineContacts; contactListView = SettingsProvider.Current.Settings.ContactSettings.ContactListView; SettingsProvider.Current.SettingsUpdated += Current_SettingsUpdated; var cvs = (CollectionViewSource)this.FindResource("buddiesCollection"); ConfigureCollectionView(cvs); }
private void ContactfilterSearchbar_TextChanged(object sender, TextChangedEventArgs e) { ContactListView.BeginRefresh(); if (ContactfilterSearchbar.Text == null || string.IsNullOrWhiteSpace(e.NewTextValue)) { ContactListView.ItemsSource = ContactListView.ItemsSource; } else { ContactListView.ItemsSource = newsSorces.Where(i => i.Name.Contains(e.NewTextValue)); } }
public void ContactControlClick(object sender, EventArgs e) { ContactListView contactList = (ContactListView)sender; Contact contact = this.contactHelper.GetContactDetails(contactList.Tag.ToString()); ContactPreview contactPreview = new ContactPreview(); contactPreview.ContactName = contact.Name; contactPreview.ContactEmail = contact.Email; contactPreview.ContactAddressLine1 = contact.AddressLine1 + ", " + contact.AddressLine2; contactPreview.ContactAddressLine2 = contact.City + ", " + contact.State + ", " + contact.Zipcode; contactPreview.ContactImage = commonUtil.Base64ToBitmap(contact.Image); this.pnl_contactpreview.Controls.Clear(); this.pnl_contactpreview.Controls.Add(contactPreview); }
// // GET: /Contacts/ public ViewResult Index(ContactListView model) { int pageSize = Int32.Parse(ConfigurationManager.AppSettings["pageSize"]); IQueryable <Contact> Contacts = db.Contacts; if (model.ContactTypeID > -1) { Contacts = Contacts.Where(w => w.contactTypeID == model.ContactTypeID); } if (!string.IsNullOrEmpty(model.NameContains)) { //TRs = TRs.Where(w=>w.children.OrderByDescending(c => c.dateOfBirth).ThenBy(c => c.childID).FirstOrDefault().nameLast.ToUpper().Contains(model.childNameContains.ToUpper()));# Contacts = Contacts.Where(w => w.firstName.ToUpper().Contains(model.NameContains.ToUpper()) || w.lastName.ToUpper().Contains(model.NameContains.ToUpper())); } model.Contacts = Contacts.OrderBy(c => c.lastName).ThenBy(c => c.firstName).ThenBy(c => c.salutation.Detail).ToPagedList(model.page, pageSize); return(View(model)); }
//public static void RaiseDateTimeChangedEvent(DateTime dt) //{ // try // { // NovaAlert.Common.Utils.SystemDateHelper.SetSystemTime(dt); // if (OnSystemDateTimeChangedHandler != null) // { // OnSystemDateTimeChangedHandler(null, new SystemDateTimeChangedEventArgs(dt)); // } // } // catch // { // } //} public static ContactViewModel ShowContact(IClientApp app, IEnumerable <HostPhoneViewModel> channels = null, bool allowMultiSelect = false, Action <HostPhoneViewModel, string> callFunc = null) { var vm = new ContactViewModel(app, true, channels); vm.AllowMultiSelect = allowMultiSelect; vm.CallFunc = callFunc; var v = new ContactListView(); v.DataContext = vm; v.Height = 500; v.Width = 700; if (NovaAlert.Common.Wpf.ModalDialog.ShowControl(v, "Danh mục điện thoại") == true && vm.ItemSelected != null) { return(vm); } return(null); }
public void LoadList() { ContactListView.Clear(); theData.Clear(); string sqlString = "SELECT FirstName, LastName, PhoneNumber, Email, Relation FROM mycontacts"; MySqlDataAdapter adr = new MySqlDataAdapter(sqlString, conn); adr.SelectCommand.CommandType = CommandType.Text; adr.Fill(theData); int numberOfRecords = theData.Select().Length; maxCount = numberOfRecords; rowLabel.Text = (row + 1) + " of " + maxCount; for (int i = 0; i < theData.Rows.Count; i++) { DataRow theRow = theData.Rows[i]; ListViewItem lvi = new ListViewItem(theRow["FirstName"].ToString()); lvi.SubItems.Add(theRow["LastName"].ToString()); lvi.SubItems.Add(theRow["PhoneNumber"].ToString()); lvi.SubItems.Add(theRow["Email"].ToString()); lvi.SubItems.Add(theRow["Relation"].ToString()); switch (theRow["Relation"].ToString()) { case "Family": lvi.ImageIndex = 0; break; case "Friend": lvi.ImageIndex = 1; break; case "Buisness": lvi.ImageIndex = 2; break; case "Other": lvi.ImageIndex = 3; break; } ContactListView.Items.Add(lvi); } }
public static Page GetMainPage() { // Initial, once off data load LoadData(); NavigationPage theNavigationPage = null; ContentPage theContentPage = null; try { theContentPage = new ContactListView(); theNavigationPage = new NavigationPage(theContentPage); } catch (Exception ex) { // Do something with the exception } return(theNavigationPage); }
public AcoesDePanicoViewModel (INavigation navigation) { Navigation = navigation; PanicContactRp = new Repository<PanicContacts> (); //Prepara list dos protetores. O protejido eh o id da tabela PanicContact protetores = new ObservableCollection<PanicContacts> (PanicContactRp.GetAllAsync (). Result.Where (pr => pr.Id == Settings.user_Id)); //Prepara lista dos protegidos. Mesma tabela PanicContact, filtrando agora pelo protetor protegidos = new ObservableCollection<PanicContacts> (PanicContactRp.GetAllAsync (). Result.Where (re => re.Email == Settings.email)); //obtem nexID para cadastro de novos protetores int nextIdx = 0; foreach (var pr in protetores) { Int32.TryParse (pr.Id, out nextIdx); if (nextIdx > nextIDProtetor) nextIDProtetor = nextIdx; } completaListaProtegidos (); protetoresListCommand = new Command (async (key) => { try { if (await CrossContacts.Current.RequestPermission ()) { var protetoresContactListView = new ContactListView (new ContactsListViewModel ()); protetoresContactListView.ContactSelected += protetor_ContactSelected; await Navigation.PushModalAsync (new NavigationPage (protetoresContactListView)); } } catch (Exception ex) { Debug.WriteLine ("protetoresListCommand " + ex); throw; } }); }
void MailToCustomer() { Kundenkontakt contact = null; var clv = new ContactListView(this.myOffer.Customer); if (clv.ShowDialog() == DialogResult.OK && clv.SelectedContact != null) { contact = clv.SelectedContact; var pdfFile = PdfMaker.PdfManager.PdfService.CreateOfferDocument(this.myOffer, false, false); var nl = Environment.NewLine; var bodyParams = new string[6]; bodyParams[0] = nl; bodyParams[1] = "Sehr geehrte(r)"; bodyParams[2] = contact.Kontaktname; bodyParams[3] = "Vielen Dank für Ihre Anfrage."; bodyParams[4] = "Sie finden Ihr Angebot als PDF Datei im Anhang dieser Nachricht."; bodyParams[5] = ModelManager.UserService.CurrentUser.Signature; var body = string.Format("{1} {2}{0}{0}{3}{0}{4}{0}{0}{5}", bodyParams); var newMessage = ModelManager.PostBuedel.CreateMailMessage(contact.E_Mail, "Angebot", body, pdfFile); var ev = new EmailView(newMessage, this.myOffer.Customer); ev.ShowDialog(); this.myOffer.SetPrintDateOffer(); } }
public async Task newCellPhoneUser() { var answer = await UserDialogs.Instance.ActionSheetAsync("Novo usuario do portão", "Cancelar", null, "Digitar e-mail", "Selecionar contato"); if (answer == "Digitar e-mail") { var email = await UserDialogs.Instance.PromptAsync("Novo usuario do Portão", "Permitir acesso para", "Ok", "Cancelar", "*****@*****.**", InputType.Email); if (email.Ok) { if (!String.IsNullOrEmpty(email.Text)) newGateUserCell(email.Text); } else { Debug.WriteLine("Unpermitted"); if (await CrossContacts.Current.RequestPermission()) { Debug.WriteLine("Permitted CrossContacts"); var contactsView = new ContactListView(new ContactsListViewModel()); contactsView.ContactSelected += contactSelected; await Navigation.PushAsync(contactsView); contactsView.ContactSelected -= contactSelected; } else Debug.WriteLine("Unpermitted CrossContacts"); } } }
public override Fragment GetItem(int i) { var fragment = _tabs[i]; if (fragment == null) { MXContainer.Navigate(i == 0 ? ContactListController.Uri : (i == 1 ? CalendarListController.Uri : TaskListController.Uri)); switch (i) { case 0: fragment = new ContactListView(); break; case 1: fragment = new CalendarView(); break; case 2: fragment = new TaskListView(); break; }; _tabs[i] = fragment; } return fragment; }