Beispiel #1
0
        private void dgv_suppliers_DoubleClick(object sender, EventArgs e)
        {
            textBox1.Text = dgv_suppliers.Rows[dgv_suppliers.CurrentRow.Index].Cells["pv_id"].Value.ToString();

            if (formulario_devolver == true)
            {
                DialogResult = DialogResult.OK;
                this.Close();
            }
            else if (formulario_devolver == false)
            {
                addsupplier f = new addsupplier();
                f.formulario_devolver = true;
                f.txt_pv_id.Text      = dgv_suppliers.Rows[dgv_suppliers.CurrentRow.Index].Cells["pv_id"].Value.ToString();
                if (f.ShowDialog() == DialogResult.OK)
                {
                    load_suppliers_dgv();
                }
            }
        }
Beispiel #2
0
        private void btn_addsupplier_Click(object sender, EventArgs e)
        {
            addsupplier f = new addsupplier();

            try
            {
                Form frm2 = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is addsupplier);
                if (frm2 != null)
                {
                    frm2.BringToFront();
                    MessageBox.Show("Esta ventana ya esta abierta.", "Error");
                    return;
                }
                else
                {
                    f.MdiParent = this.MdiParent;
                    f.Show();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("No se puede abrir el ventana solicitado. Razón: " + ex.Message, "Error al abrir la ventana.", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }