//add private void btn_add_Click(object sender, EventArgs e) { FRM_CAT_ADD frm_add = new FRM_CAT_ADD(); frm_add.id = 0; frm_add.btn_add.Text = "اضافة"; frm_add.Show(); }
//edit private void btn_edit_Click(object sender, EventArgs e) { FRM_CAT_ADD frm_add = new FRM_CAT_ADD(); id = Convert.ToInt32(gridView1.GetFocusedRowCellValue("ID")); tb_cat = db.TB_CAT.Where(x => x.ID == id).FirstOrDefault(); frm_add.txt_name.Text = tb_cat.CAT_Name.ToString(); frm_add.txt_price_buy.Text = tb_cat.CAT_Price_buy.ToString(); frm_add.txt_price_sell.Text = tb_cat.CAT_Price_sale.ToString(); frm_add.id = id; frm_add.btn_add.Text = "تعديل"; frm_add.Show(); }