Ejemplo n.º 1
0
        private void materialRaisedButton2_Click(object sender, EventArgs e)
        {
            LoginRegisterForm jpform = new LoginRegisterForm();

            this.Hide();
            jpform.ShowDialog();
            this.Close();
        }
Ejemplo n.º 2
0
        private void Finish_addVacancy_button_Click(object sender, EventArgs e)
        {
            LoginRegisterForm jpform = new LoginRegisterForm();

            this.Hide();
            jpform.ShowDialog();
            this.Close();
        }
Ejemplo n.º 3
0
        private void finishCV_button_Click_1(object sender, EventArgs e)
        {
            string           ordb = "Data source=ORCL;User Id=scott;Password=tiger;";
            OracleConnection con;

            con = new OracleConnection(ordb);
            con.Open();
            OracleCommand cmd = new OracleCommand();

            cmd.Connection = con;
            //A) 3- insert
            cmd.CommandText = @"insert into job_seeker (jobseeker_id ,seekername , seekerpassword, email , gender , phone , city , country , education)
                                                    values(:seekerId , :seekerName, :seekerPass, :seekerEmail , :seekerGender, :seekerPhone, :seekerCity, :seekerCountry, :seekerEdu)";
            cmd.Parameters.Add("seekerId", LoginRegisterForm.newId);
            cmd.Parameters.Add("seekerName", LoginRegisterForm.providerOrSeekerName);
            cmd.Parameters.Add("seekerPass", LoginRegisterForm.providerOrSeekerPassword);
            cmd.Parameters.Add("seekerEmail", LoginRegisterForm.providerOrSeekerEmail);
            cmd.Parameters.Add("seekerGender", gender);
            cmd.Parameters.Add("seekerPhone", phone);
            cmd.Parameters.Add("seekerCity", city);
            cmd.Parameters.Add("seekerCountry", country);
            cmd.Parameters.Add("seekerEdu", edu);
            cmd.ExecuteNonQuery();
            //adding experience
            int maxId, newId;

            for (int i = 0; i < companyName.Count; i++)
            {
                OracleCommand cmdID = new OracleCommand();
                cmdID.Connection  = con;
                cmdID.CommandText = "getExpId";
                cmdID.CommandType = CommandType.StoredProcedure;
                cmdID.Parameters.Add("id", OracleDbType.Int32, ParameterDirection.Output);
                cmdID.ExecuteNonQuery();
                try
                {
                    maxId = Convert.ToInt32(cmdID.Parameters["id"].Value.ToString());
                    newId = maxId + 1;
                }
                catch { newId = 1; }
                OracleCommand cmd2 = new OracleCommand();
                cmd2.Connection = con;
                //A) 3- insert
                cmd2.CommandText = @"insert into EXPERIENCE (EXPERIENCE_ID,COMPANY_NAME ,YEARS_OF_EXPERIENCE , JOBSEEKER_ID,JOB_TITLE)
                                                    values(:EXPERIENCE_ID, :companyName , :yearsOfExp, :JOBSEEKER_ID, :JOB_TITLE)";
                cmd2.Parameters.Add("EXPERIENCE_ID", newId);
                cmd2.Parameters.Add("companyName", companyName[i]);
                cmd2.Parameters.Add("yearsOfExp", yearsOfExp[i]);
                cmd2.Parameters.Add("JOBSEEKER_ID", LoginRegisterForm.newId);
                cmd2.Parameters.Add("JOB_TITLE", jobTitle[i]);
                cmd2.ExecuteNonQuery();
            }
            //adding skills
            for (int i = 0; i < skills.Count; i++)
            {
                OracleCommand cmd2 = new OracleCommand();
                cmd2.Connection = con;
                //A) 3- insert
                cmd2.CommandText = @"insert into JOB_SEEKER_SKILLS (SKILLS,JOBSEEKER_ID)
                                                    values(:skills, :seekerid)";
                cmd2.Parameters.Add("skills", skills[i]);
                cmd2.Parameters.Add("JOBSEEKER_ID", LoginRegisterForm.newId);
                cmd2.ExecuteNonQuery();
            }
            // adding interests
            for (int i = 0; i < interest.Count; i++)
            {
                OracleCommand cmd2 = new OracleCommand();
                cmd2.Connection = con;
                //A) 3- insert
                cmd2.CommandText = @"insert into JOB_SEEKER_INTERESTS (INTERESTS,JOBSEEKER_ID)
                                                    values(:INTERESTS, :JOBSEEKER_ID)";
                cmd2.Parameters.Add("INTERESTS", interest[i]);
                cmd2.Parameters.Add("JOBSEEKER_ID", LoginRegisterForm.newId);
                cmd2.ExecuteNonQuery();
            }
            //adding courses
            for (int i = 0; i < courses.Count; i++)
            {
                OracleCommand cmd2 = new OracleCommand();
                cmd2.Connection = con;
                //A) 3- insert
                cmd2.CommandText = @"insert into JOB_SEEKER_COURSES (COURSE,JOBSEEKER_ID)
                                                    values(:COURSE, :JOBSEEKER_ID)";
                cmd2.Parameters.Add("COURSE", courses[i]);
                cmd2.Parameters.Add("JOBSEEKER_ID", LoginRegisterForm.newId);
                cmd2.ExecuteNonQuery();
            }
            //adding certificates
            for (int i = 0; i < certificates.Count; i++)
            {
                OracleCommand cmd2 = new OracleCommand();
                cmd2.Connection = con;
                //A) 3- insert
                cmd2.CommandText = @"insert into JOB_SEEKER_CERTIFICATES (CERTIFICATE,JOBSEEKER_ID)
                                                    values(:CERTIFICATE, :JOBSEEKER_ID)";
                cmd2.Parameters.Add("CERTIFICATE", certificates[i]);
                cmd2.Parameters.Add("JOBSEEKER_ID", LoginRegisterForm.newId);
                cmd2.ExecuteNonQuery();
            }
            //adding projects
            for (int i = 0; i < startDate.Count; i++)
            {
                OracleCommand cmdIDProject = new OracleCommand();
                cmdIDProject.Connection  = con;
                cmdIDProject.CommandText = "getProjectrId";
                cmdIDProject.CommandType = CommandType.StoredProcedure;
                cmdIDProject.Parameters.Add("id", OracleDbType.Int32, ParameterDirection.Output);
                cmdIDProject.ExecuteNonQuery();
                try
                {
                    maxId = Convert.ToInt32(cmdIDProject.Parameters["id"].Value.ToString());
                    newId = maxId + 1;
                }
                catch { newId = 1; }
                OracleCommand cmd2 = new OracleCommand();
                cmd2.Connection = con;
                //A) 3- insert
                cmd2.CommandText = @"insert into PROJECT_JS (PROJECT_ID,START_DATE ,END_DATE , JOBSEEKER_ID)
                                                    values(:PROJECT_ID, :START_DATE , :END_DATE, :JOBSEEKER_ID)";
                cmd2.Parameters.Add("PROJECT_ID", newId);
                cmd2.Parameters.Add("START_DATE", startDate[i]);
                cmd2.Parameters.Add("END_DATE", endDate[i]);
                cmd2.Parameters.Add("JOBSEEKER_ID", LoginRegisterForm.newId);
                cmd2.ExecuteNonQuery();
                for (int j = 0; j < technology[i].Length; j++)
                {
                    OracleCommand cmd3 = new OracleCommand();
                    cmd3.Connection = con;
                    //A) 3- insert
                    cmd3.CommandText = @"insert into PROJECT_JS_TECHNOLOGY (TECHNOLOGY,PROJECT_ID )
                                                    values(:TECHNOLOGY, :PROJECT_ID)";
                    cmd3.Parameters.Add("TECHNOLOGY", technology[i][j]);
                    cmd3.Parameters.Add("PROJECT_ID", newId);
                    cmd3.ExecuteNonQuery();
                }
            }
            LoginRegisterForm loginform = new LoginRegisterForm();

            this.Hide();
            loginform.ShowDialog();
            this.Close();
        }