Exemple #1
0
        private void petPage_button_Click(object sender, EventArgs e)
        {
            EditPetForm EPF = new EditPetForm(editPet, user, false, true);

            EPF.Owner = this;
            EPF.ShowDialog();
        }
Exemple #2
0
        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();
            }
        }
Exemple #3
0
        private void edit_button_Click(object sender, EventArgs e)
        {
            if (pets_dataGridView.SelectedRows.Count != 0)
            {
                Pets editPet = new Pets();
                editPet.ID = Convert.ToInt32(pets_dataGridView.SelectedRows[0].Cells["idDataGridViewTextBoxColumn"].Value);
                //editPet.GetInfo();

                EditPetForm EPF       = new EditPetForm(editPet, user, false, false);
                Container   container = this.MdiParent as Container;
                container.MakeFormHooks(EPF);
                EPF.ShowDialog();
                this.v_petsTableAdapter.Fill(this.monamurDBDataSet.V_pets);
                SelectRow(editPet.ID);
            }
        }
        private void save_button_Click(object sender, EventArgs e)
        {
            int    clientId  = Convert.ToInt32(client_dataGridView.SelectedRows[0].Cells["idDataGridViewTextBoxColumn"].Value);
            string clientFio = client_dataGridView.SelectedRows[0].Cells["fioDataGridViewTextBoxColumn"].Value.ToString();

            if (newPet)
            {
                AddPetForm APF = this.Owner as AddPetForm;
                if (APF != null)
                {
                    APF.SetClient(clientId, clientFio);
                }
            }
            else
            {
                EditPetForm EPF = this.Owner as EditPetForm;
                if (EPF != null)
                {
                    EPF.SetClient(clientId, clientFio);
                }
            }

            this.Close();
        }