예제 #1
0
        private void btnok_Click(object sender, EventArgs e)
        {
            Groupform ChangeGRPfrm = (Groupform)this.Owner;
            string    id           = Convert.ToString(ChangeGRPfrm.dgvgroup.Rows[ChangeGRPfrm.dgvgroup.CurrentRow.Index].Cells["id"].Value);

            string txtQueryChangeClass = "UPDATE groupt SET name='" + txtnamegrp.Text + "' WHERE id='" + id + "'";

            _SQl.SQL_Query(txtQueryChangeClass);

            this.Close();

            ChangeGRPfrm.load_group();
        }
예제 #2
0
        private void группыТоваровToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // проверяем не запущена ли форма
            for (int x = 0; x < this.MdiChildren.Length; x++)
            {
                if (this.MdiChildren[x].Name == "Groupform")
                {
                    this.MdiChildren[x].Focus();
                    return;
                }
            }

            // Запускаем форму если она не запущена
            Form Groupform = new Groupform();

            Groupform.StartPosition = FormStartPosition.CenterScreen;
            Groupform.WindowState   = FormWindowState.Maximized;
            //указываем владельца для формы
            Groupform.MdiParent = this;      // где containerInstance - это экземпляр контейнера или указатель на MainForm
            Groupform.Show();
            AttachAsMDIChild(Groupform);
        }
예제 #3
0
        private void btnok_Click(object sender, EventArgs e)
        {
            Groupform NewGRPsfrm = (Groupform)this.Owner;

            DataTable DTngrp = _SQl.ExecuteSQL("SELECT max(id) FROM Groupt");

            if (DTngrp.Rows[0][0].ToString() == "")
            {
                int    id_grpn             = 1;
                string txtQueryNewClassAdd = "INSERT INTO groupt VALUES('" + id_grpn + "','" + txtnamegrp.Text + "')";
                _SQl.SQL_Query(txtQueryNewClassAdd);
            }
            else
            {
                int    id_grpn             = Convert.ToInt32(DTngrp.Rows[0][0].ToString()) + 1;
                string txtQueryNewClassAdd = "INSERT INTO groupt VALUES('" + id_grpn + "','" + txtnamegrp.Text + "')";
                _SQl.SQL_Query(txtQueryNewClassAdd);
            }


            this.Close();

            NewGRPsfrm.load_group();
        }
예제 #4
0
        private void ChangeGroupform_Load(object sender, EventArgs e)
        {
            Groupform ChangeGRPfrm = (Groupform)this.Owner;

            txtnamegrp.Text = Convert.ToString(ChangeGRPfrm.dgvgroup.Rows[ChangeGRPfrm.dgvgroup.CurrentRow.Index].Cells["name"].Value);
        }