private void pictureBoxProperty_Click(object sender, EventArgs e) { ClientArr clientArr = new ClientArr(); ProductArr productArr = new ProductArr(); productArr.Fill(); clientArr.Fill(); Client client = GetClientFromForm(); Product product = productArr.FilterWithID(Convert.ToInt32(((PictureBox)sender).Tag)); if (labelWelcome.Visible == false || labelWelcome.Text == "") { MessageBox.Show("חובה להירשם לפני השכרה", "רישום", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading); } else if (product == null) { MessageBox.Show("אין נכס", "בחירה שגויה", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading); } else { //שולח את הנכס ואת הלקוח שרוצה להשכיר FormToRent formToRent = new FormToRent(client, product); formToRent.ShowDialog(); } }
private void pictureBoxUpdateProduct(object sender, EventArgs e) { tabHouses.SelectedTab = tabPageWantToHost; ProductArr productArr = new ProductArr(); productArr.Fill(); Product product = productArr.FilterWithID(Convert.ToInt32((sender as PictureBox).Tag)); ProductToForm(product); }