private void newProductToolStripMenuItem_Click(object sender, EventArgs e) { var childForm = new ProductEditForm(null, user, null); childForm.MdiParent = this; childForm.Text = "New Product"; childForm.Show(); }
private void productsGrid_CellClick(object sender, DataGridViewCellEventArgs e) { var dr = ds.Rows[e.RowIndex]; var product = new Product(Convert.ToInt64(dr["ProductId"]), dr["ProductName"].ToString(), dr["Description"].ToString(), Convert.ToInt16(dr["UnitId"]), Convert.ToInt16(dr["SupplierId"])); var productEdit = new ProductEditForm(product, user, this); productEdit.MdiParent = this.MdiParent; productEdit.Show(); }