Пример #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Clinic clinic = new Clinic()
            {
                Identifier = int.Parse(txtClinicNumber.Text),
                Title = (Title)Enum.Parse(typeof(Title), cboTitle.Text),
                LastName = txtLastName.Text,
                FirstName = txtFirstName.Text,
                Specialty = txtSpecialty.Text,
                Department = txtDepartment.Text,
                Address = txtAddress.Text,
                Telephone = txtTelephone.Text,
                Email = txtEmail.Text,
                CreatedAt = DateTime.Now
            };

            using (ClinicModel context = new ClinicModel())
            {
                context.Clinicians.Add(clinic);

                context.SaveChanges();
            }

            MessageBox.Show("Clinic Saved");

            Close();
        }
Пример #2
0
 public frmEditClinic(Clinic clinic) : this()
 {
     this._clinic = clinic;
 }