private void mbtnInsert_Click(object sender, EventArgs e)
        {
            var entity = new AppointmentEntity();
            var repo   = new AppointmentRepo();

            //var app = new Appoinment();
            //entity.ConvertToEntity(this);
            entity.GeneratedId      = this.txtId.Text;
            entity.PatientName      = this.lblName.Text;
            entity.PatientAge       = Int32.Parse(this.lblAge.Text);
            entity.PatientSex       = this.lblSex.Text;
            entity.PatientReference = this.lblRefer.Text;
            entity.AppoinmentDate   = this.mdtAppoinmentDate.Value.Date.ToString("yyyy-MM-dd");
            entity.PatientDoctor    = mgvDoctorAppointment.CurrentRow.Cells["name"].Value.ToString();
            entity.Time             = this.dtpTime.Value.ToString();
            if (MessageBox.Show("Are you sure?", "Confirmation", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }
            else
            {
                repo.InsertAppoinment(entity);
                this.Hide();
                re.Show();
                re.Clear();
            }
        }
Esempio n. 2
0
 private void mbtnBack_Click(object sender, EventArgs e)
 {
     this.Hide();
     re.Show();
     re.Clear();
 }