Beispiel #1
0
        public FormButton()
        {
            InitializeComponent();

            if (!CacheBL.CheckSettings())
            {
                KryptonMessageBox.Show("Lütfen öncelikle uygulama için gereki olan bilgileri giriniz", "Uyarı");
                new FormSettings().ShowDialog();
            }

            InitializeWatchDog();
            LocationForm();
            CatchManuelBarcode();
            CheckForIllegalCrossThreadCalls = false;
        }
        public FormSettings()
        {
            InitializeComponent();

            Settings.Default.SettingChanging += Default_SettingChanging;



            #region Uygulama Durumu
            if (!Settings.Default.AppIsEnabled)
            {
                btnIsAppEnabled.Text      = "AKTİF yap";
                lblAppStatus.Text         = "Uygulama PASİF";
                pictureBoxAppStatus.Image = Resources.delete;
            }
            else
            {
                btnIsAppEnabled.Text      = "PASİF yap";
                lblAppStatus.Text         = "Uygulama AKTİF";
                pictureBoxAppStatus.Image = Resources.accept;
            }
            #endregion

            #region Kaynak ve Hedef Klasör Ayarları
            if (string.IsNullOrEmpty(Settings.Default.SourceFolder))
            {
                Settings.Default.SourceFolder = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache);
                Settings.Default.Save();
            }

            if (string.IsNullOrEmpty(Settings.Default.DestinationFolder))
            {
                Settings.Default.DestinationFolder = Path.Combine(@"C:\Program Files\Farmakode", Settings.Default.LatestPostFolderName);
                CacheBL.CheckSettings();
                Settings.Default.Save();
            }
            #endregion

            #region Yazıcı ayarları
            System.Drawing.Printing.PrinterSettings.StringCollection printerList = System.Drawing.Printing.PrinterSettings.InstalledPrinters;
            List <string> _printerList = new List <string>();

            foreach (string printer in printerList)
            {
                _printerList.Add(printer);
                comboDefaultBarcodePrinter.Items.Add(printer);
            }

            if (!_printerList.Contains(Settings.Default.DefaultBarcodePrinter))
            {
                comboDefaultBarcodePrinter.SelectedItem = LocalPrintServer.GetDefaultPrintQueue().FullName;
            }
            #endregion


            comboPCNO.Items.Clear();
            foreach (var item in Common.GetPcNumberList())
            {
                comboPCNO.Items.Add(item);
            }

            if (!string.IsNullOrEmpty(Settings.Default.PharmacyPCNO))
            {
                comboPCNO.SelectedItem = Settings.Default.PharmacyPCNO;
            }

            this.Text = "Ayarlar | " + CacheBL.IPAddress;

            comboNotificationPosition.SelectedIndex = Settings.Default.NotificationPosition;
        }