private void btnSelectCust_Click(object sender, EventArgs e) { CustPicture.Image = null; PL.FRM_CUSTOMERS_LIST frm = new FRM_CUSTOMERS_LIST(); frm.ShowDialog(); if (frm.DGVCustomers.CurrentRow.Cells[5].Value is DBNull) { MessageBox.Show("هذا العميل لا يتوفر على صوره"); txtCustID.Text = frm.DGVCustomers.CurrentRow.Cells[0].Value.ToString(); txtCustFirstName.Text = frm.DGVCustomers.CurrentRow.Cells[1].Value.ToString(); txtCustLastName.Text = frm.DGVCustomers.CurrentRow.Cells[2].Value.ToString(); txtCustPhone.Text = frm.DGVCustomers.CurrentRow.Cells[3].Value.ToString(); txtCustMail.Text = frm.DGVCustomers.CurrentRow.Cells[4].Value.ToString(); return; } txtCustID.Text = frm.DGVCustomers.CurrentRow.Cells[0].Value.ToString(); txtCustFirstName.Text = frm.DGVCustomers.CurrentRow.Cells[1].Value.ToString(); txtCustLastName.Text = frm.DGVCustomers.CurrentRow.Cells[2].Value.ToString(); txtCustPhone.Text = frm.DGVCustomers.CurrentRow.Cells[3].Value.ToString(); txtCustMail.Text = frm.DGVCustomers.CurrentRow.Cells[4].Value.ToString(); // this for image byte[] custImage = (byte[])frm.DGVCustomers.CurrentRow.Cells[5].Value; MemoryStream ms = new MemoryStream(custImage); CustPicture.Image = Image.FromStream(ms); }
private void ادارهالعملاءToolStripMenuItem_Click(object sender, EventArgs e) { FRM_CUSTOMERS_LIST FRM = new FRM_CUSTOMERS_LIST(); FRM.ShowDialog(); }