private void save_button_Click(object sender, EventArgs e) { int breedId = Convert.ToInt32(breed_dataGridView.SelectedRows[0].Cells["idDataGridViewTextBoxColumn"].Value); string breed = breed_dataGridView.SelectedRows[0].Cells["breedDataGridViewTextBoxColumn"].Value.ToString(); if (newPet) { AddPetForm APF = this.Owner as AddPetForm; if (APF != null) { APF.SetBreed(breedId, breed); } this.Close(); } if (editPet) { EditPetForm EPF = this.Owner as EditPetForm; if (EPF != null) { EPF.SetBreed(breedId, breed); } this.Close(); } if (petsList) { PetsForm PF = this.Owner as PetsForm; if (PF != null) { PF.SetFilterBreed(breedId, breed); } this.Close(); } }
private void питомцыToolStripMenuItem_Click(object sender, EventArgs e) { RestartTimer(); CloseMdiChild(); PetsForm PF = new PetsForm(user); PF.MdiParent = this; MakeFormHooks(PF); PF.Show(); }