public FrmInsuranceAgency(Model.InsuranceAgency editInsuranceAgency)
        {
            InitializeComponent();

            insuranceAgency = editInsuranceAgency;
            selectedAddress = editInsuranceAgency.Address;
            tbNote.Text     = editInsuranceAgency.Note;

            InitializeAddresses();
        }
Example #2
0
        private void BtnAddInsurance_Click(object sender, EventArgs e)
        {
            using (var formInsurance = new FrmInsuranceAgency())
            {
                var result = formInsurance.ShowDialog();

                if (result == DialogResult.OK)
                {
                    var insuranceAgency = formInsurance.insuranceAgency;

                    InitializeInsuranceAgencies();

                    selectedInsurance         = insuranceAgency;
                    cbInsurance.SelectedIndex = insuranceAgencies.Select(o => o.Id).ToList().IndexOf(selectedInsurance.Id);
                }
            }
        }
Example #3
0
        public FrmPatient(Model.Patient editPatient)
        {
            InitializeComponent();
            InitializeAdditionalComponents();

            patient           = editPatient;
            selectedAddress   = editPatient.Address;
            selectedInsurance = editPatient.InsuranceAgency;
            selectedDoctor    = editPatient.LocalDoctor;

            tbGender.Text      = editPatient.Gender;
            dtpBirthday.Value  = editPatient.Birthday;
            tbInsuranceNr.Text = Convert.ToString(editPatient.InsuranceNr);
            tbNote.Text        = editPatient.Note;

            InitializeAddresses();
            cbInsurance.SelectedIndex = insuranceAgencies.Select(o => o.Id).ToList().IndexOf(selectedInsurance.Id);
            cbDoctor.SelectedIndex    = doctors.Select(o => o.Id).ToList().IndexOf(selectedDoctor.Id);

            InitializeAddresses();
        }
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (selectedAddress == null)
            {
                MessageBox.Show("Die Krankenkasse kann nicht gespeichert werden ohne gültige Adressdaten.");
            }
            else
            {
                if (insuranceAgency != null) // edit handover insuranceAgency
                {
                    insuranceAgency.Address = selectedAddress;
                    insuranceAgency.Note    = tbNote.Text;

                    insuranceAgency.Update();
                }
                else
                {
                    insuranceAgency = new Model.InsuranceAgency(selectedAddress, tbNote.Text); // create new insuranceAgency
                }
                this.DialogResult = DialogResult.OK;
            }
        }
Example #5
0
        private void BtnEditInsurance_Click(object sender, EventArgs e)
        {
            if (selectedInsurance == null)
            {
                MessageBox.Show("Um eine bestehende Krankenkasse zu bearbeiten, muss zunächst eine Krankenkasse ausgewählt werden.");
            }
            else
            {
                using (var formInsurance = new FrmInsuranceAgency(selectedInsurance))
                {
                    var result = formInsurance.ShowDialog();

                    if (result == DialogResult.OK)
                    {
                        var insuranceAgency = formInsurance.insuranceAgency;

                        InitializeInsuranceAgencies();

                        selectedInsurance         = insuranceAgency;
                        cbInsurance.SelectedIndex = insuranceAgencies.Select(o => o.Id).ToList().IndexOf(selectedInsurance.Id);
                    }
                }
            }
        }
Example #6
0
 private void CbInsurance_SelectedIndexChanged(object sender, EventArgs e)
 {
     selectedInsurance = insuranceAgencies[cbInsurance.SelectedIndex];
 }