Пример #1
0
        private void btnDuzelt_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count <= 0)
            {
                MessageBox.Show("Select row to Edit");
                return;
            }


            DataRowView row = (DataRowView)dataGridView1.SelectedRows[0].DataBoundItem;

            ProductEntity pro = new ProductEntity();

            pro.Id          = Convert.ToInt32(row[0]);
            pro.Name        = row[1].ToString();
            pro.Stock       = Convert.ToInt32(row[2]);
            pro.Price       = Convert.ToInt32(row[3]);
            pro.CategoryId  = Convert.ToInt32(row[4]);
            pro.ProductCode = row[5].ToString();

            FrmProEdit frm = new FrmProEdit(pro);

            frm.ShowDialog();
            RefreshGrid();
        }
Пример #2
0
        private void btnEkle_Click(object sender, EventArgs e)
        {
            FrmProEdit frm = new FrmProEdit();

            frm.ShowDialog();

            RefreshGrid();
        }