//add private void btn_add_Click(object sender, EventArgs e) { FRM_SUP_ADD frm_add = new FRM_SUP_ADD(); frm_add.id = 0; frm_add.btn_add.Text = "اضافة"; frm_add.Show(); }
//edit private void btn_edit_Click(object sender, EventArgs e) { FRM_SUP_ADD frm_add = new FRM_SUP_ADD(); id = Convert.ToInt32(gridView1.GetFocusedRowCellValue("ID")); tb_sup = db.TB_SUP.Where(x => x.ID == id).FirstOrDefault(); frm_add.txt_name.Text = tb_sup.Sup_Name.ToString(); frm_add.txt_phone.Text = tb_sup.Sup_Phone.ToString(); frm_add.dateTimePicker1.Value = tb_sup.Sup_Start_Date.Value; frm_add.id = id; frm_add.btn_add.Text = "تعديل"; frm_add.Show(); }
private void btnAddSup_Click(object sender, EventArgs e) { FRM_SUP_ADD frm_addcat = new FRM_SUP_ADD(); frm_addcat.ShowDialog(); }