Пример #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmAddPart f = new frmAddPart(this);

            f.MdiParent     = this.MdiParent;
            f.StartPosition = FormStartPosition.CenterScreen;
            f.Show();
        }
Пример #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            try
            {
                object id = dataGridView1.CurrentRow.Cells["PART_id"].Value;

                DataRow selectedRow = dtParts.Rows.Find(id);

                frmAddPart f = new frmAddPart(selectedRow, this);
                f.MdiParent     = this.MdiParent;
                f.StartPosition = FormStartPosition.CenterScreen;
                f.Show();
            }
            catch (Exception ex) { }
        }
Пример #3
0
        //-----------------------------------------------------------------------------------------------------
        private void btnEditPart_Click(object sender, EventArgs e)
        {
            try
            {
                int id = (int)dataGridViewParts2.CurrentRow.Cells["PartID"].Value;

                ClassLibrary.Part part = new ClassLibrary.Part();
                part.Id = id;
                DataTable thisTable = part.Get().Tables[0];
                DataRow[] rows      = thisTable.Select();

                foreach (DataRow row in rows)
                {
                    frmAddPart f = new frmAddPart(row, this);
                    f.MdiParent     = this.MdiParent;
                    f.StartPosition = FormStartPosition.CenterScreen;
                    f.Show();
                }
            }
            catch (Exception ex) { }
        }