private void btn_add_Click(object sender, EventArgs e) { PL.FRM_SUP_ADD frm_add = new FRM_SUP_ADD(); frm_add.id = 0; frm_add.btn_add.Text = "اضافة"; frm_add.Show(); }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { PL.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) { PL.FRM_SUP_ADD frm_add = new FRM_SUP_ADD(); id = Convert.ToInt32(tileView1.GetFocusedRowCellValue("ID")); tb_sup = db.TB_SUP.Where(x => x.ID == id).FirstOrDefault(); frm_add.edt_name.Text = tb_sup.Sup_Name.ToString(); frm_add.edt_phone.Text = tb_sup.Sup_Phone.ToString(); frm_add.edt_email.Text = tb_sup.Sup_Email.ToString(); methods.by = tb_sup.Sup_image; frm_add.pic_cover.Image = Image.FromStream(methods.convert_image()); frm_add.id = id; frm_add.btn_add.Text = "تعديل"; frm_add.Show(); }