Esempio n. 1
0
        /* Добавить */
        private void button2_Click(object sender, EventArgs e)
        {
            AddEditMAType am = new AddEditMAType();

            am.ShowDialog();
            this.Close();
        }
Esempio n. 2
0
 private void редактироватьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         globalData.maplan = 0;
         int           ri = dgv1.SelectedCells[0].RowIndex;
         AddEditMAType am = new AddEditMAType(Convert.ToInt32(dgv1[0, ri].Value), dgv1[1, ri].Value.ToString(), dgv1[2, ri].Value.ToString(), dgv1[3, ri].Value.ToString(), dgv1[4, ri].Value.ToString(), dgv1[5, ri].Value.ToString(), 1);
         am.ShowDialog();
     }
     catch
     {
         MessageBox.Show("Не удалось. Обратитесь к администратору системы.");
     }
 }
Esempio n. 3
0
        private void dgv1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex != -1 && e.ColumnIndex != 3)
                {
                    Sql sql1 = new Sql();

                    string count = sql1.GetRecordsOne("exec MarkAct_Select_Plan @p1, @p2, @p3", dgv1[0, e.RowIndex].Value.ToString(), globalData.year, 0);

                    if (count == "0")
                    {
                        globalData.maplan = 0;
                        AddEditMAType am = new AddEditMAType(Convert.ToInt32(dgv1[0, e.RowIndex].Value), dgv1[1, e.RowIndex].Value.ToString(), dgv1[2, e.RowIndex].Value.ToString(), dgv1[3, e.RowIndex].Value.ToString(), dgv1[4, e.RowIndex].Value.ToString(), dgv1[5, e.RowIndex].Value.ToString());
                        am.ShowDialog();
                    }
                    else if (count == "1")
                    {
                        globalData.maplan = Convert.ToInt32(sql1.GetRecordsOne("exec MarkAct_Select_Plan @p1, @p2, @p3", dgv1[0, e.RowIndex].Value.ToString(), globalData.year, 1));
                    }
                    else
                    {
                        AddConf ac = new AddConf(Convert.ToInt32(dgv1[0, e.RowIndex].Value.ToString()), false);
                        ac.ShowDialog();
                    }
                }
            }
            catch
            {
            }
            finally
            {
                globalData.matype = dgv1[6, e.RowIndex].Value.ToString();
                this.Close();
            }
        }
Esempio n. 4
0
        private void dgv1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex != -1 && e.ColumnIndex != 3)
                {
                    Sql sql1 = new Sql();

                    string count = sql1.GetRecordsOne("exec MarkAct_Select_Plan @p1, @p2, @p3", dgv1[0, e.RowIndex].Value.ToString(), globalData.year, 0);

                    if (count == "0")
                    {
                        globalData.maplan = 0;
                        AddEditMAType am = new AddEditMAType(Convert.ToInt32(dgv1[0, e.RowIndex].Value), dgv1[1, e.RowIndex].Value.ToString(), dgv1[2, e.RowIndex].Value.ToString(), dgv1[3, e.RowIndex].Value.ToString(), dgv1[4, e.RowIndex].Value.ToString(), dgv1[5, e.RowIndex].Value.ToString());
                        am.ShowDialog();
                    }
                    else if (count == "1")
                    {
                        globalData.maplan = Convert.ToInt32(sql1.GetRecordsOne("exec MarkAct_Select_Plan @p1, @p2, @p3", dgv1[0, e.RowIndex].Value.ToString(), globalData.year, 1));
                    }
                    else
                    {
                        AddConf ac = new AddConf(Convert.ToInt32(dgv1[0, e.RowIndex].Value.ToString()), false);
                        ac.ShowDialog();

                    }
                }
            }
            catch
            {
            }
            finally
            {
                globalData.matype = dgv1[6, e.RowIndex].Value.ToString();
                this.Close();
            }
        }
Esempio n. 5
0
 /* Добавить */
 private void button2_Click(object sender, EventArgs e)
 {
     AddEditMAType am = new AddEditMAType();
     am.ShowDialog();
     this.Close();
 }
Esempio n. 6
0
 private void редактироватьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         globalData.maplan = 0;
         int ri = dgv1.SelectedCells[0].RowIndex;
         AddEditMAType am = new AddEditMAType(Convert.ToInt32(dgv1[0, ri].Value), dgv1[1, ri].Value.ToString(), dgv1[2, ri].Value.ToString(), dgv1[3, ri].Value.ToString(), dgv1[4, ri].Value.ToString(), dgv1[5, ri].Value.ToString(), 1);
         am.ShowDialog();
     }
     catch
     {
         MessageBox.Show("Не удалось. Обратитесь к администратору системы.");
     }
 }