Example #1
0
        // public string ProductSearchText { get; set; }

        #endregion PRIVATE PROPERTIES

        #region ### .ctor ###

        /// <summary>
        /// Erzeugt eine neue Instanz der CpmMainView Klasse.
        /// </summary>
        public CpmMainView()
        {
            InitializeComponent();
            this.Text             = "Cut and Print Media";
            this.mlblVersion.Text = string.Format("Ver. {0}", Application.ProductVersion);
            this.mtxtSearch.DataBindings.Add("Text", this, "SearchText");
            ModelManager.CustomerService.CurrentCustomerSet += CustomerService_CurrentCustomerSet;
            ModelManager.ProductService.CurrentProductSet   += ProductService_CurrentProductSet;
            this.CustomerService_CurrentCustomerSet(this, EventArgs.Empty);
            if (ModelManager.UserService.CurrentUser != null)
            {
                this.mlblCurrentUser.Text = string.Format("Tach {0}", ModelManager.UserService.CurrentUser.NameFirst);
            }
            this.SetClock();
            //this.btnTest.Visible |= ModelManager.UserService.CurrentUser.LoginWindows.ToLower() == "axel";
            this.RestoreRecentCustomers();
            this.RestoreRecentProducts();
            try
            {
                if (!David.DavidManager.DavidService.WithAppointmentListener && FonManager.FonService.ServerReachable())
                {
                    var fonService = FonManager.FonService;
                    fonService.InitTapi(true, ModelManager.UserService.CurrentUser.AgfeoLoginName);
                    this.SammirmalWennsKlingelt();
                    cgvoDelegate     = new CustomerGeneralViewOpenDelegate(ShowCustomerDashboardView);
                    picCPM.BackColor = Color.Transparent;
                }
                else
                {
                    picCPM.BackColor = Color.FromArgb(64, 255, 0, 0);
                }

                if (David.DavidManager.DavidService.WithAppointmentListener)
                {
                    this.WindowState = FormWindowState.Minimized;
                    picCPM.BackColor = Color.Transparent;
                }
            }
            catch
            {
                var msg = "Die Telefonanlage konnte nicht initialisiert werden.";
                MetroMessageBox.Show(this, msg, "Nachricht von AGFEO", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            finally
            {
                if (!FonManager.FonService.Connected)
                {
                    var logText = string.Format("{0}: Die Telefonanlage konnte für den Benutzer '{1}' nicht initialisiert werden.",
                                                DateTime.Now,
                                                ModelManager.UserService.CurrentUser.AgfeoLineName);
                    Services.LogService.WriteLogEntry(logText);
                }
            }
            // David Notifications starten
            // David.DavidManager.DavidService.NewAppointmentMailEvent += DavidService_NewAppointmentMailHandler;

            //this.AppointmentWorker.RunWorkerAsync();
            //MACHEN: ModelManager.ReminderService.JobReminderExecuted += new EventHandler<Model.Services.ReminderService.JobReminderExecutedEventArgs>(ReminderService_JobReminderExecuted);
        }
Example #2
0
 public MainView(bool local)
 {
     InitializeComponent();
     if (!local)
     {
         Agfeo.FonService fonService = Agfeo.FonManager.FonService;
         fonService.InitTapi(true, Properties.Settings.Default.ATAPI_Line);
     }
     SammirmalWennsKlingelt();
     cgvoDelegate = new CustomerGeneralViewOpenDelegate(ShowCustomerDashboardView);
     this.txtSearchCustomer.DataBindings.Add("Text", this, "CustomerSearchText");
     if (Model.ModelManager.ModelService.GetCurrentUser() != null)
     {
         this.lblCurrentUser.Text = string.Format("Tach {0}", Model.ModelManager.ModelService.GetCurrentUser().NameFirst);
     }
 }