예제 #1
0
        private void addNewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmInsertOrUpdateProduct frm = new frmInsertOrUpdateProduct();

            frm.WhenInsertDone += Frm_WhenInsertDone1;
            frm.ShowDialog();
        }
예제 #2
0
        private void updateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Product product = new Product()
            {
                Id          = int.Parse(grvData.CurrentRow.Cells["Id"].Value.ToString()),
                Quantity    = int.Parse(grvData.CurrentRow.Cells["Quantity"].Value.ToString()),
                Price       = float.Parse(grvData.CurrentRow.Cells["Price"].Value.ToString()),
                Code        = grvData.CurrentRow.Cells["Code"].Value.ToString(),
                Name        = grvData.CurrentRow.Cells["Name"].Value.ToString(),
                Description = grvData.CurrentRow.Cells["Description"].Value.ToString(),
                Image       = grvData.CurrentRow.Cells["Image"].Value.ToString(),
            };

            frmInsertOrUpdateProduct frm =
                new frmInsertOrUpdateProduct(product);

            frm.WhenInsertDone += Frm_WhenInsertDone;

            frm.ShowDialog();
        }