public Page_AddEditContact()
 {
     InitializeComponent();
     Suggestions = new ObservableCollection<string>();
     //this.KeyDown += Page_AddEditContact_KeyDown;
     //Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown;
     //this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled;
     defaultBackground = GridAddEditContact.Background;
     listGroup_EF = dbController.GetAllGroups_EF();
     addressBook = UC_AddressBook.Instance;
 }
        public Page_LocalContacts()
        {
            this.InitializeComponent();
            saveFileDialog.FileTypeFilter.Add(".csv");
            uc_addressBook = UC_AddressBook.Instance;

            string hint = UC_AddressBook.ResourcesStringLoader.GetString("search_for_contact");

            tbox_search.Hint = hint;
            tbox_search.SetDoTextChangedAction(ContinuousSearch);
        }
示例#3
0
 public void UpdateUCAddressBook(UC_AddressBook uc)
 {
     uc_AddressBook = uc;
 }
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            UC_AddressBook.Instance.PageTitle = PageTitles.TITLE_SELECT_CONTACT_FROM_ACCOUNT;
            var emailType = dbController.GetEmailTypePreferredByAccountTypeId(account.AccountType.Id);
            var faxType = dbController.GetFaxTypePreferredByAccountTypeId(account.AccountType.Id);
            var nameOrder = dbController.GetHostNameOrderByAccountTypeId(account.AccountType.Id);
            int index = 0;
            foreach (var item in listContacts)
            {
                var mainEmail = item.Emails.FirstOrDefault(em => em.EmailType.Name.Equals(emailType.Name));
                var mainFax = item.Faxes.FirstOrDefault(fa => fa.FaxType.Name.Equals(faxType.Name));

                var contact = new ContactView
                {
                    Index = index,
                    Id = index,
                    Name = MyUtils.GetContactFullNameFrom(item.FirstName, item.MiddleName, item.LastName, nameOrder.ContactNameOrder.NameOrder),
                    EmailAddress = mainEmail != null ? mainEmail.Value : string.Empty,
                    Fax = mainFax != null ? mainFax.Value : string.Empty,
                    Group = string.Empty,
                    ImportedFrom = account.UserName,
                };

                listContact_EF.Add(contact);
                index++;
            }

            addressBook = UC_AddressBook.Instance;
            ResetListView();
            defaultBackground = Grid_import.Background;
            btnImportContacts.IsEnabled = false;
            btnImportContactsNoFlyout.IsEnabled = false;
            listview_contacts.SelectionChanged -= listview_contacts_SelectionChanged;
            listview_contacts.ItemsSource = listContact_EF;
            listview_contacts.SelectionChanged += listview_contacts_SelectionChanged;
            tblockCurContactLimit.Text = ContactDB.MAX_CONTACT.ToString();
            tblockContactNumber.Text = "0";
            currentContactNumber = dbController.GetTotalContactCount();
            tblockContactNumber.Text = currentContactNumber.ToString();
        }
        public async void Reload()
        {
            //listview_contacts.ContainerContentChanging -= listview_contacts_ContainerContentChanging;
            //listview_contacts.SelectionChanged -= listview_contacts_SelectionChanged;
            var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher;
            allowAction = false;
            UpdateGUIWhenStartingProcess("Loading...");

            await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (isReload)
                {
                    var contacts = dbController.GetAllContactViews();
                    UpdateListContacts(contacts);
                    listGroup_EF = dbController.GetAllGroups_EF();
                    UC_AddressBook.Instance.RefreshContactAndGroupCount();
                    isReload = false;
                    uc_addressBook = UC_AddressBook.Instance;
                    uc_addressBook.UpdateCountContactItemMenu();
                    ResumeLocalContactsManagementPage1();
                }

                allowAction = true;
                UpdateGUIWhenStopingProcess();
                uc_addressBook.RefreshAllContactCount();
                //ResumeLocalContactsManagementPage();
            });
        }
示例#6
0
        public Page_LocalGroups()
        {
            InitializeComponent();

            string hint = UC_AddressBook.ResourcesStringLoader.GetString("LocalGroup-Textbox-Search-Hint");
            if (searchText == string.Empty)
                tbox_search.Hint = hint;
            tbox_search.SetDoTextChangedAction(ContinuousSearch);
            this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled;

            Rename.IsEnabled = false;
            AddContact.IsEnabled = false;
            RemoveContact.IsEnabled = false;

            uc_addressBook = UC_AddressBook.Instance;
            downloadController = MultiDownloadController.Instance;

            currentMode = ViewMode.MODE_GROUP;
            UpdateViewBaseOnMode(currentMode);
            //ReloadGroup();
        }
示例#7
0
        public UC_AddressBook()
        {
            InitializeComponent();
            Loaded += new RoutedEventHandler(UC_AddressBook_Loaded);
            SizeChanged += new SizeChangedEventHandler(UC_AddressBook_SizeChanged);

            this.window_name.Text += AppVersion;

            //ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(700, 700));

            new DatabaseParameterController().LoadDatabaseParameters();
            //instance = this;
            // for testing 
            UpdatePrinterList("");

            Task thread = new Task(CheckDatabase);
            thread.RunSynchronously();

            //ScenarioControl.ItemsSource = scenarios;
            //ScenarioControl.SelectedIndex = 0;    
            this.Loaded += (sender, args) =>
            {
                instance = this;

                this.TogglePaneButton.Focus(FocusState.Programmatic);
            };
            this.RootSplitView.RegisterPropertyChangedCallback(SplitView.DisplayModeProperty,
                (s, a) =>
                {
                    this.CheckTogglePaneButtonSizeChanged();
                });
            SystemNavigationManager.GetForCurrentView().BackRequested += SystemNavigationManager_BackRequested;
            NavMenuList.ItemsSource = navlist;
            RootSplitView.PaneBackground = GetSolidColorBrush("#ff343434");

            //SizeChanged += Page_SizeChanged;
        }
示例#8
0
        public UC_AddressBook()
        {
            this.InitializeComponent();
            instance = this;
            // for testing 
            UpdatePrinterList("");

            Task thread = new Task(CheckDatabase);
            thread.RunSynchronously();

            ScenarioControl.ItemsSource = scenarios;
            ScenarioControl.SelectedIndex = 0;

        }
示例#9
0
 public Page_LocalGroups()
 {
     this.InitializeComponent();
     uc_addressBook = UC_AddressBook.Instance;
     downloadController = MultiDownloadController.Instance;
 }