コード例 #1
0
        public Page_PrinterContacts()
        {
            this.InitializeComponent();
            Loaded += new RoutedEventHandler(Page_Loaded);

            printerController = new PrinterController();
            listPrinter = new List<Printer>();
            btn_send_printer.IsEnabled = false;
            grid_search.Visibility = Visibility.Collapsed;
            init_symbol_button();
            this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled;
            Suggestions = new ObservableCollection<string>();
            defaultBackground = MainGrid.Background;
            InitPrinter();
            SetSearchTextBox();
            UpdateButton();
        }
コード例 #2
0
        private void btn_send_to_printer_Click(object sender, RoutedEventArgs e)
        {
            FlagSendToPrinter = true;
            PrinterController printerController = new PrinterController();
            string domain = DataManager.Instance.Domain_printer;
            string jsonStr = String.Empty;
            //if (domain == Printer.DOMAIN_LOCAL)
            //{
            //}
            //else
            //{
            //    var listContactsInGroup = contactPrinter.GetListContactSendToPrinterInGroup();
            //    if (listContactsInGroup.Any())
            //    {
            //        jsonStr = contactPrinter.JsonContactSendToPrinter(listContactsInGroup);
            //    }
            //}
            var list = GetListContactNeedSendToPrinter();
            if (list.Any())
            {
                jsonStr = contactPrinter.JsonContactSendToPrinter(list);
                if (CheckLimitContactPrinter(list))
                {
                    return;
                }
                if (CheckLimitGroupPrinter(list))
                {
                    return;
                }
                page_PrinterContacts.SendContactsToPrinter(jsonStr);
                MessageBox.Show(jsonStr);
            }
            else
            {
                MessageBox.Show(CMLibrary.Properties.Resources.no_contact_send_to_printer);
                return;
            }

        }
コード例 #3
0
        private void btn_send_to_printer_Click(object sender, RoutedEventArgs e)
        {
            bool isExistDatabase = dbController.CheckDatabase();
            if (isExistDatabase)
            {
                MessageBox.Show(Properties.Resources.is_exist_database);
                return;
            }
            btn_hidden.Focus();
            FlagSendToPrinter = true;
            PrinterController printerController = new PrinterController();
            string domain = DataManager.Instance.Domain_printer;
            string jsonStr = String.Empty;

            var list = GetListContactNeedSendToPrinter();
            if (list.Any())
            {
                jsonStr = contactPrinter.JsonContactSendToPrinter(list);
                page_PrinterContacts.SendContactsToPrinter(jsonStr);
                MyUtils.LogWrite(jsonStr);
            }
            else
            {
                MessageBox.Show(CMLibrary.Properties.Resources.no_contact_send_to_printer);
                return;
            }

        }