private void recruitment(object sender, RoutedEventArgs e)
        {
            Window a = new HRMRecruitment(employee);

            a.Show();
            this.Close();
        }
        private void submit(object sender, RoutedEventArgs e)
        {
            if (nametxt.Text.Equals(""))
            {
                MessageBox.Show("Name Must Not Be Empty!");
                return;
            }
            if (combobox.SelectedIndex == -1)
            {
                MessageBox.Show("Division Must Be Selected!");
                return;
            }
            DataTable datatable = new DataTable();

            datatable = connect.executeQuery("select * from candidate order by id desc");
            if (datatable.Rows.Count != 0)
            {
                DataRow datarow = datatable.Rows[0];
                connect.executeUpdate("insert into candidate values ('" + (Int32.Parse(datarow["id"].ToString()) + 1) + "','" + nametxt.Text + "','" + combobox.SelectedValue.ToString() + "')");
            }
            else
            {
                connect.executeUpdate("insert into candidate values ('" + (datatable.Rows.Count + 1) + "','" + nametxt.Text + "','" + combobox.SelectedValue.ToString() + "')");
            }
            MessageBox.Show("Success!");
            Window a = new HRMRecruitment(employee);

            a.Show();
            this.Close();
        }
Example #3
0
        private void deleteall(object sender, RoutedEventArgs e)
        {
            connect.executeUpdate("delete from candidate");
            MessageBox.Show("Success Delete All Candidate Employee!");
            Window a = new HRMRecruitment(employee);

            a.Show();
            this.Close();
        }