Exemplo n.º 1
0
        public DoctorViewModel(INavigation navigation, Model.Doctor doctor)
        {
            NewDoctor           = doctor;
            SaveDoctorCommand   = new Command(async() => await SaveDoctor());
            DeleteDoctorCommand = new Command(async() => await DeleteDoctor());

            Navigation = navigation;
        }
Exemplo n.º 2
0
        public FrmDoctor(Model.Doctor editDoctor)
        {
            InitializeComponent();

            doctor             = editDoctor;
            selectedAddress    = editDoctor.Address;
            tbSubjectArea.Text = editDoctor.SubjectArea;
            tbNote.Text        = editDoctor.Note;

            InitializeAddresses();
        }
Exemplo n.º 3
0
        private void BtnAddDoctor_Click(object sender, EventArgs e)
        {
            using (var formDoctor = new FrmDoctor())
            {
                var result = formDoctor.ShowDialog();

                if (result == DialogResult.OK)
                {
                    var doctor = formDoctor.doctor;

                    InitializeDoctors();

                    selectedDoctor         = doctor;
                    cbDoctor.SelectedIndex = doctors.Select(o => o.Id).ToList().IndexOf(selectedDoctor.Id);
                }
            }
        }
Exemplo n.º 4
0
        public bool AddDoctor(Model.Doctor entity)
        {
            var validation = new DoctorValidation.DoctorEntityValidate().Validate(entity);

            if (!validation.IsValid)
            {
                throw new ValidationException(validation.Errors);
            }

            using (var db = new Model.PhysicManagementEntities())
            {
                entity.IsActive = true;
                entity.Password = EncryptPassword(entity.Username, entity.Password);
                db.Doctor.Add(entity);
                return(db.SaveChanges() == 1);
            }
        }
Exemplo n.º 5
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();
        }
Exemplo n.º 6
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (selectedAddress == null)
            {
                MessageBox.Show("Der Arzt kann nicht gespeichert werden ohne gültige Adressdaten.");
            }
            else
            {
                if (doctor != null) // edit handover doctor
                {
                    doctor.Address     = selectedAddress;
                    doctor.SubjectArea = tbSubjectArea.Text;
                    doctor.Note        = tbNote.Text;

                    doctor.Update();
                }
                else
                {
                    doctor = new Model.Doctor(selectedAddress, tbSubjectArea.Text, tbNote.Text); // create new doctor
                }
                this.DialogResult = DialogResult.OK;
            }
        }
Exemplo n.º 7
0
        private void BtnEditDoctor_Click(object sender, EventArgs e)
        {
            if (selectedDoctor == null)
            {
                MessageBox.Show("Um einen bestehenden Arzt zu bearbeiten, muss zunächst ein Arzt ausgewählt werden.");
            }
            else
            {
                using (var formDoctor = new FrmDoctor(selectedDoctor))
                {
                    var result = formDoctor.ShowDialog();

                    if (result == DialogResult.OK)
                    {
                        var doctor = formDoctor.doctor;

                        InitializeDoctors();

                        selectedDoctor         = doctor;
                        cbDoctor.SelectedIndex = doctors.Select(o => o.Id).ToList().IndexOf(selectedDoctor.Id);
                    }
                }
            }
        }
Exemplo n.º 8
0
        public bool UpdateDoctor(Model.Doctor entity)
        {
            var validation = new DoctorValidation.DoctorEntityValidate().Validate(entity);

            if (!validation.IsValid)
            {
                throw new ValidationException(validation.Errors);
            }

            using (var db = new Model.PhysicManagementEntities())
            {
                var Entity = db.Doctor.Find(entity.Id);
                Entity.FirstName   = entity.FirstName;
                Entity.LastName    = entity.LastName;
                Entity.Gender      = entity.Gender;
                Entity.Mobile      = entity.Mobile;
                Entity.Code        = entity.Code;
                Entity.Degree      = entity.Degree;
                Entity.Description = entity.Description;
                Entity.Password    = EncryptPassword(entity.Username, entity.Password);

                return(db.SaveChanges() == 1);
            }
        }
Exemplo n.º 9
0
 private void CbDoctor_SelectedIndexChanged(object sender, EventArgs e)
 {
     selectedDoctor = doctors[cbDoctor.SelectedIndex];
 }
Exemplo n.º 10
0
 public Appointment DoctorPriority(Model.Doctor parameter1)
 {
     // TODO: implement
     return(null);
 }
Exemplo n.º 11
0
 public void ReschedulePatient(DateTime tImeStart, DateTime timeEnd, Model.Doctor doctor, Model.Room room, String id)
 {
     // TODO: implement
 }
Exemplo n.º 12
0
 public Appointment ScedulePatient(DateTime timeStart, DateTime endTime, Model.Doctor doctor, Model.Room room, String id)
 {
     // TODO: implement
     return(null);
 }