private void AddBtn_Click(object sender, EventArgs e) { AddEditPeople people = new AddEditPeople(ClinicId); if (people.ShowDialog() == DialogResult.OK) { initPeopleGrid(); } }
private void EditBtn_Click(object sender, EventArgs e) { int id = int.Parse(PeoplesGrid.Rows[int.Parse(PeoplesGrid.CurrentCell.RowIndex.ToString())].Cells[0].Value.ToString()); AddEditPeople people = new AddEditPeople(ClinicId, id); if (people.ShowDialog() == DialogResult.OK) { initPeopleGrid(); } }
private void CheckBtn_Click(object sender, EventArgs e) { People p = peopleRepository.GetPeopleByCode(ClinicId, CodeMelliTxt.Text); if (p == null) { if (MessageBox.Show("فرد مورد نظر در دیتابیس وجود ندارد\n مایل به افزودن آن هستید ؟", "هشدار", MessageBoxButtons.YesNo) == DialogResult.Yes) { AddEditPeople addPeople = new AddEditPeople(ClinicId); addPeople.Show(); } } else { NameLbl.Text = ""; NameLbl.Text += p.Name + " " + p.Family; CodeMelliLbl.Text = p.CodeMelli; people = p; } }