// clear all entry boxes private void ClearBoxes() { ActiveStateCbo.SelectedIndex = 0; CompanyNameBox.Clear(); StaffingFirmBox.Clear(); JobTitleBox.Clear(); JobStatusCbo.SelectedIndex = 0; JobBoardCbo.SelectedIndex = 0; JobIDBox.Clear(); NameBox.Clear(); ContactTitleBox.Clear(); ContactPhoneBox.Clear(); ContactEmailBox.Clear(); AddressBox.Clear(); JobLocationBox.Clear(); CompanyPhoneBox.Clear(); CompanyWebsiteBox.Clear(); CommentsBox.Clear(); ContactDatePkr.Value = DateTime.Now; InterviewDateTimeBox.Clear(); idSelected = 0; DWSChk.Checked = false; RecruiterChk.Checked = false; JobTypeCbo.SelectedIndex = 0; }
//changes the text of an invisible text box to the ID number of the job in the drop down menu private void showchngJobID() { String query = "SELECT [JobID] FROM Jobs where [Job Name] = @JobName"; using (connection = new SqlConnection(connectionString)) using (SqlCommand command = new SqlCommand(query, connection)) using (SqlDataAdapter adapter = new SqlDataAdapter(command)) { command.Parameters.AddWithValue("@JobName", JobBox.Text); connection.Open(); SqlDataReader cr = command.ExecuteReader(); if (cr.Read()) { JobIDBox.Text = (cr["JobID"].ToString()); } else { JobIDBox.Clear(); } } }