public DoctorViewModel(INavigation navigation, Model.Doctor doctor) { NewDoctor = doctor; SaveDoctorCommand = new Command(async() => await SaveDoctor()); DeleteDoctorCommand = new Command(async() => await DeleteDoctor()); Navigation = navigation; }
public FrmDoctor(Model.Doctor editDoctor) { InitializeComponent(); doctor = editDoctor; selectedAddress = editDoctor.Address; tbSubjectArea.Text = editDoctor.SubjectArea; tbNote.Text = editDoctor.Note; InitializeAddresses(); }
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); } } }
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); } }
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("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; } }
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); } } } }
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); } }
private void CbDoctor_SelectedIndexChanged(object sender, EventArgs e) { selectedDoctor = doctors[cbDoctor.SelectedIndex]; }
public Appointment DoctorPriority(Model.Doctor parameter1) { // TODO: implement return(null); }
public void ReschedulePatient(DateTime tImeStart, DateTime timeEnd, Model.Doctor doctor, Model.Room room, String id) { // TODO: implement }
public Appointment ScedulePatient(DateTime timeStart, DateTime endTime, Model.Doctor doctor, Model.Room room, String id) { // TODO: implement return(null); }