void Window_Closed(object sender, EventArgs e)
        {
            if (sender is AgendaWindow)
            {
                _agendaWindow = null;
            }
            else if (sender is ManageUsersWindow)
            {
                _manageUsersWindow = null;
            }
            else if (sender is ManageRemindersWindow)
            {
                _manageRemindersWindow = null;
                RefreshRemindersStackPanel();
            }
            else if (sender is ManageMedicinesWindow)
            {
                _manageMedicinesWindow = null;
                RefreshMedicinesStackPanel();
            }
            else if (sender is ManageTreatmentsWindow)
            {
                _manageTreatmentsWindow = null;
            }
            else if (sender is ManageReceivedInvoicesWindow)
            {
                _manageReceivedInvoicesWindow = null;
            }
            else if (sender is ManageOutgoingInvoicesWindow)
            {
                _manageOutgoingInvoicesWindow = null;
            }
            else if (sender is TotalInvoicesWindow)
            {
                _totalInvoicesWindow = null;
            }
            else if (sender is ManageProvidersWindow)
            {
                _manageProvidersWindow = null;
            }
            else if (sender is ManageTechnicalsWindow)
            {
                _manageTechnicalsWindow = null;
            }
            else if (sender is ManageLaboratoryWorksWindow)
            {
                _manageLaboratoryWorksWindow = null;
            }
            else if (sender is MedicalProofDocument)
            {
                _medicalProofDocumentWindow = null;
            }
            else if (sender is ManageGeneralPaidsWindow)
            {
                _manageGeneralPaidsWindow = null;
            }
            else if (sender is ManageContactsWindow)
            {
                _manageContactsWindow = null;
            }
            else if (sender is ManageCleanedMaterialsWindow)
            {
                _manageCleanedMaterialsWindow = null;
            }
            else if (sender is SendEmailWindow)
            {
                _sendEmailWindow = null;
            }
            else if (sender is ConfigureEmailWindow)
            {
                _configureEmailWindow = null;
            }
            else if (sender is ManagePatientsWindow)
            {
                _managePatientsWindow = null;
            }
            else if (sender is ManageDotationsWindow)
            {
                _manageDotationsWindow = null;
                RefreshDotationsStackPanel();
            }
            else if (sender is ManageTreatmentPricesWindow)
            {
                _manageTreatmentPricesWindow = null;
            }
            else if (sender is ManageBudgetsWindow)
            {
                _manageBudgetsWindow = null;
            }
            else if (sender is ManageAmericanExpressPaidsWindow)
            {
                _manageAmericanExpressPaidsWindow = null;
            }
            else if (sender is ManageAuthorizationsWindow)
            {
                _manageAuthorizationsWindow = null;
            }
            else if (sender is ManageDentegraAuthorizationsWindow)
            {
                _manageElegibilitiesWindow = null;
            }
            else if (sender is ManageDrawersWindow)
            {
                _manageDrawersWindow = null;
            }
            else if (sender is CashRegisterWindow)
            {
                _cashRegisterWindow = null;
            }
            else if (sender is ManageBanksWindow)
            {
                _manageBanksWindow = null;
            }
            else if (sender is ViewPaymentsWindow)
            {
                _viewPaymentsWindow = null;
            }
            else if (sender is ViewPaymentFoliosWindow)
            {
                _viewPaymentFoliosWindow = null;
            }
            else if (sender is ViewEventsWindow)
            {
                _viewEventsWindow = null;
            }
            else if (sender is ViewPendingPaymentsWindow)
            {
                _viewPendingPaymentsWindow = null;
            }
            else if (sender is FinishedEventsReminderModal)
            {
                _finishedEventsReminderModal = null;

                List<DateTime> datesUpdated = (sender as FinishedEventsReminderModal).FinishedEvents
                                                .Where(fe => fe.IsCompleted || fe.IsCanceled)
                                                .Select(fe => (new DateTime(fe.StartEvent.Year, fe.StartEvent.Month, fe.StartEvent.Day)))
                                                .Distinct()
                                                .ToList();

                if (datesUpdated.Count > 0 && _agendaWindow != null)
                {
                    _agendaWindow.RepaintSchedulerIfDateModifiedIsSelected(datesUpdated);
                }
            }
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.Window = ((MyDentApplication.CashRegisterWindow)(target));
     
     #line 8 "..\..\..\CashRegister\CashRegisterWindow.xaml"
     this.Window.Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);
     
     #line default
     #line hidden
     return;
     case 2:
     this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
     return;
     case 3:
     this.btnSave = ((System.Windows.Controls.Button)(target));
     
     #line 21 "..\..\..\CashRegister\CashRegisterWindow.xaml"
     this.btnSave.Click += new System.Windows.RoutedEventHandler(this.btnSave_Click);
     
     #line default
     #line hidden
     return;
     case 4:
     this.btnCancel = ((System.Windows.Controls.Button)(target));
     
     #line 22 "..\..\..\CashRegister\CashRegisterWindow.xaml"
     this.btnCancel.Click += new System.Windows.RoutedEventHandler(this.btnCancel_Click);
     
     #line default
     #line hidden
     return;
     case 5:
     this.gbPacientInfo = ((System.Windows.Controls.GroupBox)(target));
     return;
     case 6:
     this.svPacientInfo = ((System.Windows.Controls.ScrollViewer)(target));
     return;
     case 7:
     this.gridPacientInfo = ((System.Windows.Controls.Grid)(target));
     return;
     case 8:
     this.lblExpNoCaption = ((System.Windows.Controls.Label)(target));
     return;
     case 9:
     this.lblExpNo = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 10:
     this.lblCellPhoneCaption = ((System.Windows.Controls.Label)(target));
     return;
     case 11:
     this.lblCellPhone = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 12:
     this.lblHomePhoneCaption = ((System.Windows.Controls.Label)(target));
     return;
     case 13:
     this.lblHomePhone = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 14:
     this.lblEmailCaption = ((System.Windows.Controls.Label)(target));
     return;
     case 15:
     this.lblEmail = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 16:
     this.lblPacientNameCaption = ((System.Windows.Controls.Label)(target));
     return;
     case 17:
     this.lblPacientName = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 18:
     this.btnClearForm = ((System.Windows.Controls.Button)(target));
     
     #line 38 "..\..\..\CashRegister\CashRegisterWindow.xaml"
     this.btnClearForm.Click += new System.Windows.RoutedEventHandler(this.btnClearForm_Click);
     
     #line default
     #line hidden
     return;
     case 19:
     this.lblStatus = ((System.Windows.Controls.Label)(target));
     return;
     case 20:
     this.lblPatient_Copy5 = ((System.Windows.Controls.Label)(target));
     return;
     case 21:
     this.lblPatient_Copy6 = ((System.Windows.Controls.Label)(target));
     return;
     case 22:
     this.lblPatient_Copy7 = ((System.Windows.Controls.Label)(target));
     return;
     case 23:
     this.lblPatient_Copy8 = ((System.Windows.Controls.Label)(target));
     return;
     case 24:
     this.lblTotalAmountTreatments = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 25:
     this.lblTotalAmountPayments = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 26:
     this.lblGrandTotal = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 27:
     this.lblPositiveBalance = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 28:
     this.svTreatments = ((System.Windows.Controls.ScrollViewer)(target));
     return;
     case 29:
     this.spTreatments = ((System.Windows.Controls.StackPanel)(target));
     return;
     case 30:
     this.btnAddTreatment = ((System.Windows.Controls.Button)(target));
     
     #line 59 "..\..\..\CashRegister\CashRegisterWindow.xaml"
     this.btnAddTreatment.Click += new System.Windows.RoutedEventHandler(this.btnAddTreatment_Click);
     
     #line default
     #line hidden
     return;
     case 31:
     this.lblTreatmentsCount = ((System.Windows.Controls.Label)(target));
     return;
     case 32:
     this.cbPatients = ((System.Windows.Controls.ComboBox)(target));
     
     #line 66 "..\..\..\CashRegister\CashRegisterWindow.xaml"
     this.cbPatients.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.cbPatients_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 33:
     this.svPayments = ((System.Windows.Controls.ScrollViewer)(target));
     return;
     case 34:
     this.spPayments = ((System.Windows.Controls.StackPanel)(target));
     return;
     case 35:
     this.btnAddCreditCardPayment = ((System.Windows.Controls.Button)(target));
     
     #line 75 "..\..\..\CashRegister\CashRegisterWindow.xaml"
     this.btnAddCreditCardPayment.Click += new System.Windows.RoutedEventHandler(this.btnAddPayment_Click);
     
     #line default
     #line hidden
     return;
     case 36:
     this.btnAddCheckPayment = ((System.Windows.Controls.Button)(target));
     
     #line 78 "..\..\..\CashRegister\CashRegisterWindow.xaml"
     this.btnAddCheckPayment.Click += new System.Windows.RoutedEventHandler(this.btnAddPayment_Click);
     
     #line default
     #line hidden
     return;
     case 37:
     this.btnAddCashPayment = ((System.Windows.Controls.Button)(target));
     
     #line 81 "..\..\..\CashRegister\CashRegisterWindow.xaml"
     this.btnAddCashPayment.Click += new System.Windows.RoutedEventHandler(this.btnAddPayment_Click);
     
     #line default
     #line hidden
     return;
     case 38:
     this.lblPaymentsCount = ((System.Windows.Controls.Label)(target));
     return;
     case 39:
     this.gbAccountStatusNumber = ((System.Windows.Controls.GroupBox)(target));
     return;
     case 40:
     this.lblAccountStatusNumber = ((System.Windows.Controls.Label)(target));
     return;
     case 41:
     this.lblPatient_Copy2 = ((System.Windows.Controls.Label)(target));
     return;
     case 42:
     this.lblPaymentFolioNumber = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 43:
     this.lblGeneratedStatementNumberCaption = ((System.Windows.Controls.Label)(target));
     return;
     case 44:
     this.lblGeneratedStatementNumber = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 45:
     this.btnPrintMail = ((System.Windows.Controls.Button)(target));
     
     #line 98 "..\..\..\CashRegister\CashRegisterWindow.xaml"
     this.btnPrintMail.Click += new System.Windows.RoutedEventHandler(this.btnPrintMail_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
        private void btnOpenCashRegister_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (_cashRegisterWindow == null)
            {
                _cashRegisterWindow = new CashRegisterWindow(_userLoggedIn, null, null);
                _cashRegisterWindow.Closed += Window_Closed;
            }

            _cashRegisterWindow.Show();
            _cashRegisterWindow.WindowState = _cashRegisterWindow.WindowState == WindowState.Minimized ? WindowState.Normal : WindowState.Maximized;
        }