private void editToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewRow Row = dataGridView.SelectedRows[0]; /// edit mode AddDeviceForm addContactForm = new AddDeviceForm { // ID Label.. TextBoxName = Row.Cells["FirstName"].Value.ToString(), TextBoxLastName = Row.Cells["LastName"].Value.ToString(), TextBoxPhoneNumber = Row.Cells["PhoneNumber"].Value.ToString(), TextBoxeMail = Row.Cells["e-Mail"].Value.ToString(), TextBoxBrand = Row.Cells["Brand"].Value.ToString(), TextBoxModel = Row.Cells["Model"].Value.ToString(), TextBoxIMEI = Row.Cells["IMEI"].Value.ToString(), TextBoxProblem = Row.Cells["Problem"].Value.ToString(), TextBoxPrice = Row.Cells["Price"].Value.ToString(), CustomerID = int.Parse(Row.Cells["IdCustomer"].Value.ToString()) }; addContactForm.EditMode(true); // send ID. addContactForm.ShowDialog(); LoadContacts("devices"); }
private void ToolStripButtonAdd_Click(object sender, EventArgs e) { AddDeviceForm addContactForm = new AddDeviceForm(); addContactForm.ShowDialog(); LoadContacts("devices"); UpdateHeadStatus(); }
private void StartAddDevice(object sender, EventArgs e) { if (!addfrm.Visible) { addfrm.ShowDialog(); } else { addfrm.BringToFront(); } }