Example #1
0
        private void ToolStripButton2_Click(object sender, EventArgs e)
        {
            my.Szap = Dgv1.Rows[Dgv1.CurrentCell.RowIndex].Cells[0].Value.ToString();

            if (!my.isFormInMdi("frmCapSm", (int)Dgv1.Rows[Dgv1.CurrentCell.RowIndex].Cells[0].Value, my.MDIForm))
            {
                frmCapSm fr = new frmCapSm();
                fr.idsm = (int)Dgv1.Rows[Dgv1.CurrentCell.RowIndex].Cells["idsm"].Value;
                //fr.MdiParent = my.MDIForm;
                fr.Tag = fr.idsm;
                fr.ShowDialog();
                //spisok();
            }
        }
Example #2
0
        private void Dgv1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (Dgv1.Columns.Contains("IdSm"))
            {
                if (MessageBox.Show("Перейти в выбранную смету?", "Внимание!", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    my.Szap = Dgv1.Rows[e.RowIndex].Cells[0].Value.ToString();

                    if (!my.isFormInMdi("frmCapSm", (int)Dgv1.Rows[e.RowIndex].Cells[0].Value, my.MDIForm))
                    {
                        frmCapSm fr = new frmCapSm();
                        fr.idsm = (int)Dgv1.Rows[e.RowIndex].Cells["IdSm"].Value;
                        fr.Tag  = Dgv1.Rows[e.RowIndex].Cells["IdSm"].Value;
                        fr.ShowDialog();
                    }
                }
            }
        }