private void buttonAddFind_Click(object sender, EventArgs e) { // Validate ID Input if (!validateID()) { return; } if (this.requetsType == "Add") {// Current Form Request is Add if (validateData()) {// Detiles are OK current.AddEmployee(comboBoxEmloyeeType.Text, textBoxNameFirst.Text, textBoxNameLast.Text, textBoxAddress.Text, textBoxPhoneNumber.Text, textBoxEmail.Text, Convert.ToInt32(textBoxID.Text), float.Parse(textBoxSallary.Text), textBoxCertificate.Text, textBoxPassword.Text); refresher(); } return; } // Current Form Request is Edit / Delete (Button Text is Find) employeeObject = dbConnector.Instance.getEmployeeById(Convert.ToInt64(textBoxID.Text)); if (employeeObject == null) { // Employee Not Found MessageBox.Show("There is no Employee with this id"); return; } // Employee Found panelData.Visible = true; // Fill Data comboBoxEmloyeeType.Text = employeeObject.GetType().Name; textBoxNameFirst.Text = employeeObject.getNameFirst(); textBoxNameLast.Text = employeeObject.getNameLast(); textBoxPhoneNumber.Text = employeeObject.getPhoneNumber(); textBoxEmail.Text = employeeObject.getEmailAddress(); textBoxAddress.Text = employeeObject.getHomeAddress(); textBoxSallary.Text = employeeObject.getSallaryPerHour().ToString(); // Check if Employee is a Trainer if (employeeObject.getPermissionLevel() == PermissiomLevels.TRIANER) { textBoxCertificate.Text = ((Trainer)employeeObject).getTrainerCartificate(); } buttonSave.Enabled = true; }