Пример #1
0
        public AppointmentEditor(Scheduling s, Demographics d, Appointment a, Billing b, DateTime da, int ts, UpdateDisplay upd, bool ud = false)
        {
            Logging.Log("AppointmentScheduler is initiated");

            InitializeComponent();
            billing       = b;
            isUpdate      = ud;
            updateDisplay = upd;
            timeSlot      = ts;
            selectedDate  = da;
            scheduling    = s;
            demographics  = d;
            appointment   = a;

            foreach (BillingRecord br in billing.allBillingCodes.Values)
            {
                cbBillingCodes.Items.Add(br);
            }

            tbPrimaryPatient.Text = demographics.GetPatientByID(appointment.PatientID).GetName();
            btnPrimaryAdd.Click  += BtnPrimaryAdd_Click;

            foreach (ApptBillRecord br in billing.GetApptBillRecords(appointment.AppointmentID))
            {
                Chip c = new Chip();
                c.Margin  = new Thickness(4);
                c.Content = br.BillingCode;

                if (Int32.Parse(br.PatientID) == appointment.PatientID)
                {
                    wpBillingCodesPrimary.Children.Add(c);
                }
                else
                {
                    wpBillingCodesSecondary.Children.Add(c);
                }
            }

            if (a.DependantID == -1)
            {
                btnSecondaryAdd.Visibility = Visibility.Hidden;
            }
            else
            {
                tbDependantPatient.Text = demographics.GetPatientByID(appointment.DependantID).GetName();
                btnSecondaryAdd.Click  += BtnSecondaryAdd_Click;;
            }
        }