コード例 #1
0
        private void dataGridMed1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            try
            {
                int  index = dataGridMed1.CurrentCell.RowIndex;
                bool edit  = true;

                AddMed AdM = new AddMed(this, index, edit, flag);
                AdM.Show();
            }
            catch (NullReferenceException)
            {
            }
        }
コード例 #2
0
        private void добавитьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (tabControl1.SelectedTab == tabPage1)
            {
                AddMed addMed = new AddMed(this);
                addMed.Show();
                Update();
            }

            if (tabControl1.SelectedTab == tabPage2)
            {
                AddApp addApp = new AddApp(this);
                addApp.Show();
                Update();
            }

            if (tabControl1.SelectedTab == tabPage3)
            {
                AddInvoce addInv = new AddInvoce(this);
                addInv.Show();
                Update();
            }
        }
コード例 #3
0
        private void редактироватьToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                if (tabControl1.SelectedTab == tabPage1)
                {
                    int  index = dataGridMed1.CurrentCell.RowIndex;
                    bool edit  = true;

                    AddMed AdM = new AddMed(this, index, edit, flag);
                    AdM.Show();
                }

                if (tabControl1.SelectedTab == tabPage2)
                {
                    int  ind   = dataGridApp.CurrentCell.RowIndex;
                    bool edit2 = true;

                    AddApp AdA = new AddApp(this, ind, edit2, flag);
                    AdA.Show();
                }

                if (tabControl1.SelectedTab == tabPage3)
                {
                    int  ind   = dataGridInvoice.CurrentCell.RowIndex;
                    bool edit2 = true;

                    AddInvoce AdI = new AddInvoce(this, ind, edit2, flag);
                    AdI.Show();
                }
            }
            catch (NullReferenceException)
            {
                MessageBox.Show("Выберите строку для редактирования");
            }
        }