Пример #1
0
        private void BtnAdd_Click(object sender, System.EventArgs e)
        {
            var frm = new Form_ProductAddEdit
            {
                productCode = ""
            };

            if (frm.ShowDialog() == DialogResult.OK)
            {
                Populate();
            }
        }
Пример #2
0
        private void Gv_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                DataGridView senderGrid = (DataGridView)sender;

                if (senderGrid.Columns[e.ColumnIndex] is DataGridViewImageColumn && e.RowIndex >= 0)
                {
                    string productCode = gv.Rows[e.RowIndex].Cells[ConstColumns.PRODUCT_CODE].Value.ToString();
                    var    frm         = new Form_ProductAddEdit
                    {
                        productCode = productCode
                    };
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        Populate();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }