private void btn_add_Click(object sender, EventArgs e) { PL.FRM_PUR_ADD frm_add = new FRM_PUR_ADD(); frm_add.id = 0; frm_add.btn_add.Text = "اضافة"; frm_add.Show(); }
//edit private void btn_edit_Click(object sender, EventArgs e) { PL.FRM_PUR_ADD frm_add = new FRM_PUR_ADD(); id = Convert.ToInt32(gridView1.GetFocusedRowCellValue("ID")); tb_pur = db.TB_PUR.Where(x => x.ID == id).FirstOrDefault(); frm_add.edt_name.Text = tb_pur.Pur_Name; frm_add.edt_type.Text = tb_pur.Pur_Type; frm_add.edt_cat.Text = tb_pur.Pur_Cat; frm_add.edt_sup.Text = tb_pur.Pur_Sup; frm_add.edt_det.Text = tb_pur.Pur_Det; frm_add.edt_buy.Text = tb_pur.Pur_Buy.ToString(); frm_add.edt_sell.Text = tb_pur.Pur_Sell.ToString(); frm_add.edt_qt.Text = tb_pur.Pur_Qt.ToString(); frm_add.edt_tsell.Text = tb_pur.Pur_Tsell.ToString(); frm_add.edt_tbuy.Text = tb_pur.Pur_Tbuy.ToString(); frm_add.edt_trev.Text = tb_pur.Pur_TRev.ToString(); frm_add.id = id; frm_add.btn_add.Text = "تعديل"; frm_add.Show(); }