private void buttonAdd_Click(object sender, RoutedEventArgs e) { var editDoctor = new EditDoctor(true); editDoctor.ShowDialog(); //this.Presenter.LoadDoctorsByCriterias(); }
//private Doctor GetSelectedDoctor() //{ // //var row = this.dataGridViewResult.SelectedItem;//currentrow было вместо колумна // //if (row == null) // //{ // // return null; // //} // //var doctor = (Doctor)row;//row.DataBoundItem; // //return doctor; //} private void buttonEdit_Click(object sender, RoutedEventArgs e) { var row = (System.Data.DataRowView)dataGridViewResult.SelectedItems[0]; var editDoctor = new EditDoctor(DoctorDataAccess.GetDoctorById(Convert.ToInt32(row.Row.ItemArray[0].ToString()))); editDoctor.ShowDialog(); //this.Presenter.LoadDoctorsByCriterias(); }
private void edirDoctor_Click(object sender, EventArgs e) { EditDoctor upcl = new EditDoctor(); upcl.id.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString(); upcl.textBsur.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); upcl.textBname.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); upcl.textBotch.Text = dataGridView1.CurrentRow.Cells[3].Value.ToString(); upcl.comboBsex.Text = dataGridView1.CurrentRow.Cells[4].Value.ToString(); upcl.dateBirth.Text = dataGridView1.CurrentRow.Cells[5].Value.ToString(); upcl.maskedSer.Text = dataGridView1.CurrentRow.Cells[6].Value.ToString(); upcl.maskedNum.Text = dataGridView1.CurrentRow.Cells[7].Value.ToString(); upcl.comboSpecialty.Text = dataGridView1.CurrentRow.Cells[8].Value.ToString(); upcl.textBpost.Text = dataGridView1.CurrentRow.Cells[9].Value.ToString(); upcl.maskedOklad.Text = dataGridView1.CurrentRow.Cells[10].Value.ToString(); upcl.maskedPhone.Text = dataGridView1.CurrentRow.Cells[11].Value.ToString(); upcl.textBemail.Text = dataGridView1.CurrentRow.Cells[12].Value.ToString(); this.Hide(); upcl.ShowDialog(); updateData(); this.Show(); }